use of org.springframework.integration.leader.event.OnGrantedEvent in project spring-integration by spring-projects.
the class EndpointRoleParserTests method test.
@Test
public void test() {
assertFalse(this.in.isRunning());
assertFalse(this.out1.isRunning());
assertFalse(this.out2.isRunning());
assertFalse(this.out3.isRunning());
assertFalse(this.out4.isRunning());
assertFalse(this.bridge.isRunning());
this.controller.startLifecyclesInRole("cluster");
assertTrue(this.in.isRunning());
assertTrue(this.out1.isRunning());
assertTrue(this.out2.isRunning());
assertTrue(this.out3.isRunning());
assertFalse(this.out4.isRunning());
assertTrue(this.bridge.isRunning());
this.controller.stopLifecyclesInRole("cluster");
assertFalse(this.in.isRunning());
assertFalse(this.out1.isRunning());
assertFalse(this.out2.isRunning());
assertFalse(this.out3.isRunning());
assertFalse(this.out4.isRunning());
assertFalse(this.bridge.isRunning());
this.controller.onApplicationEvent(new OnGrantedEvent("foo", null, "cluster"));
assertTrue(this.in.isRunning());
assertTrue(this.out1.isRunning());
assertTrue(this.out2.isRunning());
assertTrue(this.out3.isRunning());
assertFalse(this.out4.isRunning());
assertTrue(this.bridge.isRunning());
this.controller.onApplicationEvent(new OnRevokedEvent("foo", null, "cluster"));
assertFalse(this.in.isRunning());
assertFalse(this.out1.isRunning());
assertFalse(this.out2.isRunning());
assertFalse(this.out3.isRunning());
assertFalse(this.out4.isRunning());
assertFalse(this.bridge.isRunning());
assertFalse(this.controller.allEndpointsRunning("cluster"));
}
Aggregations