Search in sources :

Example 1 with GenerateImageCatalogV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.imagecatalog.GenerateImageCatalogV4Response in project cloudbreak by hortonworks.

the class SdxImageCatalogServiceTest method shouldCallGenererateImageCatalog.

@Test
void shouldCallGenererateImageCatalog() {
    CloudbreakImageCatalogV3 imageCatalogV3 = mock(CloudbreakImageCatalogV3.class);
    GenerateImageCatalogV4Response response = new GenerateImageCatalogV4Response(imageCatalogV3);
    when(stackV4Endpoint.generateImageCatalogInternal(WORKSPACE_ID_DEFAULT, CLUSTER_NAME, USER_CRN)).thenReturn(response);
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    CloudbreakImageCatalogV3 actual = ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.generateImageCatalog(CLUSTER_NAME));
    assertEquals(imageCatalogV3, actual);
}
Also used : GenerateImageCatalogV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.imagecatalog.GenerateImageCatalogV4Response) CloudbreakImageCatalogV3(com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3) Test(org.junit.jupiter.api.Test)

Aggregations

GenerateImageCatalogV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.imagecatalog.GenerateImageCatalogV4Response)1 CloudbreakImageCatalogV3 (com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3)1 Test (org.junit.jupiter.api.Test)1