Search in sources :

Example 16 with CloudLoadBalancer

use of com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer in project cloudbreak by hortonworks.

the class AwsDownscaleServiceTest method downscaleWithLoadBalancers.

@Test
void downscaleWithLoadBalancers() {
    CloudStack stack = mock(CloudStack.class);
    List<CloudResource> resources = Collections.emptyList();
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication("sshkey", "", "cloudbreak");
    InstanceTemplate workerTemplate = mock(InstanceTemplate.class);
    when(workerTemplate.getGroupName()).thenReturn("worker");
    List<CloudInstance> cloudInstances = List.of(new CloudInstance("i-worker1", workerTemplate, instanceAuthentication, "subnet-1", "az1"));
    CloudLoadBalancer privateLoadBalancer = new CloudLoadBalancer(LoadBalancerType.PRIVATE);
    CloudLoadBalancer publicLoadBalancer = new CloudLoadBalancer(LoadBalancerType.PUBLIC);
    CloudContext context = CloudContext.Builder.builder().withId(1L).withName("teststack").withCrn("crn").withPlatform("AWS").withVariant("AWS").withLocation(Location.location(Region.region("eu-west-1"), AvailabilityZone.availabilityZone("eu-west-1a"))).withAccountId("1").build();
    AuthenticatedContext authenticatedContext = new AuthenticatedContext(context, new CloudCredential());
    AmazonAutoScalingClient amazonAutoScalingClient = mock(AmazonAutoScalingClient.class);
    when(awsClient.createAutoScalingClient(any(), anyString())).thenReturn(amazonAutoScalingClient);
    AmazonEc2Client amazonEC2Client = mock(AmazonEc2Client.class);
    when(awsClient.createEc2Client(any(), anyString())).thenReturn(amazonEC2Client);
    AmazonEC2Waiters amazonEC2Waiters = mock(AmazonEC2Waiters.class);
    when(amazonEC2Client.waiters()).thenReturn(amazonEC2Waiters);
    Waiter waiter = mock(Waiter.class);
    when(amazonEC2Waiters.instanceTerminated()).thenReturn(waiter);
    when(cfStackUtil.getAutoscalingGroupName(any(), (String) any(), any())).thenReturn("autoscalegroup-1");
    when(stack.getLoadBalancers()).thenReturn(List.of(privateLoadBalancer, publicLoadBalancer));
    doNothing().when(loadBalancerService).removeLoadBalancerTargets(any(), any(), any());
    DescribeAutoScalingGroupsResult describeAutoScalingGroupsResult = new DescribeAutoScalingGroupsResult();
    AutoScalingGroup autoScalingGroup = new AutoScalingGroup();
    autoScalingGroup.setInstances(List.of(new Instance().withInstanceId("i-worker1")));
    describeAutoScalingGroupsResult.setAutoScalingGroups(List.of(autoScalingGroup));
    ArgumentCaptor<DescribeAutoScalingGroupsRequest> describeAutoScalingGroupsRequest = ArgumentCaptor.forClass(DescribeAutoScalingGroupsRequest.class);
    ArgumentCaptor<DetachInstancesRequest> detachInstancesRequestArgumentCaptor = ArgumentCaptor.forClass(DetachInstancesRequest.class);
    when(amazonAutoScalingClient.describeAutoScalingGroups(describeAutoScalingGroupsRequest.capture())).thenReturn(describeAutoScalingGroupsResult);
    when(amazonAutoScalingClient.detachInstances(detachInstancesRequestArgumentCaptor.capture())).thenReturn(new DetachInstancesResult());
    mockDescribeInstances(amazonEC2Client);
    underTest.downscale(authenticatedContext, stack, resources, cloudInstances);
    verify(loadBalancerService).removeLoadBalancerTargets(any(), any(), any());
}
Also used : AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) InstanceAuthentication(com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication) CloudCredential(com.sequenceiq.cloudbreak.cloud.model.CloudCredential) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) Instance(com.amazonaws.services.autoscaling.model.Instance) CloudContext(com.sequenceiq.cloudbreak.cloud.context.CloudContext) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) AmazonEC2Waiters(com.amazonaws.services.ec2.waiters.AmazonEC2Waiters) DetachInstancesResult(com.amazonaws.services.autoscaling.model.DetachInstancesResult) DescribeAutoScalingGroupsRequest(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest) CloudLoadBalancer(com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer) AmazonAutoScalingClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonAutoScalingClient) DescribeAutoScalingGroupsResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) AmazonEc2Client(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEc2Client) Waiter(com.amazonaws.waiters.Waiter) DetachInstancesRequest(com.amazonaws.services.autoscaling.model.DetachInstancesRequest) InstanceTemplate(com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate) Test(org.junit.jupiter.api.Test)

