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);
}
Aggregations