@Test public void testAddNetworkParametersWhenAws() { Map<String, Object> parameters = new HashMap<>(); List<String> subnetIds = List.of("subnet1", "subnet2"); parameters = underTest.addSubnetIds(parameters, subnetIds, List.of(), CloudPlatform.AWS); assertThat(parameters, IsMapContaining.hasEntry(NetworkParameterAdder.SUBNET_ID, String.join(",", subnetIds))); }
public Map<String, Object> addSubnetIds(Map<String, Object> parameters, List<String> subnetIds, List<String> azs, CloudPlatform cloudPlatform) { switch (cloudPlatform) { case AWS: case GCP: case MOCK: parameters.put(SUBNET_ID, String.join(",", subnetIds)); parameters.put(AVAILABILITY_ZONE, String.join(",", azs)); break; case AZURE: parameters.put(SUBNETS, String.join(",", subnetIds)); break; default: throw new RedbeamsException(String.format("Support for cloud platform %s not yet added", cloudPlatform.name())); } return parameters; }
NetworkParameterAdder { public Map<String, Object> addSubnetIds(Map<String, Object> parameters, List<String> subnetIds, List<String> azs, CloudPlatform cloudPlatform) { switch (cloudPlatform) { case AWS: case GCP: case MOCK: parameters.put(SUBNET_ID, String.join(",", subnetIds)); parameters.put(AVAILABILITY_ZONE, String.join(",", azs)); break; case AZURE: parameters.put(SUBNETS, String.join(",", subnetIds)); break; default: throw new RedbeamsException(String.format("Support for cloud platform %s not yet added", cloudPlatform.name())); } return parameters; } }
NetworkParameterAdder { public Map<String, Object> addSubnetIds(Map<String, Object> parameters, List<String> subnetIds, List<String> azs, CloudPlatform cloudPlatform) { switch (cloudPlatform) { case AWS: case GCP: case MOCK: parameters.put(SUBNET_ID, String.join(",", subnetIds)); parameters.put(AVAILABILITY_ZONE, String.join(",", azs)); break; case AZURE: parameters.put(SUBNETS, String.join(",", subnetIds)); break; default: throw new RedbeamsException(String.format("Support for cloud platform %s not yet added", cloudPlatform.name())); } return parameters; }  }
NetworkParameterAdder { public Map<String, Object> addSubnetIds(Map<String, Object> parameters, List<String> subnetIds, List<String> azs, CloudPlatform cloudPlatform) { switch (cloudPlatform) { case AWS: case GCP: case MOCK: parameters.put(SUBNET_ID, String.join(",", subnetIds)); parameters.put(AVAILABILITY_ZONE, String.join(",", azs)); break; case AZURE: parameters.put(SUBNETS, String.join(",", subnetIds)); break; default: throw new RedbeamsException(String.format("Support for cloud platform %s not yet added", cloudPlatform.name())); } return parameters; }  Map<String, Object> addSubnetIds(Map<String, Object> parameters, List<String> subnetIds, List<String> azs, CloudPlatform cloudPlatform); Map<String, Object> addParameters(Map<String, Object> parameters, DetailedEnvironmentResponse environmentResponse, CloudPlatform cloudPlatform); }
NetworkParameterAdder { public Map<String, Object> addSubnetIds(Map<String, Object> parameters, List<String> subnetIds, List<String> azs, CloudPlatform cloudPlatform) { switch (cloudPlatform) { case AWS: case GCP: case MOCK: parameters.put(SUBNET_ID, String.join(",", subnetIds)); parameters.put(AVAILABILITY_ZONE, String.join(",", azs)); break; case AZURE: parameters.put(SUBNETS, String.join(",", subnetIds)); break; default: throw new RedbeamsException(String.format("Support for cloud platform %s not yet added", cloudPlatform.name())); } return parameters; }  Map<String, Object> addSubnetIds(Map<String, Object> parameters, List<String> subnetIds, List<String> azs, CloudPlatform cloudPlatform); Map<String, Object> addParameters(Map<String, Object> parameters, DetailedEnvironmentResponse environmentResponse, CloudPlatform cloudPlatform);  }