Example 17 with CloudLoadBalancer

use of com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer in project cloudbreak by hortonworks.

the class AwsLaunchServiceLoadBalancerTest method setupMocksForUpdate.

private void setupMocksForUpdate(AwsNetworkView awsNetworkView, Network network, List<CloudResource> instances, Set<LoadBalancerType> types) {
    List<CloudLoadBalancer> loadBalancers = new ArrayList<>();
    List<AwsLoadBalancer> awsLoadBalancers = new ArrayList<>();
    for (LoadBalancerType type : types) {
        loadBalancers.add(createCloudLoadBalancer(type));
        AwsLoadBalancerScheme scheme = AwsLoadBalancerScheme.INTERNET_FACING;
        if (LoadBalancerType.PRIVATE.equals(type)) {
            scheme = AwsLoadBalancerScheme.INTERNAL;
        }
        AwsLoadBalancer awsLoadBalancer = new AwsLoadBalancer(scheme);
        awsLoadBalancer.getOrCreateListener(PORT, PORT);
        awsLoadBalancers.add(awsLoadBalancer);
    }
    when(cfStackUtil.getCfStackName(any())).thenReturn(STACK_NAME);
    when(awsClient.createCloudFormationClient(any(), anyString())).thenReturn(cfClient);
    when(cfClient.updateStack(any())).thenReturn(null);
    when(cfClient.listStackResources(any())).thenReturn(result);
    when(cloudFormationTemplateBuilder.build(any(ModelContext.class))).thenReturn("{}");
    when(awsStackRequestHelper.createUpdateStackRequest(any(), any(), anyString(), anyString())).thenReturn(null);
    when(cfClient.waiters()).thenReturn(waiters);
    when(waiters.stackUpdateComplete()).thenReturn(updateWaiter);
    when(ac.getCloudContext()).thenReturn(cloudContext);
    when(cloudContext.getId()).thenReturn(1L);
    when(cloudContext.getLocation()).thenReturn(location);
    when(location.getRegion()).thenReturn(region);
    when(region.value()).thenReturn("region");
    when(cloudStack.getLoadBalancers()).thenReturn(loadBalancers);
    when(cloudStack.getNetwork()).thenReturn(network);
    when(awsModelService.buildDefaultModelContext(any(), any(), any())).thenReturn(new ModelContext());
    when(awsLoadBalancerCommonService.getAwsLoadBalancers(eq(loadBalancers), any(), any())).thenReturn(awsLoadBalancers);
    PowerMockito.mockStatic(AwsPageCollector.class);
    PowerMockito.when(AwsPageCollector.getAllRouteTables(any(), any())).thenReturn(List.of());
}
Also used : ModelContext(com.sequenceiq.cloudbreak.cloud.aws.common.resource.ModelContext) CloudLoadBalancer(com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer) ArrayList(java.util.ArrayList) AwsLoadBalancer(com.sequenceiq.cloudbreak.cloud.aws.common.loadbalancer.AwsLoadBalancer) LoadBalancerType(com.sequenceiq.common.api.type.LoadBalancerType) AwsLoadBalancerScheme(com.sequenceiq.cloudbreak.cloud.aws.common.loadbalancer.AwsLoadBalancerScheme)

Example 18 with CloudLoadBalancer

use of com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer in project cloudbreak by hortonworks.

the class AzureTemplateBuilderTest method buildWithGatewayInstanceGroupTypeAndStandardLoadBalancer.

