use of com.sequenceiq.cloudbreak.service.upgrade.sync.operationresult.CmParcelSyncOperationResult in project cloudbreak by hortonworks.
the class CmSyncResultMergerServiceTest method testMerge.
@Test
void testMerge() {
Stack stack = new Stack();
ClouderaManagerRepo clouderaManagerRepo = new ClouderaManagerRepo();
CmRepoSyncOperationResult cmRepoSyncOperationResult = new CmRepoSyncOperationResult("", clouderaManagerRepo);
when(componentConverter.fromClouderaManagerRepo(clouderaManagerRepo, stack)).thenReturn(componentWithName(CM_REPO_COMPONENT_NAME));
Set<ClouderaManagerProduct> clouderaManagerProducts = Set.of(new ClouderaManagerProduct());
CmParcelSyncOperationResult cmParcelSyncOperationResult = new CmParcelSyncOperationResult(Set.of(), clouderaManagerProducts);
when(componentConverter.fromClouderaManagerProductList(clouderaManagerProducts, stack)).thenReturn(Set.of(componentWithName(CM_PARCEL_COMPONENT_NAME)));
CmSyncOperationResult cmSyncOperationResult = new CmSyncOperationResult(cmRepoSyncOperationResult, cmParcelSyncOperationResult);
Set<Component> mergedComponents = underTest.merge(stack, cmSyncOperationResult);
assertThat(mergedComponents, hasSize(2));
assertThat(mergedComponents, containsInAnyOrder(hasProperty("name", is(CM_REPO_COMPONENT_NAME)), hasProperty("name", is(CM_PARCEL_COMPONENT_NAME))));
verify(componentConverter).fromClouderaManagerRepo(clouderaManagerRepo, stack);
verify(componentConverter).fromClouderaManagerProductList(clouderaManagerProducts, stack);
}
Aggregations