use of com.sequenceiq.cloudbreak.api.endpoint.v4.customimage.response.CustomImageCatalogV4DeleteImageResponse in project cloudbreak by hortonworks.
the class CustomImageToCustomImageCatalogV4DeleteImageResponseConverter method convert.
public CustomImageCatalogV4DeleteImageResponse convert(CustomImage source) {
CustomImageCatalogV4DeleteImageResponse result = new CustomImageCatalogV4DeleteImageResponse();
result.setImageId(source.getName());
return result;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.customimage.response.CustomImageCatalogV4DeleteImageResponse in project cloudbreak by hortonworks.
the class CustomImageToCustomImageCatalogV4DeleteImageResponseConverterTest method shouldConvert.
@Test
public void shouldConvert() {
CustomImage customImage = new CustomImage();
customImage.setName(IMAGE_ID);
CustomImageCatalogV4DeleteImageResponse result = victim.convert(customImage);
assertEquals(IMAGE_ID, result.getImageId());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.customimage.response.CustomImageCatalogV4DeleteImageResponse in project cloudbreak by hortonworks.
the class CustomImageCatalogV4ControllerTest method testDeleteCustomImage.
@Test
public void testDeleteCustomImage() {
CustomImage customImage = new CustomImage();
CustomImageCatalogV4DeleteImageResponse expected = new CustomImageCatalogV4DeleteImageResponse();
when(restRequestThreadLocalService.getRequestedWorkspaceId()).thenReturn(WORKSPACE_ID);
when(customImageCatalogService.deleteCustomImage(WORKSPACE_ID, IMAGE_CATALOG_NAME, IMAGE_ID)).thenReturn(customImage);
when(customImageToCustomImageCatalogV4DeleteImageResponseConverter.convert(customImage)).thenReturn(expected);
CustomImageCatalogV4DeleteImageResponse actual = victim.deleteCustomImage(IMAGE_CATALOG_NAME, IMAGE_ID, ACCOUNT_ID);
assertEquals(expected, actual);
}
Aggregations