@ParameterizedTest(name = "buildWithGatewayInstanceGroupTypeAndStandardLoadBalancer {0}")
@MethodSource("templatesPathDataProvider")
public void buildWithGatewayInstanceGroupTypeAndStandardLoadBalancer(String templatePath) {
    assumeTrue(isTemplateVersionGreaterOrEqualThan(templatePath, "2.7.3.0"));
    // GIVEN
    ReflectionTestUtils.setField(azureTemplateBuilder, FIELD_ARM_TEMPLATE_PATH, templatePath);
    Network network = new Network(new Subnet(SUBNET_CIDR));
    Map<String, String> parameters = new HashMap<>();
    parameters.put("persistentStorage", "persistentStorageTest");
    parameters.put("attachedStorageOption", "attachedStorageOptionTest");
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication("sshkey", "", "cloudbreak");
    groups.add(new Group("gateway-group", InstanceGroupType.GATEWAY, Collections.singletonList(instance), security, null, instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey(), ROOT_VOLUME_SIZE, Optional.empty(), createGroupNetwork(), emptyMap()));
    List<CloudLoadBalancer> loadBalancers = new ArrayList<>();
    CloudLoadBalancer loadBalancer = new CloudLoadBalancer(LoadBalancerType.PUBLIC, LoadBalancerSku.STANDARD);
    loadBalancer.addPortToTargetGroupMapping(new TargetGroupPortPair(443, 8443), new HashSet<>(groups));
    loadBalancers.add(loadBalancer);
    cloudStack = new CloudStack(groups, network, image, parameters, tags, azureTemplateBuilder.getTemplateString(), instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey(), null, loadBalancers);
    azureStackView = new AzureStackView("mystack", 3, groups, azureStorageView, azureSubnetStrategy, Collections.emptyMap());
    // WHEN
    when(azureAcceleratedNetworkValidator.validate(any())).thenReturn(ACCELERATED_NETWORK_SUPPORT);
    when(azureStorage.getImageStorageName(any(AzureCredentialView.class), any(CloudContext.class), any(CloudStack.class))).thenReturn("test");
    when(azureStorage.getDiskContainerName(any(CloudContext.class))).thenReturn("testStorageContainer");
    String templateString = azureTemplateBuilder.build(stackName, CUSTOM_IMAGE_NAME, azureCredentialView, azureStackView, cloudContext, cloudStack, AzureInstanceTemplateOperation.PROVISION, null);
    // THEN
    gson.fromJson(templateString, Map.class);
    assertTrue(templateString.contains("\"type\": \"Microsoft.Network/loadBalancers\","));
    assertTrue(templateString.contains("\"frontendPort\": 443,"));
    assertTrue(templateString.contains("\"backendPort\": 443,"));
    assertTrue(templateString.contains("\"name\": \"port-443-rule\","));
    assertTrue(templateString.contains("\"name\": \"port-8443-probe\","));
    assertTrue(templateString.contains("\"type\": \"Microsoft.Network/publicIPAddresses\","));
    assertTrue(templateString.contains("\"name\": \"Standard\""));
    assertTrue(templateString.contains("\"tier\": \"Regional\""));
}
Also used : Group(com.sequenceiq.cloudbreak.cloud.model.Group) InstanceAuthentication(com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication) HashMap(java.util.HashMap) CloudContext(com.sequenceiq.cloudbreak.cloud.context.CloudContext) ArrayList(java.util.ArrayList) AzureStackView(com.sequenceiq.cloudbreak.cloud.azure.view.AzureStackView) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) AzureCredentialView(com.sequenceiq.cloudbreak.cloud.azure.view.AzureCredentialView) CloudLoadBalancer(com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer) GroupNetwork(com.sequenceiq.cloudbreak.cloud.model.GroupNetwork) Network(com.sequenceiq.cloudbreak.cloud.model.Network) Subnet(com.sequenceiq.cloudbreak.cloud.model.Subnet) TargetGroupPortPair(com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 19 with CloudLoadBalancer

use of com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer in project cloudbreak by hortonworks.

the class AzureTemplateBuilderTest method testNicDependenciesAreValidJson.

@ParameterizedTest(name = "testNicDependenciesAreValidJson {0}")
@MethodSource("templatesPathDataProvider")
public void testNicDependenciesAreValidJson(String templatePath) {
    ReflectionTestUtils.setField(azureTemplateBuilder, FIELD_ARM_TEMPLATE_PATH, templatePath);
    // GIVEN
    assumeTrue(isTemplateVersionGreaterOrEqualThan(templatePath, "2.7.3.0"));
    Network network = new Network(new Subnet(SUBNET_CIDR));
    Map<String, String> parameters = new HashMap<>();
    parameters.put("persistentStorage", "persistentStorageTest");
    parameters.put("attachedStorageOption", "attachedStorageOptionTest");
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication("sshkey", "", "cloudbreak");
    groups.add(new Group("gateway-group", InstanceGroupType.GATEWAY, Collections.singletonList(instance), security, null, instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey(), ROOT_VOLUME_SIZE, Optional.empty(), createGroupNetwork(), emptyMap()));
    List<CloudLoadBalancer> loadBalancers = new ArrayList<>();
    CloudLoadBalancer publicLb = new CloudLoadBalancer(LoadBalancerType.PUBLIC);
    publicLb.addPortToTargetGroupMapping(new TargetGroupPortPair(443, 8443), new HashSet<>(groups));
    loadBalancers.add(publicLb);
    CloudLoadBalancer privateLb = new CloudLoadBalancer(LoadBalancerType.PRIVATE);
    privateLb.addPortToTargetGroupMapping(new TargetGroupPortPair(443, 8443), new HashSet<>(groups));
    loadBalancers.add(privateLb);
    cloudStack = new CloudStack(groups, network, image, parameters, tags, azureTemplateBuilder.getTemplateString(), instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey(), null, loadBalancers);
    azureStackView = new AzureStackView("mystack", 3, groups, azureStorageView, azureSubnetStrategy, Collections.emptyMap());
    // WHEN
    when(azureAcceleratedNetworkValidator.validate(any())).thenReturn(ACCELERATED_NETWORK_SUPPORT);
    when(azureStorage.getImageStorageName(any(AzureCredentialView.class), any(CloudContext.class), any(CloudStack.class))).thenReturn("test");
    when(azureStorage.getDiskContainerName(any(CloudContext.class))).thenReturn("testStorageContainer");
    when(azureUtils.getCustomResourceGroupName(any())).thenReturn("custom-resource-group-name");
    when(azureUtils.getCustomNetworkId(any())).thenReturn("custom-vnet-id");
    // This test is checking that valid json is created when using an existing network and no public IP.
    when(azureUtils.isExistingNetwork(any())).thenReturn(true);
    when(azureUtils.isPrivateIp(any())).thenReturn(true);
    String templateString = azureTemplateBuilder.build(stackName, CUSTOM_IMAGE_NAME, azureCredentialView, azureStackView, cloudContext, cloudStack, AzureInstanceTemplateOperation.UPSCALE, null);
    // THEN
    validateJson(templateString);
}
Also used : Group(com.sequenceiq.cloudbreak.cloud.model.Group) InstanceAuthentication(com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication) HashMap(java.util.HashMap) CloudContext(com.sequenceiq.cloudbreak.cloud.context.CloudContext) ArrayList(java.util.ArrayList) AzureStackView(com.sequenceiq.cloudbreak.cloud.azure.view.AzureStackView) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) AzureCredentialView(com.sequenceiq.cloudbreak.cloud.azure.view.AzureCredentialView) CloudLoadBalancer(com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer) GroupNetwork(com.sequenceiq.cloudbreak.cloud.model.GroupNetwork) Network(com.sequenceiq.cloudbreak.cloud.model.Network) Subnet(com.sequenceiq.cloudbreak.cloud.model.Subnet) TargetGroupPortPair(com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 20 with CloudLoadBalancer

use of com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer in project cloudbreak by hortonworks.

the class AzureTemplateBuilderTest method buildWithStandardLoadBalancerOnlyTargetGroupsUpdated.

@ParameterizedTest(name = "buildWithStandardLoadBalancerOnlyTargetGroupsUpdated {0}")
@MethodSource("templatesPathDataProvider")
public void buildWithStandardLoadBalancerOnlyTargetGroupsUpdated(String templatePath) {
    assumeTrue(isTemplateVersionGreaterOrEqualThan(templatePath, "2.7.3.0"));
    // GIVEN
    ReflectionTestUtils.setField(azureTemplateBuilder, FIELD_ARM_TEMPLATE_PATH, templatePath);
    String lbGroupExpectedBlob = "\"tags\":{},\"sku\":{\"name\":\"Standard\",\"tier\":\"Regional\"},\"properties\":{\"publicIPAllocationM" + "ethod\":\"Static\"}},{\"apiVersion\":\"2016-09-01\",\"type\":\"Microsoft.Network/networkInterfa" + "ces\",\"name\":\"[concat(parameters('nicNamePrefix'),'m0')]\",\"location\":\"[parameters('regio" + "n')]\",\"tags\":{},\"dependsOn\":[\"[concat('Microsoft.Network/networkSecurityGroups/',variable" + "s('gateway-groupsecGroupName'))]\"";
    String nonLbGroupExpectedBlob = "\"tags\":{},\"properties\":{\"publicIPAllocationMethod\":\"Dynamic\"}},{\"apiVersion\":\"2016-09-01\",\"" + "type\":\"Microsoft.Network/networkInterfaces\",\"name\":\"[concat(parameters('nicNamePrefix'),'" + "m0')]\",\"location\":\"[parameters('region')]\",\"tags\":{},\"dependsOn\":[\"[concat('Microsoft" + ".Network/networkSecurityGroups/',variables('core-groupsecGroupName'))]\"";
    Network network = new Network(new Subnet(SUBNET_CIDR));
    Map<String, String> parameters = new HashMap<>();
    parameters.put("persistentStorage", "persistentStorageTest");
    parameters.put("attachedStorageOption", "attachedStorageOptionTest");
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication("sshkey", "", "cloudbreak");
    Map<String, Object> lbParams = new HashMap<>();
    Map<String, Object> lbAsName = new HashMap<>();
    lbAsName.put("name", "gateway-group-as");
    lbParams.put("availabilitySet", lbAsName);
    Group lbGroup = new Group("gateway-group", InstanceGroupType.GATEWAY, Collections.singletonList(instance), security, null, lbParams, instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey(), ROOT_VOLUME_SIZE, Optional.empty(), createGroupNetwork(), emptyMap());
    Group nonLbGroup = new Group("core-group", InstanceGroupType.CORE, Collections.singletonList(instance), security, null, instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey(), ROOT_VOLUME_SIZE, Optional.empty(), createGroupNetwork(), emptyMap());
    groups.add(lbGroup);
    groups.add(nonLbGroup);
    List<CloudLoadBalancer> loadBalancers = new ArrayList<>();
    CloudLoadBalancer loadBalancer = new CloudLoadBalancer(LoadBalancerType.PUBLIC, LoadBalancerSku.STANDARD);
    loadBalancer.addPortToTargetGroupMapping(new TargetGroupPortPair(443, 8443), Set.of(lbGroup));
    loadBalancers.add(loadBalancer);
    cloudStack = new CloudStack(groups, network, image, parameters, tags, azureTemplateBuilder.getTemplateString(), instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey(), null, loadBalancers);
    azureStackView = new AzureStackView("mystack", 3, groups, azureStorageView, azureSubnetStrategy, Collections.emptyMap());
    // WHEN
    when(azureAcceleratedNetworkValidator.validate(any())).thenReturn(ACCELERATED_NETWORK_SUPPORT);
    when(azureStorage.getImageStorageName(any(AzureCredentialView.class), any(CloudContext.class), any(CloudStack.class))).thenReturn("test");
    when(azureStorage.getDiskContainerName(any(CloudContext.class))).thenReturn("testStorageContainer");
    String templateString = azureTemplateBuilder.build(stackName, CUSTOM_IMAGE_NAME, azureCredentialView, azureStackView, cloudContext, cloudStack, AzureInstanceTemplateOperation.PROVISION, null);
    // THEN
    String strippedTemplateString = templateString.replaceAll("\\s", "");
    assertTrue(strippedTemplateString.contains(lbGroupExpectedBlob));
    assertTrue(strippedTemplateString.contains(nonLbGroupExpectedBlob));
}
Also used : Group(com.sequenceiq.cloudbreak.cloud.model.Group) InstanceAuthentication(com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication) HashMap(java.util.HashMap) CloudContext(com.sequenceiq.cloudbreak.cloud.context.CloudContext) ArrayList(java.util.ArrayList) AzureStackView(com.sequenceiq.cloudbreak.cloud.azure.view.AzureStackView) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) AzureCredentialView(com.sequenceiq.cloudbreak.cloud.azure.view.AzureCredentialView) CloudLoadBalancer(com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer) GroupNetwork(com.sequenceiq.cloudbreak.cloud.model.GroupNetwork) Network(com.sequenceiq.cloudbreak.cloud.model.Network) Subnet(com.sequenceiq.cloudbreak.cloud.model.Subnet) TargetGroupPortPair(com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

CloudLoadBalancer (com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer)47 TargetGroupPortPair (com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair)27 Group (com.sequenceiq.cloudbreak.cloud.model.Group)24 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)21 ArrayList (java.util.ArrayList)21 Test (org.junit.jupiter.api.Test)20 List (java.util.List)15 AwsNetworkView (com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsNetworkView)13 LoadBalancerType (com.sequenceiq.common.api.type.LoadBalancerType)13 HashMap (java.util.HashMap)13 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)13 CloudContext (com.sequenceiq.cloudbreak.cloud.context.CloudContext)12 Set (java.util.Set)12 InstanceAuthentication (com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication)11 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)11 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)10 GroupNetwork (com.sequenceiq.cloudbreak.cloud.model.GroupNetwork)10 Network (com.sequenceiq.cloudbreak.cloud.model.Network)10 Map (java.util.Map)10 CloudInstance (com.sequenceiq.cloudbreak.cloud.model.CloudInstance)9