Search in sources :

Example 1 with USER_MANAGED

use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.ResourceStatus.USER_MANAGED in project cloudbreak by hortonworks.

the class ClusterToClusterV4RequestConverterTest method testConvertWhenRdsConfigsContainsElementsThenUserManagedOnesNameShouldBeStored.

@Test
public void testConvertWhenRdsConfigsContainsElementsThenUserManagedOnesNameShouldBeStored() {
    RDSConfig notUserManaged = new RDSConfig();
    notUserManaged.setId(0L);
    notUserManaged.setStatus(DEFAULT);
    RDSConfig userManaged = new RDSConfig();
    notUserManaged.setId(1L);
    userManaged.setStatus(USER_MANAGED);
    Set<RDSConfig> rdsConfigs = new LinkedHashSet<>(2);
    rdsConfigs.add(notUserManaged);
    rdsConfigs.add(userManaged);
    when(cluster.getRdsConfigs()).thenReturn(rdsConfigs);
    ClusterV4Request result = underTest.convert(cluster);
    assertEquals(1L, result.getDatabases().size());
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) Test(org.junit.Test)

Aggregations

ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)1 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)1 LinkedHashSet (java.util.LinkedHashSet)1 Test (org.junit.Test)1