@Test void testValidateWhenNoNetworkCidrAndNetworkIdOnAzure() { AzureParams azureParams = NetworkTestUtils.getAzureParams(true, true, true); NetworkDto networkDto = NetworkTestUtils.getNetworkDto(azureParams, null, null, azureParams.getNetworkId(), null, 1); environment.setCloudPlatform(CloudPlatform.AZURE.name()); environment.setCidr(null); ValidationResultBuilder resultBuilder = underTest.validateNetworkCreation(environment, networkDto); ValidationResult validationResult = resultBuilder.build(); assertFalse(validationResult.hasError()); }
public ValidationResultBuilder validateNetworkCreation(Environment environment, NetworkDto network) { ValidationResultBuilder resultBuilder = new ValidationResultBuilder(); resultBuilder.prefix("Cannot create environment"); validateNetwork(environment, network, resultBuilder); validateNetworkIdAndCidr(environment, network, resultBuilder); return resultBuilder; }
NetworkCreationValidator { public ValidationResultBuilder validateNetworkCreation(Environment environment, NetworkDto network) { ValidationResultBuilder resultBuilder = new ValidationResultBuilder(); resultBuilder.prefix("Cannot create environment"); validateNetwork(environment, network, resultBuilder); validateNetworkIdAndCidr(environment, network, resultBuilder); return resultBuilder; } }
NetworkCreationValidator { public ValidationResultBuilder validateNetworkCreation(Environment environment, NetworkDto network) { ValidationResultBuilder resultBuilder = new ValidationResultBuilder(); resultBuilder.prefix("Cannot create environment"); validateNetwork(environment, network, resultBuilder); validateNetworkIdAndCidr(environment, network, resultBuilder); return resultBuilder; } NetworkCreationValidator(Map<CloudPlatform, EnvironmentNetworkValidator> envNetworkValidators, EnvironmentDtoConverter environmentDtoConverter); }
NetworkCreationValidator { public ValidationResultBuilder validateNetworkCreation(Environment environment, NetworkDto network) { ValidationResultBuilder resultBuilder = new ValidationResultBuilder(); resultBuilder.prefix("Cannot create environment"); validateNetwork(environment, network, resultBuilder); validateNetworkIdAndCidr(environment, network, resultBuilder); return resultBuilder; } NetworkCreationValidator(Map<CloudPlatform, EnvironmentNetworkValidator> envNetworkValidators, EnvironmentDtoConverter environmentDtoConverter); ValidationResultBuilder validateNetworkCreation(Environment environment, NetworkDto network); ValidationResultBuilder validateNetworkEdit(Environment environment, NetworkDto network); }
NetworkCreationValidator { public ValidationResultBuilder validateNetworkCreation(Environment environment, NetworkDto network) { ValidationResultBuilder resultBuilder = new ValidationResultBuilder(); resultBuilder.prefix("Cannot create environment"); validateNetwork(environment, network, resultBuilder); validateNetworkIdAndCidr(environment, network, resultBuilder); return resultBuilder; } NetworkCreationValidator(Map<CloudPlatform, EnvironmentNetworkValidator> envNetworkValidators, EnvironmentDtoConverter environmentDtoConverter); ValidationResultBuilder validateNetworkCreation(Environment environment, NetworkDto network); ValidationResultBuilder validateNetworkEdit(Environment environment, NetworkDto network);  }