Search in sources :

Example 1 with StackSyncFlowConfig

use of com.sequenceiq.cloudbreak.core.flow2.stack.sync.StackSyncFlowConfig 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 StackSyncFlowConfig

use of com.sequenceiq.cloudbreak.core.flow2.stack.sync.StackSyncFlowConfig in project cloudbreak by hortonworks.

the class Flow2ConfigTest method testFlowConfigurationMapInitIfAlreadyExists.

@Test
public void testFlowConfigurationMapInitIfAlreadyExists() {
    List<FlowConfiguration<?>> flowConfigs = new ArrayList<>();
    StackSyncFlowConfig stackSyncFlowConfig = new StackSyncFlowConfig();
    flowConfigs.add(stackSyncFlowConfig);
    flowConfigs.add(stackSyncFlowConfig);
    given(this.flowConfigs.iterator()).willReturn(flowConfigs.iterator());
    thrown.expect(UnsupportedOperationException.class);
    thrown.expectMessage("Event already registered: STACK_SYNC_TRIGGER_EVENT");
    underTest.flowConfigurationMap();
}
Also used : StackSyncFlowConfig(com.sequenceiq.cloudbreak.core.flow2.stack.sync.StackSyncFlowConfig) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 3 with StackSyncFlowConfig

use of com.sequenceiq.cloudbreak.core.flow2.stack.sync.StackSyncFlowConfig 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)3 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 StackTerminationFlowConfig (com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationFlowConfig)2 Selector (reactor.bus.selector.Selector)1 Consumer (reactor.fn.Consumer)1