use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CmSyncOperationResultEvaluatorServiceTest method testEvaluateParcelSyncWhenVersionsPresentButNoMatchingProductsFoundThenFailure.
@Test
void testEvaluateParcelSyncWhenVersionsPresentButNoMatchingProductsFoundThenFailure() {
Set<ParcelInfo> activeParcels = Set.of(new ParcelInfo(PARCEL_1_NAME, PARCEL_1_VERSION), new ParcelInfo(PARCEL_2_NAME, PARCEL_2_VERSION));
Set<ClouderaManagerProduct> foundCmProducts = Set.of();
CmParcelSyncOperationResult cmParcelSyncOperationResult = new CmParcelSyncOperationResult(activeParcels, foundCmProducts);
CmSyncOperationStatus.Builder cmSyncOperationStatusBuilder = underTest.evaluateParcelSync(cmParcelSyncOperationResult);
CmSyncOperationStatus cmSyncOperationStatus = cmSyncOperationStatusBuilder.build();
assertFalse(cmSyncOperationStatus.hasSucceeded());
assertThat(cmSyncOperationStatus.getMessage(), containsString("Reading versions of active parcels failed, the version of active parcels that could not be retrieved from CM server:"));
assertThat(cmSyncOperationStatus.getMessage(), containsString(PARCEL_1_NAME));
assertThat(cmSyncOperationStatus.getMessage(), containsString(PARCEL_2_NAME));
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class RuntimeVersionServiceTest method getCdhProduct.
private ClouderaManagerProduct getCdhProduct() {
ClouderaManagerProduct product = new ClouderaManagerProduct();
product.setName("CDH");
product.setVersion(null);
return product;
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class RuntimeVersionServiceTest method testGetCdhVersionFromClouderaManagerProductsIfNameAndVersionAdded.
@Test
public void testGetCdhVersionFromClouderaManagerProductsIfNameAndVersionAdded() {
ClouderaManagerProduct cdhProduct = getCdhProduct("version");
Optional<String> actual = RuntimeVersionService.getRuntimeVersionFromClouderaManagerProducts(List.of(cdhProduct));
Assertions.assertFalse(actual.isEmpty());
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class ClouderaManagerProductTransformerTest method testTransformShouldNotParseFromAnImageWhenCDHAndPreWarmBothFalse.
@Test
public void testTransformShouldNotParseFromAnImageWhenCDHAndPreWarmBothFalse() {
List<String> preWarmParcels = Collections.emptyList();
List<String> preWarmCsdList = Collections.emptyList();
Image image = createImage(preWarmParcels, preWarmCsdList);
Set<ClouderaManagerProduct> foundProducts = underTest.transform(image, false, false);
assertThat(foundProducts, empty());
verify(preWarmParcelParser, never()).parseProductFromParcel(any(), any());
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class ClouderaManagerProductTransformerTest method testTransformShouldCreateASetOfClouderaManagerProductFromAnImageWhenPreWarmParcelsAreNotAvailable.
@Test
public void testTransformShouldCreateASetOfClouderaManagerProductFromAnImageWhenPreWarmParcelsAreNotAvailable() {
List<String> preWarmParcels = Collections.emptyList();
List<String> preWarmCsdList = Collections.emptyList();
Image image = createImage(preWarmParcels, preWarmCsdList);
when(preWarmParcelParser.parseProductFromParcel(preWarmParcels, preWarmCsdList)).thenReturn(Optional.empty());
Set<ClouderaManagerProduct> foundProducts = underTest.transform(image, true, true);
assertThat(foundProducts, hasSize(1));
assertTrue(assertCdhProduct(foundProducts));
verify(preWarmParcelParser).parseProductFromParcel(preWarmParcels, preWarmCsdList);
}
Aggregations