From 503864471b892592140117de9f89073fe710d56b Mon Sep 17 00:00:00 2001 From: Mike Davis Date: Wed, 1 Aug 2018 09:07:44 -0700 Subject: [PATCH] Move serialization to LogEvent.getBody(). --- .../java/com/optimizely/ab/Optimizely.java | 18 +++- .../com/optimizely/ab/event/LogEvent.java | 19 +++- .../ab/event/internal/EventFactory.java | 10 +- .../com/optimizely/ab/OptimizelyTest.java | 96 +++---------------- .../ab/event/NoopEventHandlerTest.java | 4 +- 5 files changed, 46 insertions(+), 101 deletions(-) diff --git a/core-api/src/main/java/com/optimizely/ab/Optimizely.java b/core-api/src/main/java/com/optimizely/ab/Optimizely.java index 652c732d5..51f5dadbd 100644 --- a/core-api/src/main/java/com/optimizely/ab/Optimizely.java +++ b/core-api/src/main/java/com/optimizely/ab/Optimizely.java @@ -199,9 +199,13 @@ private void sendImpression(@Nonnull ProjectConfig projectConfig, userId, filteredAttributes); logger.info("Activating user \"{}\" in experiment \"{}\".", userId, experiment.getKey()); - logger.debug( - "Dispatching impression event to URL {} with params {} and payload \"{}\".", - impressionEvent.getEndpointUrl(), impressionEvent.getRequestParams(), impressionEvent.getBody()); + + if (logger.isDebugEnabled()) { + logger.debug( + "Dispatching impression event to URL {} with params {} and payload \"{}\".", + impressionEvent.getEndpointUrl(), impressionEvent.getRequestParams(), impressionEvent.getBody()); + } + try { eventHandler.dispatchEvent(impressionEvent); } catch (Exception e) { @@ -294,8 +298,12 @@ public void track(@Nonnull String eventName, } logger.info("Tracking event \"{}\" for user \"{}\".", eventName, userId); - logger.debug("Dispatching conversion event to URL {} with params {} and payload \"{}\".", - conversionEvent.getEndpointUrl(), conversionEvent.getRequestParams(), conversionEvent.getBody()); + + if (logger.isDebugEnabled()) { + logger.debug("Dispatching conversion event to URL {} with params {} and payload \"{}\".", + conversionEvent.getEndpointUrl(), conversionEvent.getRequestParams(), conversionEvent.getBody()); + } + try { eventHandler.dispatchEvent(conversionEvent); } catch (Exception e) { diff --git a/core-api/src/main/java/com/optimizely/ab/event/LogEvent.java b/core-api/src/main/java/com/optimizely/ab/event/LogEvent.java index a353d9877..d985c3f4f 100644 --- a/core-api/src/main/java/com/optimizely/ab/event/LogEvent.java +++ b/core-api/src/main/java/com/optimizely/ab/event/LogEvent.java @@ -16,6 +16,10 @@ */ package com.optimizely.ab.event; +import com.optimizely.ab.event.internal.payload.EventBatch; +import com.optimizely.ab.event.internal.serializer.DefaultJsonSerializer; +import com.optimizely.ab.event.internal.serializer.Serializer; + import java.util.Map; import javax.annotation.Nonnull; @@ -30,16 +34,16 @@ public class LogEvent { private final RequestMethod requestMethod; private final String endpointUrl; private final Map requestParams; - private final String body; + private final EventBatch eventBatch; public LogEvent(@Nonnull RequestMethod requestMethod, @Nonnull String endpointUrl, @Nonnull Map requestParams, - @Nonnull String body) { + EventBatch eventBatch) { this.requestMethod = requestMethod; this.endpointUrl = endpointUrl; this.requestParams = requestParams; - this.body = body; + this.eventBatch = eventBatch; } //======== Getters ========// @@ -57,7 +61,12 @@ public Map getRequestParams() { } public String getBody() { - return body; + if (eventBatch == null) { + return ""; + } + + Serializer serializer = DefaultJsonSerializer.getInstance(); + return serializer.serialize(eventBatch); } //======== Overriding method ========// @@ -68,7 +77,7 @@ public String toString() { "requestMethod=" + requestMethod + ", endpointUrl='" + endpointUrl + '\'' + ", requestParams=" + requestParams + - ", body='" + body + '\'' + + ", body='" + getBody() + '\'' + '}'; } diff --git a/core-api/src/main/java/com/optimizely/ab/event/internal/EventFactory.java b/core-api/src/main/java/com/optimizely/ab/event/internal/EventFactory.java index ea4bb5b40..a7aedda50 100644 --- a/core-api/src/main/java/com/optimizely/ab/event/internal/EventFactory.java +++ b/core-api/src/main/java/com/optimizely/ab/event/internal/EventFactory.java @@ -28,8 +28,6 @@ import com.optimizely.ab.event.internal.payload.Event; import com.optimizely.ab.event.internal.payload.Snapshot; import com.optimizely.ab.event.internal.payload.Visitor; -import com.optimizely.ab.event.internal.serializer.DefaultJsonSerializer; -import com.optimizely.ab.event.internal.serializer.Serializer; import com.optimizely.ab.internal.EventTagUtils; import com.optimizely.ab.internal.ControlAttribute; import org.slf4j.Logger; @@ -46,7 +44,6 @@ public class EventFactory { static final String EVENT_ENDPOINT = "https://logx.optimizely.com/v1/events"; // Should be part of the datafile static final String ACTIVATE_EVENT_KEY = "campaign_activated"; - private Serializer serializer; @VisibleForTesting public final String clientVersion; @VisibleForTesting @@ -59,7 +56,6 @@ public EventFactory() { public EventFactory(EventBatch.ClientEngine clientEngine, String clientVersion) { this.clientEngine = clientEngine; this.clientVersion = clientVersion; - this.serializer = DefaultJsonSerializer.getInstance(); } public LogEvent createImpressionEvent(@Nonnull ProjectConfig projectConfig, @@ -104,8 +100,7 @@ public LogEvent createImpressionEvent(@Nonnull ProjectConfig projectConfig, .setRevision(projectConfig.getRevision()) .build(); - String payload = this.serializer.serialize(eventBatch); - return new LogEvent(LogEvent.RequestMethod.POST, EVENT_ENDPOINT, Collections.emptyMap(), payload); + return new LogEvent(LogEvent.RequestMethod.POST, EVENT_ENDPOINT, Collections.emptyMap(), eventBatch); } public LogEvent createConversionEvent(@Nonnull ProjectConfig projectConfig, @@ -166,8 +161,7 @@ public LogEvent createConversionEvent(@Nonnull ProjectConfig projectConfig, .setRevision(projectConfig.getRevision()) .build(); - String payload = this.serializer.serialize(eventBatch); - return new LogEvent(LogEvent.RequestMethod.POST, EVENT_ENDPOINT, Collections.emptyMap(), payload); + return new LogEvent(LogEvent.RequestMethod.POST, EVENT_ENDPOINT, Collections.emptyMap(), eventBatch); } private List buildAttributeList(ProjectConfig projectConfig, Map attributes) { diff --git a/core-api/src/test/java/com/optimizely/ab/OptimizelyTest.java b/core-api/src/test/java/com/optimizely/ab/OptimizelyTest.java index c474758c5..b121624c6 100644 --- a/core-api/src/test/java/com/optimizely/ab/OptimizelyTest.java +++ b/core-api/src/test/java/com/optimizely/ab/OptimizelyTest.java @@ -36,12 +36,14 @@ import com.optimizely.ab.event.EventHandler; import com.optimizely.ab.event.LogEvent; import com.optimizely.ab.event.internal.EventFactory; +import com.optimizely.ab.event.internal.payload.EventBatch; import com.optimizely.ab.internal.LogbackVerifier; import com.optimizely.ab.internal.ControlAttribute; import com.optimizely.ab.notification.ActivateNotificationListener; import com.optimizely.ab.notification.NotificationCenter; import com.optimizely.ab.notification.TrackNotificationListener; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -134,6 +136,8 @@ public static Collection data() throws IOException { private static final String testUserId = "userId"; private static final String testBucketingId = "bucketingId"; private static final String testBucketingIdKey = ControlAttribute.BUCKETING_ATTRIBUTE.toString(); + private static final Map testParams = Collections.singletonMap("test", "params"); + private static final LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, null); private int datafileVersion; private String validDatafile; @@ -185,10 +189,7 @@ public void activateEndToEnd() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(validProjectConfig, activatedExperiment, bucketedVariation, testUserId, testUserAttributes)) .thenReturn(logEventToDispatch); @@ -305,10 +306,6 @@ public void activateWithExperimentKeyForced() throws Exception { testUserAttributes.put(testBucketingIdKey, testBucketingId); - Map testParams = new HashMap(); - testParams.put("test", "params"); - - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(eq(validProjectConfig), eq(activatedExperiment), eq(forcedVariation), eq(testUserId), eq(testUserAttributes))) .thenReturn(logEventToDispatch); @@ -361,10 +358,6 @@ public void getVariationWithExperimentKeyForced() throws Exception { testUserAttributes.put(testBucketingIdKey, testBucketingId); - Map testParams = new HashMap(); - testParams.put("test", "params"); - - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(eq(validProjectConfig), eq(activatedExperiment), eq(forcedVariation), eq(testUserId), eq(testUserAttributes))) .thenReturn(logEventToDispatch); @@ -413,10 +406,6 @@ public void isFeatureEnabledWithExperimentKeyForced() throws Exception { testUserAttributes.put("browser_type", "chrome"); } - Map testParams = new HashMap(); - testParams.put("test", "params"); - - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(eq(validProjectConfig), eq(activatedExperiment), eq(forcedVariation), eq(testUserId), eq(testUserAttributes))) .thenReturn(logEventToDispatch); @@ -463,9 +452,6 @@ public void activateWithExperimentKey() throws Exception { testUserAttributes.put(testBucketingIdKey, testBucketingId); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(eq(validProjectConfig), eq(activatedExperiment), eq(bucketedVariation), eq(testUserId), eq(testUserAttributes))) .thenReturn(logEventToDispatch); @@ -550,9 +536,6 @@ public void activateWithAttributes() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(eq(validProjectConfig), eq(activatedExperiment), eq(bucketedVariation), eq(testUserId), anyMapOf(String.class, String.class))) .thenReturn(logEventToDispatch); @@ -618,9 +601,6 @@ public void activateWithUnknownAttribute() throws Exception { } testUserAttributes.put("unknownAttribute", "dimValue"); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(eq(validProjectConfig), eq(activatedExperiment), eq(bucketedVariation), eq(testUserId), anyMapOf(String.class, String.class))) .thenReturn(logEventToDispatch); @@ -675,9 +655,6 @@ public void activateWithNullAttributes() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(eq(noAudienceProjectConfig), eq(activatedExperiment), eq(bucketedVariation), eq(testUserId), eq(Collections.emptyMap()))) .thenReturn(logEventToDispatch); @@ -726,9 +703,6 @@ public void activateWithNullAttributeValues() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(eq(validProjectConfig), eq(activatedExperiment), eq(bucketedVariation), eq(testUserId), anyMapOf(String.class, String.class))) .thenReturn(logEventToDispatch); @@ -1339,8 +1313,6 @@ public void trackEventWithAttributes() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); Map attributes = ImmutableMap.of(attribute.getKey(), "attributeValue"); Map experimentVariationMap = createExperimentVariationMap( validProjectConfig, @@ -1348,7 +1320,7 @@ public void trackEventWithAttributes() throws Exception { eventType.getKey(), genericUserId, attributes); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); + when(mockEventFactory.createConversionEvent( eq(validProjectConfig), eq(experimentVariationMap), @@ -1412,15 +1384,13 @@ public void trackEventWithNullAttributes() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); Map experimentVariationMap = createExperimentVariationMap( validProjectConfig, mockDecisionService, eventType.getKey(), genericUserId, Collections.emptyMap()); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); + when(mockEventFactory.createConversionEvent( eq(validProjectConfig), eq(experimentVariationMap), @@ -1484,15 +1454,13 @@ public void trackEventWithNullAttributeValues() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); Map experimentVariationMap = createExperimentVariationMap( validProjectConfig, mockDecisionService, eventType.getKey(), genericUserId, Collections.emptyMap()); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); + when(mockEventFactory.createConversionEvent( eq(validProjectConfig), eq(experimentVariationMap), @@ -1556,15 +1524,13 @@ public void trackEventWithUnknownAttribute() throws Exception { .withErrorHandler(new RaiseExceptionErrorHandler()) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); Map experimentVariationMap = createExperimentVariationMap( validProjectConfig, mockDecisionService, eventType.getKey(), genericUserId, Collections.emptyMap()); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); + when(mockEventFactory.createConversionEvent( eq(validProjectConfig), eq(experimentVariationMap), @@ -1627,9 +1593,6 @@ public void trackEventWithEventTags() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); - Map eventTags = new HashMap(); eventTags.put("int_param", 123); eventTags.put("string_param", "123"); @@ -1642,7 +1605,6 @@ public void trackEventWithEventTags() throws Exception { genericUserId, Collections.emptyMap()); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createConversionEvent( eq(validProjectConfig), eq(experimentVariationMap), @@ -1710,15 +1672,13 @@ public void trackEventWithNullEventTags() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); Map experimentVariationMap = createExperimentVariationMap( validProjectConfig, mockDecisionService, eventType.getKey(), genericUserId, Collections.emptyMap()); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); + when(mockEventFactory.createConversionEvent( eq(validProjectConfig), eq(experimentVariationMap), @@ -1775,15 +1735,13 @@ public void trackEventWithNullOrEmptyUserID() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); Map experimentVariationMap = createExperimentVariationMap( validProjectConfig, mockDecisionService, eventType.getKey(), genericUserId, Collections.emptyMap()); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); + when(mockEventFactory.createConversionEvent( eq(validProjectConfig), eq(experimentVariationMap), @@ -1826,15 +1784,13 @@ public void trackEventWithNullOrEmptyEventKey() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); Map experimentVariationMap = createExperimentVariationMap( validProjectConfig, mockDecisionService, eventType.getKey(), genericUserId, Collections.emptyMap()); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); + when(mockEventFactory.createConversionEvent( eq(validProjectConfig), eq(experimentVariationMap), @@ -1983,8 +1939,6 @@ public void trackDispatchesWhenEventHasLaunchedAndRunningExperiments() throws Ex .withEventBuilder(mockEventFactory) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); Map experimentVariationMap = createExperimentVariationMap( noAudienceProjectConfig, client.decisionService, @@ -1995,7 +1949,6 @@ public void trackDispatchesWhenEventHasLaunchedAndRunningExperiments() throws Ex // Create an Argument Captor to ensure we are creating a correct experiment variation map ArgumentCaptor experimentVariationMapCaptor = ArgumentCaptor.forClass(Map.class); - LogEvent conversionEvent = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createConversionEvent( eq(noAudienceProjectConfig), experimentVariationMapCaptor.capture(), @@ -2004,7 +1957,7 @@ public void trackDispatchesWhenEventHasLaunchedAndRunningExperiments() throws Ex eq(eventType.getKey()), eq(Collections.emptyMap()), eq(Collections.emptyMap()) - )).thenReturn(conversionEvent); + )).thenReturn(logEventToDispatch); List eventExperiments = noAudienceProjectConfig.getExperimentsForEventKey(eventType.getKey()); for (Experiment experiment : eventExperiments) { @@ -2020,7 +1973,7 @@ public void trackDispatchesWhenEventHasLaunchedAndRunningExperiments() throws Ex // The event has 1 launched experiment and 1 running experiment. // It should send a track event with the running experiment client.track(eventType.getKey(), genericUserId, Collections.emptyMap()); - verify(client.eventHandler).dispatchEvent(eq(conversionEvent)); + verify(client.eventHandler).dispatchEvent(eq(logEventToDispatch)); // Check the argument captor got the correct arguments Map actualExperimentVariationMap = experimentVariationMapCaptor.getValue(); @@ -2384,9 +2337,6 @@ public void onActivate(@Nonnull Experiment experiment, @Nonnull String userId, @ int notificationId = optimizely.notificationCenter.addNotificationListener(NotificationCenter.NotificationType.Activate, activateNotification); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(eq(validProjectConfig), eq(activatedExperiment), eq(bucketedVariation), eq(testUserId), eq(testUserAttributes))) .thenReturn(logEventToDispatch); @@ -2425,9 +2375,6 @@ public void activateWithListenerNullAttributes() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(eq(noAudienceProjectConfig), eq(activatedExperiment), eq(bucketedVariation), eq(testUserId), eq(Collections.emptyMap()))) .thenReturn(logEventToDispatch); @@ -2505,9 +2452,6 @@ public void addNotificationListenerFromNotificationCenter() throws Exception { Map attributes = Collections.emptyMap(); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(validProjectConfig, activatedExperiment, bucketedVariation, genericUserId, attributes)) .thenReturn(logEventToDispatch); @@ -2576,9 +2520,6 @@ public void removeNotificationListenerNotificationCenter() throws Exception { Map attributes = new HashMap(); attributes.put(ATTRIBUTE_HOUSE_KEY, AUDIENCE_GRYFFINDOR_VALUE); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(validProjectConfig, activatedExperiment, bucketedVariation, genericUserId, attributes)) .thenReturn(logEventToDispatch); @@ -2661,9 +2602,6 @@ public void clearNotificationListenersNotificationCenter() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); when(mockEventFactory.createImpressionEvent(validProjectConfig, activatedExperiment, bucketedVariation, genericUserId, attributes)) .thenReturn(logEventToDispatch); @@ -2756,8 +2694,6 @@ public void trackEventWithListenerAttributes() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); final Map attributes = ImmutableMap.of(attribute.getKey(), "attributeValue"); Map experimentVariationMap = createExperimentVariationMap( validProjectConfig, @@ -2765,7 +2701,7 @@ public void trackEventWithListenerAttributes() throws Exception { eventType.getKey(), genericUserId, attributes); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); + when(mockEventFactory.createConversionEvent( eq(validProjectConfig), eq(experimentVariationMap), @@ -2843,15 +2779,13 @@ public void trackEventWithListenerNullAttributes() throws Exception { .withErrorHandler(mockErrorHandler) .build(); - Map testParams = new HashMap(); - testParams.put("test", "params"); Map experimentVariationMap = createExperimentVariationMap( validProjectConfig, mockDecisionService, eventType.getKey(), genericUserId, Collections.emptyMap()); - LogEvent logEventToDispatch = new LogEvent(RequestMethod.GET, "test_url", testParams, ""); + when(mockEventFactory.createConversionEvent( eq(validProjectConfig), eq(experimentVariationMap), diff --git a/core-api/src/test/java/com/optimizely/ab/event/NoopEventHandlerTest.java b/core-api/src/test/java/com/optimizely/ab/event/NoopEventHandlerTest.java index 9b1f29e9c..fe72704d5 100644 --- a/core-api/src/test/java/com/optimizely/ab/event/NoopEventHandlerTest.java +++ b/core-api/src/test/java/com/optimizely/ab/event/NoopEventHandlerTest.java @@ -39,7 +39,7 @@ public class NoopEventHandlerTest { public void dispatchEvent() throws Exception { NoopEventHandler noopEventHandler = new NoopEventHandler(); noopEventHandler.dispatchEvent( - new LogEvent(RequestMethod.GET, "blah", Collections.emptyMap(), "")); + new LogEvent(RequestMethod.GET, "blah", Collections.emptyMap(), null)); logbackVerifier.expectMessage(Level.DEBUG, "Called dispatchEvent with URL: blah and params: {}"); } -} \ No newline at end of file +}