Search in sources :

Example 1 with DeadEvent

use of com.google.common.eventbus.DeadEvent in project graylog2-server by Graylog2.

the class ClusterEventPeriodicalTest method publishClusterEventSkipsDeadEvent.

@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.DELETE_ALL)
public void publishClusterEventSkipsDeadEvent() throws Exception {
    DBCollection collection = mongoConnection.getDatabase().getCollection(ClusterEventPeriodical.COLLECTION_NAME);
    DeadEvent event = new DeadEvent(clusterEventBus, new SimpleEvent("test"));
    assertThat(collection.count()).isEqualTo(0L);
    clusterEventPeriodical.publishClusterEvent(event);
    verify(clusterEventBus, never()).post(any());
    assertThat(collection.count()).isEqualTo(0L);
}
Also used : DBCollection(com.mongodb.DBCollection) DeadEvent(com.google.common.eventbus.DeadEvent) UsingDataSet(com.lordofthejars.nosqlunit.annotation.UsingDataSet) Test(org.junit.Test)

Example 2 with DeadEvent

use of com.google.common.eventbus.DeadEvent in project graylog2-server by Graylog2.

the class DeadEventLoggingListenerTest method testHandleDeadEvent.

@Test
public void testHandleDeadEvent() {
    final DeadEventLoggingListener listener = new DeadEventLoggingListener();
    final DeadEvent event = new DeadEvent(this, new SimpleEvent("test"));
    listener.handleDeadEvent(event);
}
Also used : DeadEvent(com.google.common.eventbus.DeadEvent) Test(org.junit.Test)

Aggregations

DeadEvent (com.google.common.eventbus.DeadEvent)2 Test (org.junit.Test)2 UsingDataSet (com.lordofthejars.nosqlunit.annotation.UsingDataSet)1 DBCollection (com.mongodb.DBCollection)1