Search in sources :

Example 1 with ParcelStatus

use of com.sequenceiq.cloudbreak.cm.model.ParcelStatus in project cloudbreak by hortonworks.

the class ClouderaManagerParcelDecommissionServiceTest method createApiParcelList.

private ApiParcelList createApiParcelList(Map<String, String> products, ParcelStatus parcelStatus) {
    ApiParcelList parcelList = new ApiParcelList();
    List<ApiParcel> apiParcels = products.entrySet().stream().map(entry -> createApiParcel(entry.getKey(), entry.getValue(), parcelStatus)).collect(Collectors.toList());
    parcelList.setItems(apiParcels);
    return parcelList;
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Mock(org.mockito.Mock) ApiClient(com.cloudera.api.swagger.client.ApiClient) ApiParcel(com.cloudera.api.swagger.model.ApiParcel) Multimap(com.google.common.collect.Multimap) ApiException(com.cloudera.api.swagger.client.ApiException) ParcelStatus(com.sequenceiq.cloudbreak.cm.model.ParcelStatus) ClouderaManagerPollingServiceProvider(com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerPollingServiceProvider) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ArgumentCaptor(org.mockito.ArgumentCaptor) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) ApiParcelList(com.cloudera.api.swagger.model.ApiParcelList) Map(java.util.Map) Spy(org.mockito.Spy) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Mockito.doReturn(org.mockito.Mockito.doReturn) ParcelResourceApi(com.cloudera.api.swagger.ParcelResourceApi) InjectMocks(org.mockito.InjectMocks) MockitoExtension(org.mockito.junit.jupiter.MockitoExtension) ParcelOperationStatus(com.sequenceiq.cloudbreak.cluster.model.ParcelOperationStatus) Set(java.util.Set) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) Collectors(java.util.stream.Collectors) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) List(java.util.List) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) ParcelsResourceApi(com.cloudera.api.swagger.ParcelsResourceApi) Mockito.mock(org.mockito.Mockito.mock) ApiParcel(com.cloudera.api.swagger.model.ApiParcel) ApiParcelList(com.cloudera.api.swagger.model.ApiParcelList)

Aggregations

ParcelResourceApi (com.cloudera.api.swagger.ParcelResourceApi)1 ParcelsResourceApi (com.cloudera.api.swagger.ParcelsResourceApi)1 ApiClient (com.cloudera.api.swagger.client.ApiClient)1 ApiException (com.cloudera.api.swagger.client.ApiException)1 ApiParcel (com.cloudera.api.swagger.model.ApiParcel)1 ApiParcelList (com.cloudera.api.swagger.model.ApiParcelList)1 Multimap (com.google.common.collect.Multimap)1 ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)1 ParcelOperationStatus (com.sequenceiq.cloudbreak.cluster.model.ParcelOperationStatus)1 ParcelStatus (com.sequenceiq.cloudbreak.cm.model.ParcelStatus)1 ClouderaManagerPollingServiceProvider (com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerPollingServiceProvider)1 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)1 ExtendedPollingResult (com.sequenceiq.cloudbreak.polling.ExtendedPollingResult)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)1 Assertions.assertTrue (org.junit.jupiter.api.Assertions.assertTrue)1 Test (org.junit.jupiter.api.Test)1