Search in sources :

Example 11 with ClouderaManagerCommandPollerObject

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));
}
Also used : ApiParcel(com.cloudera.api.swagger.model.ApiParcel) ClouderaManagerCommandPollerObject(com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerCommandPollerObject) ApiParcelList(com.cloudera.api.swagger.model.ApiParcelList) Test(org.junit.jupiter.api.Test)

Example 12 with 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));
}
Also used : ApiParcel(com.cloudera.api.swagger.model.ApiParcel) ClouderaManagerCommandPollerObject(com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerCommandPollerObject) ApiParcelList(com.cloudera.api.swagger.model.ApiParcelList) Test(org.junit.jupiter.api.Test)

Example 13 with 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));
}
Also used : ApiParcel(com.cloudera.api.swagger.model.ApiParcel) ClouderaManagerCommandPollerObject(com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerCommandPollerObject) ApiParcelList(com.cloudera.api.swagger.model.ApiParcelList) Test(org.junit.jupiter.api.Test)

Example 14 with 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);
}
Also used : ClouderaManagerCommandPollerObject(com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerCommandPollerObject) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ClouderaManagerCommandPollerObject (com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerCommandPollerObject)14 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)8 ApiParcel (com.cloudera.api.swagger.model.ApiParcel)6 BigDecimal (java.math.BigDecimal)5 Test (org.junit.Test)5 ApiClient (com.cloudera.api.swagger.client.ApiClient)4 ApiParcelList (com.cloudera.api.swagger.model.ApiParcelList)4 Test (org.junit.jupiter.api.Test)4 ApiException (com.cloudera.api.swagger.client.ApiException)3 ParcelResourceApi (com.cloudera.api.swagger.ParcelResourceApi)2 SocketException (java.net.SocketException)2 StackStatus (com.sequenceiq.cloudbreak.domain.stack.StackStatus)1 InstanceGroup (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)1 ConnectException (java.net.ConnectException)1 SocketTimeoutException (java.net.SocketTimeoutException)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1