Search in sources :

Example 1 with DescribeVpcEndpointServicesResult

use of com.amazonaws.services.ec2.model.DescribeVpcEndpointServicesResult in project cloudbreak by hortonworks.

the class AwsNetworkCfTemplateProviderTest method createDescribeVpcEndpointServicesResultWithDifferentAzs.

private static DescribeVpcEndpointServicesResult createDescribeVpcEndpointServicesResultWithDifferentAzs() {
    DescribeVpcEndpointServicesResult describeVpcEndpointServicesResult = new DescribeVpcEndpointServicesResult();
    List<ServiceDetail> serviceDetails = new ArrayList<>();
    ServiceDetail serviceDetail1 = new ServiceDetail().withServiceName(String.format(AwsNetworkCfTemplateProvider.VPC_INTERFACE_SERVICE_ENDPOINT_NAME_PATTERN, "region", "interface1"));
    serviceDetail1.setAvailabilityZones(List.of("az1"));
    serviceDetails.add(serviceDetail1);
    ServiceDetail serviceDetail2 = new ServiceDetail().withServiceName(String.format(AwsNetworkCfTemplateProvider.VPC_INTERFACE_SERVICE_ENDPOINT_NAME_PATTERN, "region", "interface2"));
    serviceDetail2.setAvailabilityZones(List.of("az2", "az3"));
    serviceDetails.add(serviceDetail2);
    ServiceDetail serviceDetail3 = new ServiceDetail().withServiceName(String.format(AwsNetworkCfTemplateProvider.VPC_INTERFACE_SERVICE_ENDPOINT_NAME_PATTERN, "region", "interface3"));
    serviceDetail3.setAvailabilityZones(List.of("az5", "az6"));
    serviceDetails.add(serviceDetail3);
    describeVpcEndpointServicesResult.setServiceDetails(serviceDetails);
    return describeVpcEndpointServicesResult;
}
Also used : DescribeVpcEndpointServicesResult(com.amazonaws.services.ec2.model.DescribeVpcEndpointServicesResult) ArrayList(java.util.ArrayList) ServiceDetail(com.amazonaws.services.ec2.model.ServiceDetail)

Example 2 with DescribeVpcEndpointServicesResult

use of com.amazonaws.services.ec2.model.DescribeVpcEndpointServicesResult in project cloudbreak by hortonworks.

the class AwsNetworkCfTemplateProviderTest method createDescribeVpcEndpointServicesResult.

private static DescribeVpcEndpointServicesResult createDescribeVpcEndpointServicesResult(String... services) {
    DescribeVpcEndpointServicesResult describeVpcEndpointServicesResult = new DescribeVpcEndpointServicesResult();
    List<ServiceDetail> serviceDetails = new ArrayList<>();
    for (String service : services) {
        ServiceDetail serviceDetail = new ServiceDetail().withServiceName(String.format(AwsNetworkCfTemplateProvider.VPC_INTERFACE_SERVICE_ENDPOINT_NAME_PATTERN, "region", service));
        serviceDetail.setAvailabilityZones(List.of("az1", "az2"));
        serviceDetails.add(serviceDetail);
    }
    describeVpcEndpointServicesResult.setServiceDetails(serviceDetails);
    return describeVpcEndpointServicesResult;
}
Also used : DescribeVpcEndpointServicesResult(com.amazonaws.services.ec2.model.DescribeVpcEndpointServicesResult) ArrayList(java.util.ArrayList) ServiceDetail(com.amazonaws.services.ec2.model.ServiceDetail) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString)

Aggregations

DescribeVpcEndpointServicesResult (com.amazonaws.services.ec2.model.DescribeVpcEndpointServicesResult)2 ServiceDetail (com.amazonaws.services.ec2.model.ServiceDetail)2 ArrayList (java.util.ArrayList)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1