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