use of com.thinkbiganalytics.metadata.rest.model.event.FeedCleanupTriggerEvent in project kylo by Teradata.
the class JmsCleanupEventConsumerTest method test.
/**
* Test consuming and dispatching a cleanup trigger event.
*/
@Test
public void test() {
// Mock event and listener
final FeedCleanupTriggerEvent event = new FeedCleanupTriggerEvent("FEEDID");
event.setCategoryName("cat");
event.setFeedName("feed");
final CleanupListener listener = Mockito.mock(CleanupListener.class);
// Test receiving and triggering event
final JmsCleanupEventConsumer consumer = new JmsCleanupEventConsumer();
consumer.addListener("cat", "feed", listener);
consumer.receiveEvent(event);
Mockito.verify(listener).triggered(event);
// Test removing listener
consumer.removeListener(listener);
consumer.receiveEvent(event);
Mockito.verifyNoMoreInteractions(listener);
}
Aggregations