use of com.sequenceiq.sdx.api.model.SdxCcmUpgradeResponse in project cloudbreak by hortonworks.
the class UpgradeCcmOnDatalakeHandlerTest method testAcceptWhenUpgradeError.
@Test
void testAcceptWhenUpgradeError() {
SdxCcmUpgradeResponse response = new SdxCcmUpgradeResponse(CcmUpgradeResponseType.ERROR, new FlowIdentifier(FlowType.FLOW, "flowId"), "reason", "datalakeCrn");
when(sdxService.upgradeCcm(TEST_ENV_CRN)).thenReturn(response);
underTest.accept(mockEnvironmentDtoEvent);
verify(sdxUpgradeCcmPollerService, never()).waitForUpgradeCcm(any(), any());
UpgradeCcmFailedEvent capturedUpgradeCcmEvent = (UpgradeCcmFailedEvent) baseNamedFlowEvent.getValue();
assertThat(capturedUpgradeCcmEvent.getResourceName()).isEqualTo(TEST_ENV_NAME);
assertThat(capturedUpgradeCcmEvent.getResourceId()).isEqualTo(TEST_ENV_ID);
assertThat(capturedUpgradeCcmEvent.getResourceCrn()).isEqualTo(TEST_ENV_CRN);
assertThat(capturedUpgradeCcmEvent.selector()).isEqualTo("FAILED_UPGRADE_CCM_EVENT");
assertThat(capturedUpgradeCcmEvent.getEnvironmentStatus()).isEqualTo(UPGRADE_CCM_ON_DATALAKE_FAILED);
}
Aggregations