Search in sources :

Example 1 with StackTerminationFlowConfig

use of com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationFlowConfig in project cloudbreak by hortonworks.

the class Flow2ConfigTest method testFlowConfigurationMapInit.

@Test
public void testFlowConfigurationMapInit() {
    List<FlowConfiguration<?>> flowConfigs = new ArrayList<>();
    flowConfigs.add(new StackSyncFlowConfig());
    flowConfigs.add(new StackTerminationFlowConfig());
    given(this.flowConfigs.iterator()).willReturn(flowConfigs.iterator());
    Map<String, FlowConfiguration<?>> flowConfigMap = underTest.flowConfigurationMap();
    assertEquals("Not all flow type appeared in map!", countEvents(flowConfigs), flowConfigMap.size());
}
Also used : StackSyncFlowConfig(com.sequenceiq.cloudbreak.core.flow2.stack.sync.StackSyncFlowConfig) StackTerminationFlowConfig(com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationFlowConfig) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 2 with StackTerminationFlowConfig

use of com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationFlowConfig in project cloudbreak by hortonworks.

the class Flow2InitializerTest method testInitialize.

@Test
public void testInitialize() {
    List<FlowConfiguration<?>> flowConfigs = new ArrayList<>();
    flowConfigs.add(new StackSyncFlowConfig());
    flowConfigs.add(new StackTerminationFlowConfig());
    given(this.flowConfigs.stream()).willReturn(flowConfigs.stream());
    underTest.init();
    verify(reactor, times(1)).on(any(Selector.class), any(Consumer.class));
}
Also used : StackSyncFlowConfig(com.sequenceiq.cloudbreak.core.flow2.stack.sync.StackSyncFlowConfig) StackTerminationFlowConfig(com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationFlowConfig) Consumer(reactor.fn.Consumer) ArrayList(java.util.ArrayList) Selector(reactor.bus.selector.Selector) Test(org.junit.Test)

Aggregations

StackSyncFlowConfig (com.sequenceiq.cloudbreak.core.flow2.stack.sync.StackSyncFlowConfig)2 StackTerminationFlowConfig (com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationFlowConfig)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 Selector (reactor.bus.selector.Selector)1 Consumer (reactor.fn.Consumer)1