use of com.hotels.styx.client.origincommands.EnableOrigin in project styx by ExpediaGroup.
the class OriginsInventoryTest method willNotEnableOriginsNotBelongingToTheApp.
@Test
public void willNotEnableOriginsNotBelongingToTheApp() {
inventory.setOrigins(ORIGIN_1);
inventory.onCommand(new DisableOrigin(ORIGIN_1.applicationId(), ORIGIN_1.id()));
inventory.onCommand(new EnableOrigin(id("some-other-app"), ORIGIN_1.id()));
assertThat(inventory.originCount(ACTIVE), is(0));
verify(eventBus, times(2)).post(any(OriginsSnapshot.class));
}
use of com.hotels.styx.client.origincommands.EnableOrigin in project styx by ExpediaGroup.
the class OriginsInventoryTest method enablingAnOriginWillReInitiateHealthCheckMonitoring.
@Test
public void enablingAnOriginWillReInitiateHealthCheckMonitoring() {
inventory.setOrigins(ORIGIN_1);
inventory.onCommand(new DisableOrigin(ORIGIN_1.applicationId(), ORIGIN_1.id()));
inventory.onCommand(new EnableOrigin(ORIGIN_1.applicationId(), ORIGIN_1.id()));
verify(monitor, times(2)).monitor(singleton(ORIGIN_1));
assertThat(gaugeValue("generic-app", "app-01"), isValue(0.0));
verify(eventBus, times(3)).post(any(OriginsSnapshot.class));
}
use of com.hotels.styx.client.origincommands.EnableOrigin in project styx by ExpediaGroup.
the class OriginsInventoryTest method logsMessageWhenDisabledOriginWithHealthChecksIsEnabled.
@Test
public void logsMessageWhenDisabledOriginWithHealthChecksIsEnabled() {
inventory.setOrigins(ORIGIN_1);
inventory.onCommand(new DisableOrigin(ORIGIN_1.applicationId(), ORIGIN_1.id()));
inventory.onCommand(new EnableOrigin(ORIGIN_1.applicationId(), ORIGIN_1.id()));
assertThat(logger.lastMessage(), is(loggingEvent(INFO, "Origin state change: origin=\"generic-app=app-01\", change=\"DISABLED->INACTIVE\"")));
}
Aggregations