@Test public void testUnsupportedCloudPlatform() { Stack stack = getStack(CloudPlatform.YARN.name()); ValidationResult validationResult = requestValidator.validate(stack, LOCATION, BACKUP_ID); assert validationResult.hasError(); assertEquals("1. Cloud platform YARN not supported for backup/restore", validationResult.getFormattedErrors()); }
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);  }