Search in sources :

Example 1 with CloudConstant

use of com.sequenceiq.cloudbreak.cloud.CloudConstant in project cloudbreak by hortonworks.

the class ImageCatalogServiceTest method beforeTest.

@Before
public void beforeTest() throws Exception {
    String catalogJson = FileReaderUtils.readFileFromClasspath("com/sequenceiq/cloudbreak/service/image/cb-image-catalog-v2.json");
    CloudbreakImageCatalogV2 catalog = JsonUtil.readValue(catalogJson, CloudbreakImageCatalogV2.class);
    when(imageCatalogProvider.getImageCatalogV2("")).thenReturn(catalog);
    IdentityUser user = getIdentityUser();
    when(authenticatedUserService.getCbUser()).thenReturn(user);
    constants.addAll(Collections.singletonList(new CloudConstant() {

        @Override
        public Platform platform() {
            return Platform.platform("AWS");
        }

        @Override
        public Variant variant() {
            return Variant.variant("AWS");
        }
    }));
    ReflectionTestUtils.setField(underTest, ImageCatalogService.class, "defaultCatalogUrl", "http://localhost/imagecatalog-url", null);
    ReflectionTestUtils.setField(underTest, ImageCatalogService.class, "cbVersion", "unspecified", null);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) CloudbreakImageCatalogV2(com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV2) CloudConstant(com.sequenceiq.cloudbreak.cloud.CloudConstant) Before(org.junit.Before)

Aggregations

CloudConstant (com.sequenceiq.cloudbreak.cloud.CloudConstant)1 CloudbreakImageCatalogV2 (com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV2)1 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)1 Before (org.junit.Before)1