@Test void checkValidEnvironmentAwsHANotEnoughAZs() { Map<String, CloudSubnet> subnetMetas = Map.of("subnet1", new CloudSubnet("id1", "name1", "az1", "cidr"), "subnet2", new CloudSubnet("id2", "name2", "az1", "cidr")); DetailedEnvironmentResponse environment = createEnvironment(CloudPlatform.AWS.name(), subnetMetas); assertThatThrownBy(() -> underTest.checkValidEnvironment(STACKNAME, DatabaseAvailabilityType.HA, environment)) .isInstanceOf(BadRequestException.class) .hasMessageContaining("vpc subnets must cover at least two different availability zones"); }
public void checkValidEnvironment(String stackName, DatabaseAvailabilityType externalDatabase, DetailedEnvironmentResponse environment) { LOGGER.debug("Checking environment validity for stack {}", stackName); if (CloudPlatform.AWS.name().equalsIgnoreCase(environment.getCloudPlatform())) { checkAwsEnvironment(stackName, externalDatabase, environment); } }
EnvironmentValidator { public void checkValidEnvironment(String stackName, DatabaseAvailabilityType externalDatabase, DetailedEnvironmentResponse environment) { LOGGER.debug("Checking environment validity for stack {}", stackName); if (CloudPlatform.AWS.name().equalsIgnoreCase(environment.getCloudPlatform())) { checkAwsEnvironment(stackName, externalDatabase, environment); } } }
EnvironmentValidator { public void checkValidEnvironment(String stackName, DatabaseAvailabilityType externalDatabase, DetailedEnvironmentResponse environment) { LOGGER.debug("Checking environment validity for stack {}", stackName); if (CloudPlatform.AWS.name().equalsIgnoreCase(environment.getCloudPlatform())) { checkAwsEnvironment(stackName, externalDatabase, environment); } }  }
EnvironmentValidator { public void checkValidEnvironment(String stackName, DatabaseAvailabilityType externalDatabase, DetailedEnvironmentResponse environment) { LOGGER.debug("Checking environment validity for stack {}", stackName); if (CloudPlatform.AWS.name().equalsIgnoreCase(environment.getCloudPlatform())) { checkAwsEnvironment(stackName, externalDatabase, environment); } }  void checkValidEnvironment(String stackName, DatabaseAvailabilityType externalDatabase, DetailedEnvironmentResponse environment); }
EnvironmentValidator { public void checkValidEnvironment(String stackName, DatabaseAvailabilityType externalDatabase, DetailedEnvironmentResponse environment) { LOGGER.debug("Checking environment validity for stack {}", stackName); if (CloudPlatform.AWS.name().equalsIgnoreCase(environment.getCloudPlatform())) { checkAwsEnvironment(stackName, externalDatabase, environment); } }  void checkValidEnvironment(String stackName, DatabaseAvailabilityType externalDatabase, DetailedEnvironmentResponse environment);  }