use of com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerCommandPollerObject in project cloudbreak by hortonworks.
the class ClouderaManagerParcelActivationListenerTaskTest method checkStatusOneActivating.
@Test
void checkStatusOneActivating() throws ApiException {
when(clouderaManagerApiPojoFactory.getParcelsResourceApi(apiClientMock)).thenReturn(parcelsResourcesApi);
ClouderaManagerCommandPollerObject clouderaManagerCommandPollerObject = new ClouderaManagerCommandPollerObject(stack, apiClientMock, COMMAND_ID);
ApiParcel apiParcel1 = TestUtil.apiParcel(CDH, ACTIVATED);
ApiParcel apiParcel2 = TestUtil.apiParcel(CDSW, ACTIVATING);
ApiParcelList apiParcelList = new ApiParcelList().items(List.of(apiParcel1, apiParcel2));
when(parcelsResourcesApi.readParcels(eq(STACK_NAME), eq(SUMMARY))).thenReturn(apiParcelList);
assertFalse(underTest.checkStatus(clouderaManagerCommandPollerObject));
}
use of com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerCommandPollerObject in project cloudbreak by hortonworks.
the class ClouderaManagerParcelActivationListenerTaskTest method checkStatusBothActivating.
@Test
void checkStatusBothActivating() throws ApiException {
when(clouderaManagerApiPojoFactory.getParcelsResourceApi(eq(apiClientMock))).thenReturn(parcelsResourcesApi);
ClouderaManagerCommandPollerObject clouderaManagerCommandPollerObject = new ClouderaManagerCommandPollerObject(stack, apiClientMock, COMMAND_ID);
ApiParcel apiParcel1 = TestUtil.apiParcel(CDH, ACTIVATING);
ApiParcel apiParcel2 = TestUtil.apiParcel(CDSW, ACTIVATING);
ApiParcelList apiParcelList = new ApiParcelList().items(List.of(apiParcel1, apiParcel2));
when(parcelsResourcesApi.readParcels(eq(STACK_NAME), eq(SUMMARY))).thenReturn(apiParcelList);
assertFalse(underTest.checkStatus(clouderaManagerCommandPollerObject));
}
use of com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerCommandPollerObject in project cloudbreak by hortonworks.
the class ClouderaManagerParcelActivationListenerTaskTest method checkStatusMissing.
@Test
void checkStatusMissing() throws ApiException {
when(clouderaManagerApiPojoFactory.getParcelsResourceApi(eq(apiClientMock))).thenReturn(parcelsResourcesApi);
ClouderaManagerCommandPollerObject clouderaManagerCommandPollerObject = new ClouderaManagerCommandPollerObject(stack, apiClientMock, COMMAND_ID);
ApiParcel apiParcel1 = TestUtil.apiParcel(CDH, ACTIVATED);
ApiParcelList apiParcelList = new ApiParcelList().items(List.of(apiParcel1));
when(parcelsResourcesApi.readParcels(eq(STACK_NAME), eq(SUMMARY))).thenReturn(apiParcelList);
assertFalse(underTest.checkStatus(clouderaManagerCommandPollerObject));
}
use of com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerCommandPollerObject in project cloudbreak by hortonworks.
the class ClouderaManagerTemplateInstallationCheckerTest method setUp.
@BeforeEach
void setUp() throws ApiException {
when(commandsResourceApi.readCommand(any())).thenReturn(apiCommand);
when(clouderaManagerApiPojoFactory.getCommandsResourceApi(eq(apiClient))).thenReturn(commandsResourceApi);
stack = new Stack();
stack.setType(StackType.DATALAKE);
pollerObject = new ClouderaManagerCommandPollerObject(stack, apiClient, TEMPLATE_INSTALL_ID);
}
Aggregations