use of com.hotels.styx.Version in project styx by ExpediaGroup.
the class DashboardDataTest method unsubscribesFromEventBus.
@Test
public void unsubscribesFromEventBus() {
EventBus eventBus = mock(EventBus.class);
MemoryBackedRegistry<BackendService> backendServicesRegistry = new MemoryBackedRegistry<>();
backendServicesRegistry.add(application("app", origin("app-01", "localhost", 9090)));
backendServicesRegistry.add(application("test", origin("test-01", "localhost", 9090)));
DashboardData dashbaord = new DashboardData(metricRegistry, backendServicesRegistry, "styx-prod1-presentation-01", new Version("releaseTag"), eventBus);
// Twice for each backend. One during backend construction, another from BackendServicesRegistry listener callback.
verify(eventBus, times(4)).register(any(DashboardData.Origin.class));
dashbaord.unregister();
verify(eventBus, times(4)).unregister(any(DashboardData.Origin.class));
}
Aggregations