Search in sources :

Example 1 with GenerateImageCatalogResponse

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.imagecatalog.GenerateImageCatalogResponse in project cloudbreak by hortonworks.

the class ImageCatalogGeneratorServiceTest method generate.

@Test
void generate() {
    Stack stack = new Stack();
    when(stackService.getByEnvironmentCrnAndAccountId(ENVIRONMENT_CRN, ACCOUNT_ID)).thenReturn(stack);
    ImageCatalog imageCatalog = new ImageCatalog(null, null);
    when(imageService.generateImageCatalogForStack(stack)).thenReturn(imageCatalog);
    GenerateImageCatalogResponse result = underTest.generate(ENVIRONMENT_CRN, ACCOUNT_ID);
    Assertions.assertThat(result.getImageCatalog()).isEqualTo(imageCatalog);
}
Also used : GenerateImageCatalogResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.imagecatalog.GenerateImageCatalogResponse) ImageCatalog(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.ImageCatalog) Stack(com.sequenceiq.freeipa.entity.Stack) Test(org.junit.jupiter.api.Test)

Example 2 with GenerateImageCatalogResponse

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.imagecatalog.GenerateImageCatalogResponse in project cloudbreak by hortonworks.

the class ImageCatalogGeneratorService method generate.

public GenerateImageCatalogResponse generate(String environmentCrn, String accountId) {
    final Stack stack = stackService.getByEnvironmentCrnAndAccountId(environmentCrn, accountId);
    MDCBuilder.buildMdcContext(stack);
    LOGGER.info("Generating image catalog for environment {} stack {}", environmentCrn, stack.getId());
    final ImageCatalog imageCatalog = imageService.generateImageCatalogForStack(stack);
    final GenerateImageCatalogResponse response = new GenerateImageCatalogResponse();
    response.setImageCatalog(imageCatalog);
    return response;
}
Also used : GenerateImageCatalogResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.imagecatalog.GenerateImageCatalogResponse) ImageCatalog(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.ImageCatalog) Stack(com.sequenceiq.freeipa.entity.Stack)

Aggregations

ImageCatalog (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.ImageCatalog)2 GenerateImageCatalogResponse (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.imagecatalog.GenerateImageCatalogResponse)2 Stack (com.sequenceiq.freeipa.entity.Stack)2 Test (org.junit.jupiter.api.Test)1