Search in sources :

Example 6 with ImageStackDetails

use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.

the class StackVersionMatcherTest method testUnrelatedStackInStackRepoDetails.

@Test
public void testUnrelatedStackInStackRepoDetails() {
    when(image.getStackDetails()).thenReturn(new ImageStackDetails("ver", new StackRepoDetails(Map.of("TEST", "DUMMY"), null), "build"));
    boolean result = underTest.isMatchingStackVersion(image, ACTIVATED_PARCELS);
    assertTrue(result);
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.StackRepoDetails) ImageStackDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails) Test(org.junit.jupiter.api.Test)

Example 7 with ImageStackDetails

use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.

the class CdhPackageLocationFilterTest method testStackIsNull.

@Test
public void testStackIsNull() {
    Image image = mock(Image.class);
    when(image.getStackDetails()).thenReturn(new ImageStackDetails("1", new StackRepoDetails(null, null), "1"));
    boolean result = underTest.filterImage(image, mock(Image.class), null);
    assertFalse(result);
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.StackRepoDetails) ImageStackDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails) Image(com.sequenceiq.cloudbreak.cloud.model.catalog.Image) Test(org.junit.jupiter.api.Test)

Example 8 with ImageStackDetails

use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.

the class CdhPackageLocationFilterTest method testMatching.

@Test
public void testMatching() {
    Image image = mock(Image.class);
    when(image.getStackDetails()).thenReturn(new ImageStackDetails("1", new StackRepoDetails(Map.of("redhat7", "http://archive.cloudera.com/asdf/"), Map.of()), "1"));
    Image currentImage = mock(Image.class);
    when(currentImage.getOsType()).thenReturn("redhat7");
    boolean result = underTest.filterImage(image, currentImage, null);
    assertTrue(result);
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.StackRepoDetails) ImageStackDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails) Image(com.sequenceiq.cloudbreak.cloud.model.catalog.Image) Test(org.junit.jupiter.api.Test)

Example 9 with ImageStackDetails

use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.

the class CdhPackageLocationFilterTest method testCurrentImageOsTypeEmpty.

@Test
public void testCurrentImageOsTypeEmpty() {
    Image image = mock(Image.class);
    when(image.getStackDetails()).thenReturn(new ImageStackDetails("1", new StackRepoDetails(Map.of(), Map.of()), "1"));
    Image currentImage = mock(Image.class);
    when(currentImage.getOsType()).thenReturn(" ");
    boolean result = underTest.filterImage(image, currentImage, null);
    assertFalse(result);
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.StackRepoDetails) ImageStackDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails) Image(com.sequenceiq.cloudbreak.cloud.model.catalog.Image) Test(org.junit.jupiter.api.Test)

Example 10 with ImageStackDetails

use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.

the class CdhPackageLocationFilterTest method testOsTypeMissing.

@Test
public void testOsTypeMissing() {
    Image image = mock(Image.class);
    when(image.getStackDetails()).thenReturn(new ImageStackDetails("1", new StackRepoDetails(Map.of(), Map.of()), "1"));
    Image currentImage = mock(Image.class);
    when(currentImage.getOsType()).thenReturn("redhat7");
    boolean result = underTest.filterImage(image, currentImage, null);
    assertFalse(result);
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.StackRepoDetails) ImageStackDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails) Image(com.sequenceiq.cloudbreak.cloud.model.catalog.Image) Test(org.junit.jupiter.api.Test)

Aggregations

ImageStackDetails (com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails)25 StackRepoDetails (com.sequenceiq.cloudbreak.cloud.model.catalog.StackRepoDetails)16 Image (com.sequenceiq.cloudbreak.cloud.model.catalog.Image)13 Test (org.junit.jupiter.api.Test)13 Map (java.util.Map)4 List (java.util.List)3 StackType (com.sequenceiq.cloudbreak.cloud.model.component.StackType)2 Component (com.sequenceiq.cloudbreak.domain.stack.Component)2 HashMap (java.util.HashMap)2 BaseStackDetailsV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.BaseStackDetailsV4Response)1 ImageV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageV4Response)1 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)1 Json (com.sequenceiq.cloudbreak.common.json.Json)1 CustomImage (com.sequenceiq.cloudbreak.domain.CustomImage)1 VmImage (com.sequenceiq.cloudbreak.domain.VmImage)1 StatedImage (com.sequenceiq.cloudbreak.service.image.StatedImage)1 Arrays.asList (java.util.Arrays.asList)1 Collections (java.util.Collections)1 Optional (java.util.Optional)1 Set (java.util.Set)1