@Test(dataProvider = "invalidInputURLsProvider", expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = ".*All inputs must specify a valid url.*") public void testInvalidInputURLs(String[] fileUrls) { TransformRequest transformRequest = createTransform(CUSTOMER_ID); transformRequest.setInputs(Arrays.stream(fileUrls).map(fileUrl -> { InputFileResource inputFile = new InputFileResource(); inputFile.setUrl(fileUrl); return inputFile; }).collect(Collectors.toList())); validator.validatePOST(createRequest(transformRequest)); }
@Override public void validatePOST(DataObjectRequest<TransformRequest> request) { super.validatePOST(request); validationIssues = new LinkedList<>(); TransformRequest transform = request.getDataObject(); JsonNode rootTransformNode = jsonHelper.getObjectMapper().valueToTree(transform); validateInputs(transform.getInputs()); validateReferences(transform, rootTransformNode); processValidationIssues(validationIssues); }
TransformValidator extends DataObjectValidator<TransformRequest, DataObjectRequest<TransformRequest>> { @Override public void validatePOST(DataObjectRequest<TransformRequest> request) { super.validatePOST(request); validationIssues = new LinkedList<>(); TransformRequest transform = request.getDataObject(); JsonNode rootTransformNode = jsonHelper.getObjectMapper().valueToTree(transform); validateInputs(transform.getInputs()); validateReferences(transform, rootTransformNode); processValidationIssues(validationIssues); } }
TransformValidator extends DataObjectValidator<TransformRequest, DataObjectRequest<TransformRequest>> { @Override public void validatePOST(DataObjectRequest<TransformRequest> request) { super.validatePOST(request); validationIssues = new LinkedList<>(); TransformRequest transform = request.getDataObject(); JsonNode rootTransformNode = jsonHelper.getObjectMapper().valueToTree(transform); validateInputs(transform.getInputs()); validateReferences(transform, rootTransformNode); processValidationIssues(validationIssues); }  }
TransformValidator extends DataObjectValidator<TransformRequest, DataObjectRequest<TransformRequest>> { @Override public void validatePOST(DataObjectRequest<TransformRequest> request) { super.validatePOST(request); validationIssues = new LinkedList<>(); TransformRequest transform = request.getDataObject(); JsonNode rootTransformNode = jsonHelper.getObjectMapper().valueToTree(transform); validateInputs(transform.getInputs()); validateReferences(transform, rootTransformNode); processValidationIssues(validationIssues); }  @Override void validatePOST(DataObjectRequest<TransformRequest> request); void setJsonHelper(JsonHelper jsonHelper); }
TransformValidator extends DataObjectValidator<TransformRequest, DataObjectRequest<TransformRequest>> { @Override public void validatePOST(DataObjectRequest<TransformRequest> request) { super.validatePOST(request); validationIssues = new LinkedList<>(); TransformRequest transform = request.getDataObject(); JsonNode rootTransformNode = jsonHelper.getObjectMapper().valueToTree(transform); validateInputs(transform.getInputs()); validateReferences(transform, rootTransformNode); processValidationIssues(validationIssues); }  @Override void validatePOST(DataObjectRequest<TransformRequest> request); void setJsonHelper(JsonHelper jsonHelper);  }