Search in sources :

Example 1 with CustomImageCatalogV4DeleteImageResponse

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;
}
Also used : CustomImageCatalogV4DeleteImageResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.customimage.response.CustomImageCatalogV4DeleteImageResponse)

Example 2 with CustomImageCatalogV4DeleteImageResponse

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());
}
Also used : CustomImageCatalogV4DeleteImageResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.customimage.response.CustomImageCatalogV4DeleteImageResponse) CustomImage(com.sequenceiq.cloudbreak.domain.CustomImage) Test(org.junit.jupiter.api.Test)

Example 3 with CustomImageCatalogV4DeleteImageResponse

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);
}
Also used : CustomImageCatalogV4DeleteImageResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.customimage.response.CustomImageCatalogV4DeleteImageResponse) CustomImage(com.sequenceiq.cloudbreak.domain.CustomImage) Test(org.junit.jupiter.api.Test)

Aggregations

CustomImageCatalogV4DeleteImageResponse (com.sequenceiq.cloudbreak.api.endpoint.v4.customimage.response.CustomImageCatalogV4DeleteImageResponse)3 CustomImage (com.sequenceiq.cloudbreak.domain.CustomImage)2 Test (org.junit.jupiter.api.Test)2