@Test void testIfCloudPlatformMatchesWithTheGivenNetworkInstanceThenItShouldBeFine() { NetworkDto network = NetworkDto.builder().withAws(new AwsParams()).build(); ValidationResult result = underTest.validate(getEnvDto(network)); assertFalse(result.hasError()); }
public ValidationResult validate(EnvironmentDto environmentDto) { NetworkDto network = environmentDto.getNetwork(); String cloudPlatform = environmentDto.getCloudPlatform(); ValidationResultBuilder resultBuilder = ValidationResult.builder(); validateNetworkHasTheSamePropertyFilledAsTheDesiredCloudPlatform(network, cloudPlatform, resultBuilder); validateNetwork(network, cloudPlatform, resultBuilder, environmentDto); validateSecurityGroup(environmentDto, cloudPlatform, resultBuilder); return resultBuilder.build(); }
EnvironmentNetworkProviderValidator { public ValidationResult validate(EnvironmentDto environmentDto) { NetworkDto network = environmentDto.getNetwork(); String cloudPlatform = environmentDto.getCloudPlatform(); ValidationResultBuilder resultBuilder = ValidationResult.builder(); validateNetworkHasTheSamePropertyFilledAsTheDesiredCloudPlatform(network, cloudPlatform, resultBuilder); validateNetwork(network, cloudPlatform, resultBuilder, environmentDto); validateSecurityGroup(environmentDto, cloudPlatform, resultBuilder); return resultBuilder.build(); } }
EnvironmentNetworkProviderValidator { public ValidationResult validate(EnvironmentDto environmentDto) { NetworkDto network = environmentDto.getNetwork(); String cloudPlatform = environmentDto.getCloudPlatform(); ValidationResultBuilder resultBuilder = ValidationResult.builder(); validateNetworkHasTheSamePropertyFilledAsTheDesiredCloudPlatform(network, cloudPlatform, resultBuilder); validateNetwork(network, cloudPlatform, resultBuilder, environmentDto); validateSecurityGroup(environmentDto, cloudPlatform, resultBuilder); return resultBuilder.build(); } EnvironmentNetworkProviderValidator(
            Map<CloudPlatform, EnvironmentNetworkValidator> environmentNetworkValidatorsByCloudPlatform,
            Map<CloudPlatform, EnvironmentSecurityGroupValidator> environmentSecurityGroupValidatorsByCloudPlatform); }
EnvironmentNetworkProviderValidator { public ValidationResult validate(EnvironmentDto environmentDto) { NetworkDto network = environmentDto.getNetwork(); String cloudPlatform = environmentDto.getCloudPlatform(); ValidationResultBuilder resultBuilder = ValidationResult.builder(); validateNetworkHasTheSamePropertyFilledAsTheDesiredCloudPlatform(network, cloudPlatform, resultBuilder); validateNetwork(network, cloudPlatform, resultBuilder, environmentDto); validateSecurityGroup(environmentDto, cloudPlatform, resultBuilder); return resultBuilder.build(); } EnvironmentNetworkProviderValidator(
            Map<CloudPlatform, EnvironmentNetworkValidator> environmentNetworkValidatorsByCloudPlatform,
            Map<CloudPlatform, EnvironmentSecurityGroupValidator> environmentSecurityGroupValidatorsByCloudPlatform); ValidationResult validate(EnvironmentDto environmentDto); }
EnvironmentNetworkProviderValidator { public ValidationResult validate(EnvironmentDto environmentDto) { NetworkDto network = environmentDto.getNetwork(); String cloudPlatform = environmentDto.getCloudPlatform(); ValidationResultBuilder resultBuilder = ValidationResult.builder(); validateNetworkHasTheSamePropertyFilledAsTheDesiredCloudPlatform(network, cloudPlatform, resultBuilder); validateNetwork(network, cloudPlatform, resultBuilder, environmentDto); validateSecurityGroup(environmentDto, cloudPlatform, resultBuilder); return resultBuilder.build(); } EnvironmentNetworkProviderValidator(
            Map<CloudPlatform, EnvironmentNetworkValidator> environmentNetworkValidatorsByCloudPlatform,
            Map<CloudPlatform, EnvironmentSecurityGroupValidator> environmentSecurityGroupValidatorsByCloudPlatform); ValidationResult validate(EnvironmentDto environmentDto);  }