@Test public void testTriggerStartWhenFreeipaStopped() { SdxCluster sdxCluster = sdxCluster(); sdxCluster.setEnvCrn("envCrn"); DescribeFreeIpaResponse freeipa = new DescribeFreeIpaResponse(); freeipa.setStatus(Status.STOPPED); when(freeipaService.describe("envCrn")).thenReturn(freeipa); BadRequestException exception = Assertions.assertThrows(BadRequestException.class, () -> underTest.triggerStartIfClusterNotRunning(sdxCluster)); assertEquals("Freeipa should be in Available state but currently is " + freeipa.getStatus().name(), exception.getMessage()); }
public FlowIdentifier triggerStartIfClusterNotRunning(SdxCluster cluster) { MDCBuilder.buildMdcContext(cluster); checkFreeipaRunning(cluster.getEnvCrn()); return sdxReactorFlowManager.triggerSdxStartFlow(cluster); }
SdxStartService { public FlowIdentifier triggerStartIfClusterNotRunning(SdxCluster cluster) { MDCBuilder.buildMdcContext(cluster); checkFreeipaRunning(cluster.getEnvCrn()); return sdxReactorFlowManager.triggerSdxStartFlow(cluster); } }
SdxStartService { public FlowIdentifier triggerStartIfClusterNotRunning(SdxCluster cluster) { MDCBuilder.buildMdcContext(cluster); checkFreeipaRunning(cluster.getEnvCrn()); return sdxReactorFlowManager.triggerSdxStartFlow(cluster); }  }
SdxStartService { public FlowIdentifier triggerStartIfClusterNotRunning(SdxCluster cluster) { MDCBuilder.buildMdcContext(cluster); checkFreeipaRunning(cluster.getEnvCrn()); return sdxReactorFlowManager.triggerSdxStartFlow(cluster); }  FlowIdentifier triggerStartIfClusterNotRunning(SdxCluster cluster); void start(Long sdxId); void waitCloudbreakCluster(Long sdxId, PollingConfig pollingConfig); }
SdxStartService { public FlowIdentifier triggerStartIfClusterNotRunning(SdxCluster cluster) { MDCBuilder.buildMdcContext(cluster); checkFreeipaRunning(cluster.getEnvCrn()); return sdxReactorFlowManager.triggerSdxStartFlow(cluster); }  FlowIdentifier triggerStartIfClusterNotRunning(SdxCluster cluster); void start(Long sdxId); void waitCloudbreakCluster(Long sdxId, PollingConfig pollingConfig);  }