use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.
the class ImageCreationBasedUpgradeImageFilterTest method mockDifferentVersion.
private void mockDifferentVersion(Image current, Image candidate) {
ImageStackDetails currentStackDetails = mock(ImageStackDetails.class);
ImageStackDetails candidateStackDetails = mock(ImageStackDetails.class);
when(current.getStackDetails()).thenReturn(currentStackDetails);
when(candidate.getStackDetails()).thenReturn(candidateStackDetails);
when(currentStackDetails.getVersion()).thenReturn("a");
when(candidateStackDetails.getVersion()).thenReturn("b");
}
use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.
the class StackVersionMatcherTest method testEmptyStackInStackRepoDetails.
@Test
public void testEmptyStackInStackRepoDetails() {
when(image.getStackDetails()).thenReturn(new ImageStackDetails("ver", new StackRepoDetails(Map.of(), 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 StackVersionMatcherTest method testVersionMatch.
@Test
public void testVersionMatch() {
when(image.getStackDetails()).thenReturn(new ImageStackDetails("ver", new StackRepoDetails(Map.of(REPOSITORY_VERSION, "CDHVER"), 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 StackVersionMatcherTest method testMissingStackInStackRepoDetails.
@Test
public void testMissingStackInStackRepoDetails() {
when(image.getStackDetails()).thenReturn(new ImageStackDetails("ver", new StackRepoDetails(null, 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 StackVersionMatcherTest method testVersionNotMatch.
@Test
public void testVersionNotMatch() {
when(image.getStackDetails()).thenReturn(new ImageStackDetails("ver", new StackRepoDetails(Map.of(REPOSITORY_VERSION, "CDHDIFFERENTVER"), null), "build"));
boolean result = underTest.isMatchingStackVersion(image, ACTIVATED_PARCELS);
assertFalse(result);
}
Aggregations