### Question:
WsdlContentValidator extends XmlContentValidator { @Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try (InputStream stream = artifactContent.stream()) { Document wsdlDoc = DocumentBuilderAccessor.getDocumentBuilder().parse(stream); if (level == ValidityLevel.FULL) { WSDLReaderAccessor.getWSDLReader().readWSDL(null, wsdlDoc); } } catch (Exception e) { throw new InvalidContentException("Syntax violation for WSDL Schema artifact.", e); } } } WsdlContentValidator(); @Override void validate(ValidityLevel level, ContentHandle artifactContent);  }### Answer:
@Test public void testValidSyntax() throws Exception { ContentHandle contentA = resourceToContentHandle("wsdl-valid.wsdl"); WsdlContentValidator validator = new WsdlContentValidator(); validator.validate(ValidityLevel.SYNTAX_ONLY, contentA); ContentHandle contentB = resourceToContentHandle("wsdl-invalid-semantics.wsdl"); validator.validate(ValidityLevel.SYNTAX_ONLY, contentB); }
@Test public void testinValidSyntax() throws Exception { ContentHandle content = resourceToContentHandle("wsdl-invalid-syntax.wsdl"); WsdlContentValidator validator = new WsdlContentValidator(); Assertions.assertThrows(InvalidContentException.class, () -> { validator.validate(ValidityLevel.SYNTAX_ONLY, content); }); }
@Test public void testValidSemantics() throws Exception { ContentHandle content = resourceToContentHandle("wsdl-valid.wsdl"); WsdlContentValidator validator = new WsdlContentValidator(); validator.validate(ValidityLevel.FULL, content); }
@Test public void testinValidSemantics() throws Exception { ContentHandle content = resourceToContentHandle("wsdl-invalid-semantics.wsdl"); WsdlContentValidator validator = new WsdlContentValidator(); Assertions.assertThrows(InvalidContentException.class, () -> { validator.validate(ValidityLevel.FULL, content); }); }