### Question:
Oas3Validator { public static ApiValidationResults validate(String apiSpecPath) throws ResolutionException { if (apiSpecPath == null) { throw new IllegalArgumentException("API definition document path is required"); } File apiSpecFile = new File(apiSpecPath); String apiSpecFilePath = apiSpecFile.getAbsolutePath(); System.out.println(System.lineSeparator() + "Validating API specification: " + apiSpecFilePath); ApiValidationResult specValidationResult = validateOpenApiSpec(apiSpecFile); ApiValidationResult styleValidationResult = validateOpenApiSpecStyle(apiSpecFilePath); boolean isSuccess = specValidationResult.isSuccess() && styleValidationResult.isSuccess(); System.out.println("Validating API specification: " + apiSpecFilePath + " -> " + (isSuccess ? "SUCCESS" : "FAILED")); printValidationResults(specValidationResult); printValidationResults(styleValidationResult); ApiValidationResults apiValidationResults = new ApiValidationResults(); apiValidationResults.setApiDefinitionPath(apiSpecPath); apiValidationResults.setSpecificationValidationResult(specValidationResult); apiValidationResults.setStyleValidationResult(styleValidationResult); return apiValidationResults; } private  Oas3Validator(); static ApiValidationResults validate(String apiSpecPath);  }### Answer:
@Test(expected = ResolutionException.class) public void validateApiSpecNotFound() throws ResolutionException { Oas3Validator.validate("src/test/resources/not-found.yaml"); }
@Test public void validateApiSpecSuccess() throws Exception { ApiValidationResults results = Oas3Validator.validate("src/test/resources/petstore-validation-success.yaml"); assertTrue(results.getSpecificationValidationResult().isSuccess()); assertTrue(results.getStyleValidationResult().isSuccess()); }
@Test public void validateApiSpecFail() throws Exception { ApiValidationResults results = Oas3Validator.validate("src/test/resources/petstore-validation-fail.yaml"); assertFalse(results.getSpecificationValidationResult().isSuccess()); assertTrue(results.getStyleValidationResult().isSuccess()); }
@Test public void validateApiSpecStyleFail() throws Exception { ApiValidationResults results = Oas3Validator.validate("src/test/resources/petstore-validation-style-fail.yaml"); assertTrue(results.getSpecificationValidationResult().isSuccess()); assertFalse(results.getStyleValidationResult().isSuccess()); }