Search in sources :

Example 16 with ImageStackDetails

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");
}
Also used : ImageStackDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails)

Example 17 with ImageStackDetails

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);
}
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 18 with ImageStackDetails

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);
}
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 19 with ImageStackDetails

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);
}
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 20 with ImageStackDetails

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);
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.StackRepoDetails) ImageStackDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails) 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