use of com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse in project cloudbreak by hortonworks.
the class LoadBalancerConfigServiceTest method createEnvironment.
private DetailedEnvironmentResponse createEnvironment(CloudSubnet subnet, boolean enableEndpointGateway, String cloudPlatform) {
EnvironmentNetworkResponse network = new EnvironmentNetworkResponse();
network.setSubnetMetas(Map.of("key", subnet));
if (enableEndpointGateway) {
network.setPublicEndpointAccessGateway(PublicEndpointAccessGateway.ENABLED);
}
DetailedEnvironmentResponse environment = new DetailedEnvironmentResponse();
environment.setNetwork(network);
environment.setCloudPlatform(cloudPlatform);
return environment;
}
use of com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse in project cloudbreak by hortonworks.
the class MultiAzCalculatorServiceTest method testPrepareSubnetAzMap.
@Test
public void testPrepareSubnetAzMap() {
DetailedEnvironmentResponse detailedEnvironmentResponse = new DetailedEnvironmentResponse();
EnvironmentNetworkResponse environmentNetworkResponse = new EnvironmentNetworkResponse();
environmentNetworkResponse.setSubnetMetas(Map.of(cloudSubnetName(1), cloudSubnet(1), cloudSubnetName(2), cloudSubnet(2)));
detailedEnvironmentResponse.setNetwork(environmentNetworkResponse);
Map<String, String> result = underTest.prepareSubnetAzMap(detailedEnvironmentResponse);
Assertions.assertEquals(result.size(), 4);
Assertions.assertEquals(result.get(cloudSubnetName(1)), cloudSubnetAz(1));
Assertions.assertEquals(result.get(cloudSubnetName(2)), cloudSubnetAz(2));
}
use of com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse in project cloudbreak by hortonworks.
the class MultiAzCalculatorServiceTest method testPrepareMultiAzMapWhenAvailabilityZoneNotNull.
@Test
public void testPrepareMultiAzMapWhenAvailabilityZoneNotNull() {
DetailedEnvironmentResponse detailedEnvironmentResponse = new DetailedEnvironmentResponse();
EnvironmentNetworkResponse environmentNetworkResponse = new EnvironmentNetworkResponse();
environmentNetworkResponse.setSubnetMetas(Map.of(cloudSubnetName(1), cloudSubnet(1), cloudSubnetName(2), cloudSubnet(2)));
detailedEnvironmentResponse.setNetwork(environmentNetworkResponse);
Map<String, String> actual = underTest.prepareSubnetAzMap(detailedEnvironmentResponse, "az-1");
Assertions.assertEquals(2, actual.size());
Assertions.assertEquals("az-1", actual.get("name-1"));
Assertions.assertEquals("az-1", actual.get("1"));
}
use of com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse in project cloudbreak by hortonworks.
the class DistroXV1RequestToStackV4RequestConverterTest method createAwsNetwork.
private EnvironmentNetworkResponse createAwsNetwork() {
EnvironmentNetworkResponse network = new EnvironmentNetworkResponse();
network.setAws(createAwsNetworkParams());
network.setSubnetIds(Set.of("mysubnetid"));
return network;
}
use of com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse in project cloudbreak by hortonworks.
the class InstanceGroupV1ToInstanceGroupV4ConverterTest method prepareEnvironment.
private DetailedEnvironmentResponse prepareEnvironment(boolean securityAccessSet, String cidr, String defaultSecurityGroupId, String securityGroupIdKnox) {
DetailedEnvironmentResponse environment = new DetailedEnvironmentResponse();
EnvironmentNetworkResponse environmentNetworkResponse = new EnvironmentNetworkResponse();
environmentNetworkResponse.setSubnetIds(Set.of("aws-123"));
environment.setNetwork(environmentNetworkResponse);
environment.setCloudPlatform(CloudPlatform.AWS.name());
environment.setSecurityAccess(securityAccessSet ? createSecurityAccessResponse(cidr, defaultSecurityGroupId, securityGroupIdKnox) : null);
return environment;
}
Aggregations