WebXmlIntegrator implements Integrator { Node createFilterMappingNode(Document doc) { Node filterMappingNode = doc.createElement("filter-mapping"); Node filterNameNode = doc.createElement("filter-name"); filterNameNode.appendChild(doc.createTextNode("infrared")); Node urlPatternNode = doc.createElement("url-pattern"); urlPatternNode.appendChild(doc.createTextNode("/*")); filterMappingNode.appendChild(filterNameNode); filterMappingNode.appendChild(urlPatternNode); return filterMappingNode; } WebXmlIntegrator();  WebXmlIntegrator(File webapp); void integrate(ArchiveType type); static final String FILTER_CLASS; static final String LISTENER_CLASS; }
@Test public void testCreateFilterMappingNode() throws Exception { WebXmlIntegrator web = new WebXmlIntegrator(); Document doc = createEmptyDocument(); Node n = web.createFilterMappingNode(doc); doc.appendChild(n); String expected = "<filter-mapping><filter-name>infrared</filter-name><url-pattern>/*</url-pattern>" + "</filter-mapping>"; Document expDoc = XMLUnit.buildControlDocument(expected); assertXMLEqual(expDoc,doc); }