use of com.sequenceiq.it.cloudbreak.action.v4.imagecatalog.ImageCatalogGetImagesByNameAction in project cloudbreak by hortonworks.
the class ImageCatalogTest method testGetImageCatalogWhenCatalogDoesNotContainTheRequestedProvider.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "image catalog get the default catalog with AWS provider but catalog does not contain AWS entry", when = "calling get on the default", then = "the response does not contains AWS images")
public void testGetImageCatalogWhenCatalogDoesNotContainTheRequestedProvider(MockedTestContext testContext) {
String imgCatalogName = resourcePropertyProvider().getName();
testContext.given(imgCatalogName, ImageCatalogTestDto.class).withName(imgCatalogName).withUrl(getImageCatalogMockServerSetup().getImageCatalogUrl()).when(imageCatalogTestClient.createV4(), key(imgCatalogName)).when(new ImageCatalogGetImagesByNameAction(CloudPlatform.AWS), key(imgCatalogName)).then((testContext1, entity, cloudbreakClient) -> {
ImagesV4Response catalog = entity.getResponseByProvider();
if (!catalog.getBaseImages().isEmpty()) {
throw new IllegalArgumentException("The Images response should NOT contain results for AWS provider.");
}
return entity;
}).validate();
}
Aggregations