Java Code Examples for org.springframework.test.util.XmlExpectationsHelper

Following code examples demonstrate how to use org.springframework.test.util.XmlExpectationsHelperfrom spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.test.util.XmlExpectationsHelperand various code implementation of this class.

    public void testFromXml() throws Exception {
        FileInfo fileInfo = createFileInfo();
        String xml = new FileInfoXmlProvider().toXml(fileInfo);
        String expected = ResourceUtils.getResourceAsString("/artifactory-file.xml");
        new XmlExpectationsHelper().assertXmlEqual(expected, xml);
    } 


    public void deveReceberUrlDeXmlERetornarConteudoDeXml() throws Exception {
        String xml = new ImportarXmlController().editar(valido.toUri().toString());
        new XmlExpectationsHelper().assertXmlEqual("<servico><nome>Carta A</nome></servico>", xml);
    } 

Advertisement
Javadoc
A helper class for assertions on XML content. @author Rossen Stoyanchev @since 3.2
Advertisement