Search in sources :

Example 26 with Image

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image in project cloudbreak by hortonworks.

the class FreeIpaImageProviderTest method doTestGetImageGivenNoInput.

private void doTestGetImageGivenNoInput() {
    ImageSettingsRequest is = setupImageSettingsRequest(null, null, null);
    Image image = underTest.getImage(is, DEFAULT_REGION, DEFAULT_PLATFORM).get().getImage();
    assertEquals(DEFAULT_OS, image.getOs());
    assertEquals(LATEST_DATE_NO_INPUT, image.getDate());
    assertEquals("71851893-8340-411d-afb7-e1b55107fb10", image.getUuid());
}
Also used : ImageSettingsRequest(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest) Image(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image)

Example 27 with Image

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image in project cloudbreak by hortonworks.

the class FreeIpaImageProviderTest method testGetImagesNoInput.

@Test
public void testGetImagesNoInput() {
    ImageSettingsRequest imageSettingsRequest = setupImageSettingsRequest(null, null, null);
    List<ImageWrapper> images = underTest.getImages(imageSettingsRequest, DEFAULT_REGION, DEFAULT_PLATFORM);
    assertEquals(2, images.size());
    assertThat(images, everyItem(allOf(hasProperty("image", hasProperty("os", is(DEFAULT_OS))), hasProperty("catalogUrl", is(DEFAULT_CATALOG_URL)), hasProperty("catalogName", is(nullValue())))));
    assertThat(images, hasItem(allOf(hasProperty("image", allOf(hasProperty("uuid", is(IMAGE_UUID)), hasProperty("date", is(LATEST_DATE)))))));
    assertThat(images, hasItem(allOf(hasProperty("image", allOf(hasProperty("uuid", is("71851893-8340-411d-afb7-e1b55107fb10")), hasProperty("date", is(LATEST_DATE_NO_INPUT)))))));
}
Also used : ImageSettingsRequest(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest) ImageWrapper(com.sequenceiq.freeipa.dto.ImageWrapper) Test(org.junit.jupiter.api.Test)

Example 28 with Image

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image in project cloudbreak by hortonworks.

the class FreeIpaImageProviderTest method testGetImageGivenAllInput.

@Test
public void testGetImageGivenAllInput() {
    ImageSettingsRequest is = setupImageSettingsRequest(EXISTING_ID, CUSTOM_IMAGE_CATALOG_URL, DEFAULT_OS);
    Image image = underTest.getImage(is, DEFAULT_REGION, DEFAULT_PLATFORM).get().getImage();
    assertEquals(DEFAULT_OS, image.getOs());
    assertEquals(LATEST_DATE, image.getDate());
    assertEquals(IMAGE_UUID, image.getUuid());
}
Also used : ImageSettingsRequest(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest) Image(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image) Test(org.junit.jupiter.api.Test)

Example 29 with Image

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image in project cloudbreak by hortonworks.

the class FreeIpaImageProviderTest method testGetImagesGivenUuidInputFound.

@Test
public void testGetImagesGivenUuidInputFound() {
    ImageSettingsRequest is = setupImageSettingsRequest(IMAGE_UUID, null, null);
    List<ImageWrapper> images = underTest.getImages(is, DEFAULT_REGION, DEFAULT_PLATFORM);
    assertEquals(1, images.size());
    ImageWrapper imageWrapper = images.get(0);
    assertEquals(DEFAULT_CATALOG_URL, imageWrapper.getCatalogUrl());
    assertNull(imageWrapper.getCatalogName());
    Image image = imageWrapper.getImage();
    assertEquals(DEFAULT_OS, image.getOs());
    assertEquals(LATEST_DATE, image.getDate());
    assertEquals(IMAGE_UUID, image.getUuid());
}
Also used : ImageSettingsRequest(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest) ImageWrapper(com.sequenceiq.freeipa.dto.ImageWrapper) Image(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image) Test(org.junit.jupiter.api.Test)

Example 30 with Image

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image in project cloudbreak by hortonworks.

the class FreeIpaImageProviderTest method testGetImageGivenUuidInputFound.

@Test
public void testGetImageGivenUuidInputFound() {
    ImageSettingsRequest is = setupImageSettingsRequest(IMAGE_UUID, null, null);
    Image image = underTest.getImage(is, DEFAULT_REGION, DEFAULT_PLATFORM).get().getImage();
    assertEquals(IMAGE_UUID, image.getUuid());
}
Also used : ImageSettingsRequest(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest) Image(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image) Test(org.junit.jupiter.api.Test)

Aggregations

ImageSettingsRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest)32 Test (org.junit.jupiter.api.Test)28 Image (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image)27 ImageWrapper (com.sequenceiq.freeipa.dto.ImageWrapper)21 Stack (com.sequenceiq.freeipa.entity.Stack)16 ImageEntity (com.sequenceiq.freeipa.entity.ImageEntity)10 ImageInfoResponse (com.sequenceiq.freeipa.api.v1.freeipa.upgrade.model.ImageInfoResponse)9 ImageCatalog (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.ImageCatalog)7 DescribeFreeIpaResponse (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.describe.DescribeFreeIpaResponse)4 FreeIpa (com.sequenceiq.freeipa.entity.FreeIpa)4 FreeIpaVersions (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.FreeIpaVersions)3 List (java.util.List)3 CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)2 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)2 Backup (com.sequenceiq.freeipa.api.model.Backup)2 Versions (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Versions)2 UsedImagesListV1Response (com.sequenceiq.freeipa.api.v1.util.model.UsedImagesListV1Response)2 UserSyncStatus (com.sequenceiq.freeipa.entity.UserSyncStatus)2 ImageNotFoundException (com.sequenceiq.freeipa.service.image.ImageNotFoundException)2 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)1