use of com.sequenceiq.cloudbreak.cloud.model.SubnetSelectionResult in project cloudbreak by hortonworks.
the class AwsNetworkConnectorTest method testSubnetSelectionWhenHaRequiredAnd2DifferentAZDeclaredShouldReturn2DifferentAz.
@Test
public void testSubnetSelectionWhenHaRequiredAnd2DifferentAZDeclaredShouldReturn2DifferentAz() {
List<CloudSubnet> cloudSubnets = Lists.newArrayList(getSubnet("a1", 1), getSubnet("a1", 2), getSubnet("a2", 3), getSubnet("a2", 4));
prepareMock(cloudSubnets);
SubnetSelectionParameters subnetSelectionParameters = SubnetSelectionParameters.builder().withPreferPrivateIfExist().withTunnel(Tunnel.CCM).withHa(true).build();
SubnetSelectionResult result = underTest.chooseSubnets(cloudSubnets, subnetSelectionParameters);
Assert.assertTrue(result.getResult().size() == 2);
Assert.assertTrue(result.getResult().size() == collectUniqueAzs(result).size());
}
use of com.sequenceiq.cloudbreak.cloud.model.SubnetSelectionResult in project cloudbreak by hortonworks.
the class AwsNetworkConnectorTest method testSubnetSelectionWhenNonHaRequiredAnd2DifferentAZDeclaredShouldReturn1Az.
@Test
public void testSubnetSelectionWhenNonHaRequiredAnd2DifferentAZDeclaredShouldReturn1Az() {
List<CloudSubnet> cloudSubnets = Lists.newArrayList(getSubnet("a1", 1), getSubnet("a1", 2), getSubnet("a2", 3), getSubnet("a2", 4));
prepareMock(cloudSubnets);
SubnetSelectionParameters subnetSelectionParameters = SubnetSelectionParameters.builder().withPreferPrivateIfExist().withTunnel(Tunnel.CCM).withHa(false).build();
SubnetSelectionResult result = underTest.chooseSubnets(cloudSubnets, subnetSelectionParameters);
Assert.assertTrue(result.getResult().size() == 1);
}
use of com.sequenceiq.cloudbreak.cloud.model.SubnetSelectionResult in project cloudbreak by hortonworks.
the class AwsNetworkConnectorTest method testSubnetSelectionWhenNonHaRequiredAnd4DifferentAZDeclaredShouldReturn1Az.
@Test
public void testSubnetSelectionWhenNonHaRequiredAnd4DifferentAZDeclaredShouldReturn1Az() {
List<CloudSubnet> cloudSubnets = Lists.newArrayList(getSubnet("a1", 1), getSubnet("a2", 2), getSubnet("a3", 3), getSubnet("a4", 4));
prepareMock(cloudSubnets);
SubnetSelectionParameters subnetSelectionParameters = SubnetSelectionParameters.builder().withPreferPrivateIfExist().withTunnel(Tunnel.CCM).withHa(false).build();
SubnetSelectionResult result = underTest.chooseSubnets(cloudSubnets, subnetSelectionParameters);
Assert.assertTrue(result.getResult().size() == 1);
}
use of com.sequenceiq.cloudbreak.cloud.model.SubnetSelectionResult in project cloudbreak by hortonworks.
the class AwsNetworkConnectorTest method testSubnetSelectionWhenNonHaRequiredAnd1DifferentAZDeclaredShouldReturnOneSubnet.
@Test
public void testSubnetSelectionWhenNonHaRequiredAnd1DifferentAZDeclaredShouldReturnOneSubnet() {
List<CloudSubnet> cloudSubnets = Lists.newArrayList(getSubnet("a1", 1), getSubnet("a1", 2), getSubnet("a1", 3), getSubnet("a1", 4));
prepareMock(cloudSubnets);
SubnetSelectionParameters subnetSelectionParameters = SubnetSelectionParameters.builder().withPreferPrivateIfExist().withTunnel(Tunnel.CCM).withHa(false).build();
SubnetSelectionResult result = underTest.chooseSubnets(cloudSubnets, subnetSelectionParameters);
Assert.assertTrue(result.getResult().size() == 1);
}
use of com.sequenceiq.cloudbreak.cloud.model.SubnetSelectionResult in project cloudbreak by hortonworks.
the class AwsNetworkConnectorTest method testSubnetSelectionWhenHaRequiredAnd4DifferentAZDeclaredShouldReturn3DifferentAz.
@Test
public void testSubnetSelectionWhenHaRequiredAnd4DifferentAZDeclaredShouldReturn3DifferentAz() {
List<CloudSubnet> cloudSubnets = Lists.newArrayList(getSubnet("a1", 1), getSubnet("a2", 2), getSubnet("a3", 3), getSubnet("a4", 4));
prepareMock(cloudSubnets);
SubnetSelectionParameters subnetSelectionParameters = SubnetSelectionParameters.builder().withPreferPrivateIfExist().withTunnel(Tunnel.CCM).withHa(true).build();
SubnetSelectionResult result = underTest.chooseSubnets(cloudSubnets, subnetSelectionParameters);
Assert.assertTrue(result.getResult().size() == 3);
Assert.assertTrue(result.getResult().size() == collectUniqueAzs(result).size());
}
Aggregations