View Javadoc

1   package com.atlassian.event.internal;
2   
3   import com.atlassian.event.api.EventPublisher;
4   import com.atlassian.event.config.ListenerHandlersConfiguration;
5   import com.atlassian.event.legacy.LegacyListenerHandler;
6   import com.atlassian.event.spi.ListenerHandler;
7   import org.junit.runner.RunWith;
8   import org.mockito.runners.MockitoJUnitRunner;
9   
10  import java.util.Collections;
11  import java.util.List;
12  
13  /**
14   * <strong>Note:</strong> This is more of a (small) integration test as we use a concrete {@link com.atlassian.event.legacy.LegacyListenerHandler}
15   * at runtime here (and not a stub/mock). It essentially ensure that we get the same behavior at the legacy event manager.
16   */
17  @RunWith(MockitoJUnitRunner.class)
18  public class LockFreeEventPublisherLegacyCompatibilityTest extends AbstractEventPublisherLegacyCompatibilityTest {
19      @Override
20      EventPublisher getEventPublisher() {
21          return new LockFreeEventPublisher(new StubEventDispatcher(), new ListenerHandlersConfiguration() {
22              public List<ListenerHandler> getListenerHandlers() {
23                  return Collections.<ListenerHandler>singletonList(new LegacyListenerHandler());
24              }
25          });
26      }
27  }