@Test public void testConvertToStackRequestWhenAzurePresentedWithSubnet() { NetworkV1Request networkV1Request = azureNetworkV1Request(); DetailedEnvironmentResponse environmentNetworkResponse = azureEnvironmentNetwork(); NetworkV4Request networkV4Request = underTest .convertToNetworkV4Request(new ImmutablePair<>(networkV1Request, environmentNetworkResponse)); Assert.assertEquals(networkV4Request.createAzure().getNetworkId(), VPC_ID); Assert.assertEquals(networkV4Request.createAzure().getResourceGroupName(), GROUP_NAME); Assert.assertEquals(networkV4Request.createAzure().getSubnetId(), SUBNET_ID); }
public NetworkV4Request convertToNetworkV4Request(Pair<NetworkV1Request, DetailedEnvironmentResponse> network) { EnvironmentNetworkResponse value = network.getValue().getNetwork(); NetworkV1Request key = network.getKey(); if (key == null) { key = new NetworkV1Request(); } NetworkV4Request request = new NetworkV4Request(); switch (network.getValue().getCloudPlatform()) { case "AWS": request.setAws(getAwsNetworkParameters(Optional.ofNullable(key.getAws()), value)); break; case "AZURE": request.setAzure(getAzureNetworkParameters(Optional.ofNullable(key.getAzure()), value)); break; case "MOCK": request.setMock(getMockNetworkParameters(Optional.ofNullable(key.getMock()), value)); break; case "GCP": request.setGcp(getGcpNetworkParameters(Optional.ofNullable(key.getGcp()), value)); break; default: } return request; }
NetworkV1ToNetworkV4Converter { public NetworkV4Request convertToNetworkV4Request(Pair<NetworkV1Request, DetailedEnvironmentResponse> network) { EnvironmentNetworkResponse value = network.getValue().getNetwork(); NetworkV1Request key = network.getKey(); if (key == null) { key = new NetworkV1Request(); } NetworkV4Request request = new NetworkV4Request(); switch (network.getValue().getCloudPlatform()) { case "AWS": request.setAws(getAwsNetworkParameters(Optional.ofNullable(key.getAws()), value)); break; case "AZURE": request.setAzure(getAzureNetworkParameters(Optional.ofNullable(key.getAzure()), value)); break; case "MOCK": request.setMock(getMockNetworkParameters(Optional.ofNullable(key.getMock()), value)); break; case "GCP": request.setGcp(getGcpNetworkParameters(Optional.ofNullable(key.getGcp()), value)); break; default: } return request; } }
NetworkV1ToNetworkV4Converter { public NetworkV4Request convertToNetworkV4Request(Pair<NetworkV1Request, DetailedEnvironmentResponse> network) { EnvironmentNetworkResponse value = network.getValue().getNetwork(); NetworkV1Request key = network.getKey(); if (key == null) { key = new NetworkV1Request(); } NetworkV4Request request = new NetworkV4Request(); switch (network.getValue().getCloudPlatform()) { case "AWS": request.setAws(getAwsNetworkParameters(Optional.ofNullable(key.getAws()), value)); break; case "AZURE": request.setAzure(getAzureNetworkParameters(Optional.ofNullable(key.getAzure()), value)); break; case "MOCK": request.setMock(getMockNetworkParameters(Optional.ofNullable(key.getMock()), value)); break; case "GCP": request.setGcp(getGcpNetworkParameters(Optional.ofNullable(key.getGcp()), value)); break; default: } return request; }  }
NetworkV1ToNetworkV4Converter { public NetworkV4Request convertToNetworkV4Request(Pair<NetworkV1Request, DetailedEnvironmentResponse> network) { EnvironmentNetworkResponse value = network.getValue().getNetwork(); NetworkV1Request key = network.getKey(); if (key == null) { key = new NetworkV1Request(); } NetworkV4Request request = new NetworkV4Request(); switch (network.getValue().getCloudPlatform()) { case "AWS": request.setAws(getAwsNetworkParameters(Optional.ofNullable(key.getAws()), value)); break; case "AZURE": request.setAzure(getAzureNetworkParameters(Optional.ofNullable(key.getAzure()), value)); break; case "MOCK": request.setMock(getMockNetworkParameters(Optional.ofNullable(key.getMock()), value)); break; case "GCP": request.setGcp(getGcpNetworkParameters(Optional.ofNullable(key.getGcp()), value)); break; default: } return request; }  NetworkV4Request convertToNetworkV4Request(Pair<NetworkV1Request, DetailedEnvironmentResponse> network); NetworkV1Request convertToNetworkV1Request(NetworkV4Request network); }
NetworkV1ToNetworkV4Converter { public NetworkV4Request convertToNetworkV4Request(Pair<NetworkV1Request, DetailedEnvironmentResponse> network) { EnvironmentNetworkResponse value = network.getValue().getNetwork(); NetworkV1Request key = network.getKey(); if (key == null) { key = new NetworkV1Request(); } NetworkV4Request request = new NetworkV4Request(); switch (network.getValue().getCloudPlatform()) { case "AWS": request.setAws(getAwsNetworkParameters(Optional.ofNullable(key.getAws()), value)); break; case "AZURE": request.setAzure(getAzureNetworkParameters(Optional.ofNullable(key.getAzure()), value)); break; case "MOCK": request.setMock(getMockNetworkParameters(Optional.ofNullable(key.getMock()), value)); break; case "GCP": request.setGcp(getGcpNetworkParameters(Optional.ofNullable(key.getGcp()), value)); break; default: } return request; }  NetworkV4Request convertToNetworkV4Request(Pair<NetworkV1Request, DetailedEnvironmentResponse> network); NetworkV1Request convertToNetworkV1Request(NetworkV4Request network);  }