use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams in project cloudbreak by hortonworks.
the class AwsEnvironmentNetworkConverterTest method getAttributesForLegacyNetwork.
@Test
void getAttributesForLegacyNetwork() {
EnvironmentNetworkResponse source = mock(EnvironmentNetworkResponse.class);
EnvironmentNetworkAwsParams aws = mock(EnvironmentNetworkAwsParams.class);
when(source.getAws()).thenReturn(aws);
when(aws.getVpcId()).thenReturn("my_vpc_id");
Map<String, Object> result = converter.getAttributesForLegacyNetwork(source);
assertEquals("my_vpc_id", result.get("vpcId"));
}
use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams in project cloudbreak by hortonworks.
the class DistroXV1RequestToStackV4RequestConverterTest method createAwsNetworkParams.
private EnvironmentNetworkAwsParams createAwsNetworkParams() {
EnvironmentNetworkAwsParams awsNetwork = new EnvironmentNetworkAwsParams();
awsNetwork.setVpcId("myvpc");
return awsNetwork;
}
use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams in project cloudbreak by hortonworks.
the class AwsCloudProvider method environmentNetworkParameters.
private EnvironmentNetworkAwsParams environmentNetworkParameters() {
EnvironmentNetworkAwsParams environmentNetworkAwsParams = new EnvironmentNetworkAwsParams();
environmentNetworkAwsParams.setVpcId(getVpcId());
return environmentNetworkAwsParams;
}
use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams in project cloudbreak by hortonworks.
the class ProvisionerServiceTest method getEnvironmentResponse.
private DetailedEnvironmentResponse getEnvironmentResponse() {
DetailedEnvironmentResponse detailedEnvironmentResponse = new DetailedEnvironmentResponse();
detailedEnvironmentResponse.setName("env");
detailedEnvironmentResponse.setEnvironmentStatus(EnvironmentStatus.AVAILABLE);
CompactRegionResponse compactRegionResponse = new CompactRegionResponse();
compactRegionResponse.setNames(Lists.newArrayList("eu-west-1"));
compactRegionResponse.setDisplayNames(Map.of("eu-west-1", "ireland"));
detailedEnvironmentResponse.setRegions(compactRegionResponse);
detailedEnvironmentResponse.setCrn(CrnTestUtil.getEnvironmentCrnBuilder().setResource(UUID.randomUUID().toString()).setAccountId(UUID.randomUUID().toString()).build().toString());
EnvironmentNetworkResponse network = new EnvironmentNetworkResponse();
network.setCrn(CrnTestUtil.getNetworkCrnBuilder().setResource(UUID.randomUUID().toString()).setAccountId(UUID.randomUUID().toString()).build().toString());
EnvironmentNetworkAwsParams environmentNetworkAwsParams = new EnvironmentNetworkAwsParams();
environmentNetworkAwsParams.setVpcId("vpc");
network.setAws(environmentNetworkAwsParams);
network.setSubnetIds(Sets.newHashSet("subnet"));
CloudSubnet cloudSubnet = new CloudSubnet();
cloudSubnet.setId("subnet");
cloudSubnet.setName("subnet");
cloudSubnet.setAvailabilityZone("eu-west-1a");
Map<String, CloudSubnet> cloudSubnetMap = Map.of("subnet", cloudSubnet);
network.setSubnetMetas(cloudSubnetMap);
detailedEnvironmentResponse.setNetwork(network);
EnvironmentAuthenticationResponse authentication = new EnvironmentAuthenticationResponse();
authentication.setPublicKey("ssh-public-key");
detailedEnvironmentResponse.setAuthentication(authentication);
return detailedEnvironmentResponse;
}
use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams in project cloudbreak by hortonworks.
the class NetworkRequestToDtoConverterTest method createAwsParams.
private EnvironmentNetworkAwsParams createAwsParams() {
EnvironmentNetworkAwsParams awsParams = new EnvironmentNetworkAwsParams();
awsParams.setVpcId(NETWORK_ID);
return awsParams;
}
Aggregations