Search in sources :

Example 36 with ImageSettingsRequest

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest 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 37 with ImageSettingsRequest

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest 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 38 with ImageSettingsRequest

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest 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)

Example 39 with ImageSettingsRequest

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

the class FreeIpaImageProviderTest method testGetImagesGivenAllInput.

@Test
public void testGetImagesGivenAllInput() {
    ImageSettingsRequest is = setupImageSettingsRequest(EXISTING_ID, CUSTOM_IMAGE_CATALOG_URL, DEFAULT_OS);
    List<ImageWrapper> images = underTest.getImages(is, DEFAULT_REGION, DEFAULT_PLATFORM);
    assertEquals(1, images.size());
    ImageWrapper imageWrapper = images.get(0);
    assertEquals(CUSTOM_IMAGE_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 40 with ImageSettingsRequest

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

the class FreeIpaImageProviderTest method testGetImageGivenNoInputWithInvalidAppVersion.

@Test
public void testGetImageGivenNoInputWithInvalidAppVersion() {
    ReflectionTestUtils.setField(underTest, FreeIpaImageProvider.class, "freeIpaVersion", "2.21.0-dcv.1", null);
    ImageSettingsRequest is = setupImageSettingsRequest(null, null, "centos7");
    Image image = underTest.getImage(is, DEFAULT_REGION, DEFAULT_PLATFORM).get().getImage();
    assertEquals("centos7", image.getOs());
    assertEquals("2019-05-09", image.getDate());
    assertEquals("91851893-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) Test(org.junit.jupiter.api.Test)

Aggregations

ImageSettingsRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest)57 Test (org.junit.jupiter.api.Test)41 ImageWrapper (com.sequenceiq.freeipa.dto.ImageWrapper)28 Image (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image)23 Stack (com.sequenceiq.freeipa.entity.Stack)23 ImageInfoResponse (com.sequenceiq.freeipa.api.v1.freeipa.upgrade.model.ImageInfoResponse)16 ImageEntity (com.sequenceiq.freeipa.entity.ImageEntity)7 InstanceMetaData (com.sequenceiq.freeipa.entity.InstanceMetaData)5 FreeIpaUpgradeRequest (com.sequenceiq.freeipa.api.v1.freeipa.upgrade.model.FreeIpaUpgradeRequest)4 ImageChangeEvent (com.sequenceiq.freeipa.flow.stack.image.change.event.ImageChangeEvent)4 WebApplicationException (javax.ws.rs.WebApplicationException)4 ImagesV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImagesV4Response)3 FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)3 FlowParameters (com.sequenceiq.flow.core.FlowParameters)3 Backup (com.sequenceiq.freeipa.api.model.Backup)3 UpgradeEvent (com.sequenceiq.freeipa.flow.freeipa.upgrade.UpgradeEvent)3 ImageV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageV4Response)2 Acceptable (com.sequenceiq.cloudbreak.common.event.Acceptable)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)2 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)2