use of com.hotels.styx.client.origincommands.DisableOrigin in project styx by ExpediaGroup.
the class OriginsInventoryTest method disablingAnOriginRemovesItFromInactiveSetAndStopsHealthCheckMonitoring.
@Test
public void disablingAnOriginRemovesItFromInactiveSetAndStopsHealthCheckMonitoring() {
inventory.setOrigins(ORIGIN_1);
inventory.originUnhealthy(ORIGIN_1);
inventory.onCommand(new DisableOrigin(ORIGIN_1.applicationId(), ORIGIN_1.id()));
assertThat(inventory.originCount(ACTIVE), is(0));
assertThat(inventory.originCount(DISABLED), is(1));
verify(monitor).stopMonitoring(singleton(ORIGIN_1));
assertThat(gaugeValue("generic-app", "app-01"), isValue(-1.0));
verify(eventBus, times(3)).post(any(OriginsSnapshot.class));
}
use of com.hotels.styx.client.origincommands.DisableOrigin in project styx by ExpediaGroup.
the class OriginsInventoryTest method disablingAnOriginRemovesItFromActiveSetAndStopsHealthCheckMonitoring.
@Test
public void disablingAnOriginRemovesItFromActiveSetAndStopsHealthCheckMonitoring() {
inventory.setOrigins(ORIGIN_1);
inventory.onCommand(new DisableOrigin(ORIGIN_1.applicationId(), ORIGIN_1.id()));
assertThat(inventory.originCount(ACTIVE), is(0));
assertThat(inventory.originCount(DISABLED), is(1));
verify(monitor).stopMonitoring(singleton(ORIGIN_1));
assertThat(gaugeValue("generic-app", "app-01"), isValue(-1.0));
verify(eventBus, times(2)).post(any(OriginsSnapshot.class));
}
Aggregations