Search in sources :

Example 1 with OriginsChangeListener

use of com.hotels.styx.api.extension.OriginsChangeListener in project styx by ExpediaGroup.

the class OriginsInventoryTest method announcesListenersOnOriginStateChanges.

@Test
public void announcesListenersOnOriginStateChanges() {
    OriginsChangeListener listener = mock(OriginsChangeListener.class);
    inventory.addOriginsChangeListener(listener);
    inventory.setOrigins(ORIGIN_1);
    inventory.originUnhealthy(ORIGIN_1);
    verify(listener, times(2)).originsChanged(any(OriginsSnapshot.class));
}
Also used : OriginsChangeListener(com.hotels.styx.api.extension.OriginsChangeListener) OriginsSnapshot(com.hotels.styx.api.extension.OriginsSnapshot) Test(org.junit.jupiter.api.Test)

Aggregations

OriginsChangeListener (com.hotels.styx.api.extension.OriginsChangeListener)1 OriginsSnapshot (com.hotels.styx.api.extension.OriginsSnapshot)1 Test (org.junit.jupiter.api.Test)1