From 94fe10d7c6d061a58c9630e38d1b56cbfbf11ed4 Mon Sep 17 00:00:00 2001 From: Remco Westerhoud Date: Wed, 1 Feb 2023 09:37:37 +0100 Subject: [PATCH] feat(log): add ResourceDeletion logger Adds a logger for the new ResourceDeletion ValueType. This record only contains a resource key. --- .../process/test/filters/logger/RecordStreamLogger.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/filters/src/main/java/io/camunda/zeebe/process/test/filters/logger/RecordStreamLogger.java b/filters/src/main/java/io/camunda/zeebe/process/test/filters/logger/RecordStreamLogger.java index 785dd105..ca9109f4 100644 --- a/filters/src/main/java/io/camunda/zeebe/process/test/filters/logger/RecordStreamLogger.java +++ b/filters/src/main/java/io/camunda/zeebe/process/test/filters/logger/RecordStreamLogger.java @@ -39,6 +39,7 @@ import io.camunda.zeebe.protocol.record.value.ProcessInstanceRecordValue; import io.camunda.zeebe.protocol.record.value.ProcessInstanceResultRecordValue; import io.camunda.zeebe.protocol.record.value.ProcessMessageSubscriptionRecordValue; +import io.camunda.zeebe.protocol.record.value.ResourceDeletionRecordValue; import io.camunda.zeebe.protocol.record.value.SignalRecordValue; import io.camunda.zeebe.protocol.record.value.SignalSubscriptionRecordValue; import io.camunda.zeebe.protocol.record.value.TimerRecordValue; @@ -106,6 +107,8 @@ public RecordStreamLogger(final RecordStreamSource recordStreamSource) { valueTypeLoggers.put(ValueType.SIGNAL_SUBSCRIPTION, this::logSignalSubscriptionRecordValue); valueTypeLoggers.put(ValueType.SIGNAL, this::logSignalRecordValue); + + valueTypeLoggers.put(ValueType.RESOURCE_DELETION, this::logResourceDeletionRecordValue); } public void log() { @@ -404,6 +407,11 @@ private String logSignalRecordValue(final Record record) { return joiner.toString(); } + private String logResourceDeletionRecordValue(final Record record) { + final ResourceDeletionRecordValue value = (ResourceDeletionRecordValue) record.getValue(); + return String.format("(Resource key: %d", value.getResourceKey()); + } + protected Map, String>> getValueTypeLoggers() { return valueTypeLoggers; }