From e5013912e5e1f62cd4ae9ee77fa765ed664c7d2f Mon Sep 17 00:00:00 2001 From: JoeOLeary Date: Fri, 1 Mar 2019 14:09:52 +0000 Subject: Update DataRouter Subscriber *Update metadata header key to match new datarouter specification *Update subscriber to be a privileged subscriber *Update subscriber to improve logging & remove sonar smells *Update delivery end point to match datarouter specification *Update event to include the publish id provided by datarouter *Add datarouter event processed utility Issue-ID: DCAEGEN2-1038 Change-Id: Iafce544f31f888de53547de8b280faebd8075d4c Signed-off-by: JoeOLeary --- src/test/java/utils/EventUtils.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/test/java/utils') diff --git a/src/test/java/utils/EventUtils.java b/src/test/java/utils/EventUtils.java index 90317c2..a6b131c 100644 --- a/src/test/java/utils/EventUtils.java +++ b/src/test/java/utils/EventUtils.java @@ -75,11 +75,26 @@ public class EventUtils { } /** + * Makes an event with a mock http server exchange, empty mdc and publish identity * @param body body for the event. * @param eventMetadata metadata for the event. * @return event with mock HttpServerExchange */ public static Event makeMockEvent(String body, EventMetadata eventMetadata) { - return new Event(mock(HttpServerExchange.class, RETURNS_DEEP_STUBS), body, eventMetadata, new HashMap<>()); + return new Event(mock(HttpServerExchange.class, RETURNS_DEEP_STUBS), body, eventMetadata, new HashMap<>(), ""); } + + + /** + * Makes an event with a mock http server exchange and empty mdc + * @param body body for the event. + * @param eventMetadata metadata for the event. + * @return event with mock HttpServerExchange + */ + public static Event makeMockEvent(String body, EventMetadata eventMetadata, String publishIdentity) { + HttpServerExchange mockHttpServerExchange = mock(HttpServerExchange.class, RETURNS_DEEP_STUBS); + return new Event(mockHttpServerExchange, body, eventMetadata, new HashMap<>(), publishIdentity); + } + + } -- cgit 1.2.3-korg