|
37 | 37 | import com.optimizely.ab.event.LogEvent;
|
38 | 38 | import com.optimizely.ab.event.internal.EventBuilder;
|
39 | 39 | import com.optimizely.ab.internal.LogbackVerifier;
|
40 |
| -import com.optimizely.ab.notification.ActivateNotification; |
| 40 | +import com.optimizely.ab.notification.ActivateNotificationListener; |
41 | 41 | import com.optimizely.ab.notification.NotificationCenter;
|
42 | 42 | import com.optimizely.ab.notification.NotificationListener;
|
43 |
| -import com.optimizely.ab.notification.TrackNotification; |
| 43 | +import com.optimizely.ab.notification.TrackNotificationListener; |
44 | 44 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
45 | 45 | import org.junit.Rule;
|
46 | 46 | import org.junit.Test;
|
@@ -2215,7 +2215,7 @@ public void activateWithListener() throws Exception {
|
2215 | 2215 |
|
2216 | 2216 | testUserAttributes.put(testBucketingIdKey, testBucketingId);
|
2217 | 2217 |
|
2218 |
| - ActivateNotification activateNotification = new ActivateNotification() { |
| 2218 | + ActivateNotificationListener activateNotification = new ActivateNotificationListener() { |
2219 | 2219 | @Override
|
2220 | 2220 | public void onActivate(@Nonnull Experiment experiment, @Nonnull String userId, @Nonnull Map<String, String> attributes, @Nonnull Variation variation, @Nonnull LogEvent event) {
|
2221 | 2221 | assertEquals(experiment.getKey(), activatedExperiment.getKey());
|
@@ -2283,7 +2283,7 @@ public void activateWithListenerNullAttributes() throws Exception {
|
2283 | 2283 | when(mockBucketer.bucket(activatedExperiment, testUserId))
|
2284 | 2284 | .thenReturn(bucketedVariation);
|
2285 | 2285 |
|
2286 |
| - ActivateNotification activateNotification = new ActivateNotification() { |
| 2286 | + ActivateNotificationListener activateNotification = new ActivateNotificationListener() { |
2287 | 2287 | @Override
|
2288 | 2288 | public void onActivate(@Nonnull Experiment experiment, @Nonnull String userId, @Nonnull Map<String, String> attributes, @Nonnull Variation variation, @Nonnull LogEvent event) {
|
2289 | 2289 | assertEquals(experiment.getKey(), activatedExperiment.getKey());
|
@@ -2608,7 +2608,7 @@ public void addNotificationListenerFromNotificationCenter() throws Exception {
|
2608 | 2608 | .thenReturn(bucketedVariation);
|
2609 | 2609 |
|
2610 | 2610 | // Add listener
|
2611 |
| - ActivateNotification listener = mock(ActivateNotification.class); |
| 2611 | + ActivateNotificationListener listener = mock(ActivateNotificationListener.class); |
2612 | 2612 | optimizely.notificationCenter.addNotification(NotificationCenter.NotificationType.Activate, listener);
|
2613 | 2613 |
|
2614 | 2614 | // Check if listener is notified when experiment is activated
|
@@ -2636,7 +2636,7 @@ public void addNotificationListenerFromNotificationCenter() throws Exception {
|
2636 | 2636 | anyMapOf(String.class, Object.class)))
|
2637 | 2637 | .thenReturn(logEventToDispatch);
|
2638 | 2638 |
|
2639 |
| - TrackNotification trackNotification = mock(TrackNotification.class); |
| 2639 | + TrackNotificationListener trackNotification = mock(TrackNotificationListener.class); |
2640 | 2640 |
|
2641 | 2641 | optimizely.notificationCenter.addNotification(NotificationCenter.NotificationType.Track, trackNotification);
|
2642 | 2642 |
|
@@ -2680,11 +2680,11 @@ public void removeNotificationListenerNotificationCenter() throws Exception {
|
2680 | 2680 | .thenReturn(logEventToDispatch);
|
2681 | 2681 |
|
2682 | 2682 | // Add and remove listener
|
2683 |
| - ActivateNotification activateNotification = mock(ActivateNotification.class); |
| 2683 | + ActivateNotificationListener activateNotification = mock(ActivateNotificationListener.class); |
2684 | 2684 | int notificationId = optimizely.notificationCenter.addNotification(NotificationCenter.NotificationType.Activate, activateNotification);
|
2685 | 2685 | assertTrue(optimizely.notificationCenter.removeNotification(notificationId));
|
2686 | 2686 |
|
2687 |
| - TrackNotification trackNotification = mock(TrackNotification.class); |
| 2687 | + TrackNotificationListener trackNotification = mock(TrackNotificationListener.class); |
2688 | 2688 | notificationId = optimizely.notificationCenter.addNotification(NotificationCenter.NotificationType.Track, trackNotification);
|
2689 | 2689 | assertTrue(optimizely.notificationCenter.removeNotification(notificationId));
|
2690 | 2690 |
|
@@ -2771,8 +2771,8 @@ public void clearNotificationListenersNotificationCenter() throws Exception {
|
2771 | 2771 | attributeCaptor.capture()
|
2772 | 2772 | )).thenReturn(logEventToDispatch);
|
2773 | 2773 |
|
2774 |
| - ActivateNotification activateNotification = mock(ActivateNotification.class); |
2775 |
| - TrackNotification trackNotification = mock(TrackNotification.class); |
| 2774 | + ActivateNotificationListener activateNotification = mock(ActivateNotificationListener.class); |
| 2775 | + TrackNotificationListener trackNotification = mock(TrackNotificationListener.class); |
2776 | 2776 |
|
2777 | 2777 | optimizely.notificationCenter.addNotification(NotificationCenter.NotificationType.Activate, activateNotification);
|
2778 | 2778 | optimizely.notificationCenter.addNotification(NotificationCenter.NotificationType.Track, trackNotification);
|
@@ -2870,7 +2870,7 @@ public void trackEventWithListenerAttributes() throws Exception {
|
2870 | 2870 | logbackVerifier.expectMessage(Level.DEBUG, "Dispatching conversion event to URL test_url with params " +
|
2871 | 2871 | testParams + " and payload \"\"");
|
2872 | 2872 |
|
2873 |
| - TrackNotification trackNotification = new TrackNotification() { |
| 2873 | + TrackNotificationListener trackNotification = new TrackNotificationListener() { |
2874 | 2874 | @Override
|
2875 | 2875 | public void onTrack(@Nonnull String eventKey, @Nonnull String userId, @Nonnull Map<String, String> _attributes, @Nonnull Map<String, ?> eventTags, @Nonnull LogEvent event) {
|
2876 | 2876 | assertEquals(eventType.getKey(), eventKey);
|
@@ -2956,7 +2956,7 @@ public void trackEventWithListenerNullAttributes() throws Exception {
|
2956 | 2956 | logbackVerifier.expectMessage(Level.DEBUG, "Dispatching conversion event to URL test_url with params " +
|
2957 | 2957 | testParams + " and payload \"\"");
|
2958 | 2958 |
|
2959 |
| - TrackNotification trackNotification = new TrackNotification() { |
| 2959 | + TrackNotificationListener trackNotification = new TrackNotificationListener() { |
2960 | 2960 | @Override
|
2961 | 2961 | public void onTrack(@Nonnull String eventKey, @Nonnull String userId, @Nonnull Map<String, String> attributes, @Nonnull Map<String, ?> eventTags, @Nonnull LogEvent event) {
|
2962 | 2962 | assertEquals(eventType.getKey(), eventKey);
|
|
0 commit comments