@Test public void testAzureSuccessfulValidation() { Stack stack = getStack(CloudPlatform.AZURE.name()); ValidationResult validationResult = requestValidator.validate(stack, "abfs: assertFalse(validationResult.hasError()); validationResult = requestValidator.validate(stack, "abfss: assertFalse(validationResult.hasError()); validationResult = requestValidator.validate(stack, "ABFS: assertFalse(validationResult.hasError()); validationResult = requestValidator.validate(stack, "ABFSS: assertFalse(validationResult.hasError()); assertFalse(validationResult.hasError()); validationResult = requestValidator.validate(stack, '/' + LOCATION, BACKUP_ID); assertFalse(validationResult.hasError()); validationResult = requestValidator.validate(stack, LOCATION, BACKUP_ID); assertFalse(validationResult.hasError()); }
public ValidationResult validate(Stack stack, String location, String backupId) { ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder(); String cloudPlatform = stack.cloudPlatform(); if (Strings.isNullOrEmpty(backupId)) { resultBuilder.error("Parameter backupId required"); } if (Strings.isNullOrEmpty(location)) { resultBuilder.error("Parameter backupLocation required"); } else { validateCloudLocationScheme(cloudPlatform, location, resultBuilder); } return resultBuilder.build(); }
BackupRestoreV4RequestValidator { public ValidationResult validate(Stack stack, String location, String backupId) { ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder(); String cloudPlatform = stack.cloudPlatform(); if (Strings.isNullOrEmpty(backupId)) { resultBuilder.error("Parameter backupId required"); } if (Strings.isNullOrEmpty(location)) { resultBuilder.error("Parameter backupLocation required"); } else { validateCloudLocationScheme(cloudPlatform, location, resultBuilder); } return resultBuilder.build(); } }
BackupRestoreV4RequestValidator { public ValidationResult validate(Stack stack, String location, String backupId) { ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder(); String cloudPlatform = stack.cloudPlatform(); if (Strings.isNullOrEmpty(backupId)) { resultBuilder.error("Parameter backupId required"); } if (Strings.isNullOrEmpty(location)) { resultBuilder.error("Parameter backupLocation required"); } else { validateCloudLocationScheme(cloudPlatform, location, resultBuilder); } return resultBuilder.build(); }  }
BackupRestoreV4RequestValidator { public ValidationResult validate(Stack stack, String location, String backupId) { ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder(); String cloudPlatform = stack.cloudPlatform(); if (Strings.isNullOrEmpty(backupId)) { resultBuilder.error("Parameter backupId required"); } if (Strings.isNullOrEmpty(location)) { resultBuilder.error("Parameter backupLocation required"); } else { validateCloudLocationScheme(cloudPlatform, location, resultBuilder); } return resultBuilder.build(); }  ValidationResult validate(Stack stack, String location, String backupId); }
BackupRestoreV4RequestValidator { public ValidationResult validate(Stack stack, String location, String backupId) { ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder(); String cloudPlatform = stack.cloudPlatform(); if (Strings.isNullOrEmpty(backupId)) { resultBuilder.error("Parameter backupId required"); } if (Strings.isNullOrEmpty(location)) { resultBuilder.error("Parameter backupLocation required"); } else { validateCloudLocationScheme(cloudPlatform, location, resultBuilder); } return resultBuilder.build(); }  ValidationResult validate(Stack stack, String location, String backupId);  }