From c1d4f4f07ea41809026ec17b4e704eb1f69927e4 Mon Sep 17 00:00:00 2001 From: Inal Arsanukaev Date: Tue, 23 Aug 2022 19:27:33 +0300 Subject: [PATCH] Fill parent id (#26) Co-authored-by: Inal Arsanukaev --- .../java/dev/vality/hooker/converter/WebhookMessageBuilder.java | 2 +- .../dev/vality/hooker/converter/WebhookMessageBuilderTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/vality/hooker/converter/WebhookMessageBuilder.java b/src/main/java/dev/vality/hooker/converter/WebhookMessageBuilder.java index 38e03d7..b955054 100644 --- a/src/main/java/dev/vality/hooker/converter/WebhookMessageBuilder.java +++ b/src/main/java/dev/vality/hooker/converter/WebhookMessageBuilder.java @@ -31,7 +31,7 @@ public class WebhookMessageBuilder { .setWebhookId(webhookMessageModel.getHookId()) .setSourceId(sourceId) .setEventId(event.getEventID()) - .setParentEventId(-1) //TODO REMOVE + .setParentEventId(parentId) .setCreatedAt(TypeUtil.temporalToString(Instant.now())) .setUrl(webhookMessageModel.getUrl()) .setContentType(ContentType.APPLICATION_JSON.getMimeType()) diff --git a/src/test/java/dev/vality/hooker/converter/WebhookMessageBuilderTest.java b/src/test/java/dev/vality/hooker/converter/WebhookMessageBuilderTest.java index 1914059..abd5da3 100644 --- a/src/test/java/dev/vality/hooker/converter/WebhookMessageBuilderTest.java +++ b/src/test/java/dev/vality/hooker/converter/WebhookMessageBuilderTest.java @@ -50,7 +50,7 @@ public class WebhookMessageBuilderTest { long parentId = 1L; WebhookMessage webhookMessage = builder.build(webhookMessageModel, event, sourceId, parentId); assertEquals(sourceId, webhookMessage.getSourceId()); - //assertEquals(parentId, webhookMessage.getParentEventId()); + assertEquals(parentId, webhookMessage.getParentEventId()); assertEquals(webhookMessageModel.getHookId(), webhookMessage.getWebhookId()); assertEquals(event.getEventID().longValue(), webhookMessage.getEventId()); assertNotNull(webhookMessage.getAdditionalHeaders().get("Content-Signature"));