question: public void testMergeOneFilterWithOneMappingIntoEmptyDocument ( ) throws Exception { String srcXml = "<web-app></web-app>" ; WebXml srcWebXml = WebXmlIo . parseWebXml ( new ByteArrayInputStream ( srcXml . getBytes ( "UTF-8" ) ) , null ) ; String mergeXml = "<web-app>" + "  <filter>" + "    <filter-name>f1</filter-name>" + "    <filter-class>fclass1</filter-class>" + "  </filter>" + "  <filter-mapping>" + "    <filter-name>f1</filter-name>" + "    <url-pattern>/f1mapping1</url-pattern>" + "  </filter-mapping>" + "</web-app>" ; WebXml mergeWebXml = WebXmlIo . parseWebXml ( new ByteArrayInputStream ( mergeXml . getBytes ( "UTF-8" ) ) , null ) ; WebXmlMerger merger = new WebXmlMerger ( srcWebXml ) ; merger . mergeFilters ( mergeWebXml ) ; assertTrue ( WebXmlUtils . hasFilter ( srcWebXml , "f1" ) ) ; List < String > filterMappings = WebXmlUtils . getFilterMappings ( srcWebXml , "f1" ) ; assertEquals ( 1 , filterMappings . size ( ) ) ; assertEquals ( "/f1mapping1" , filterMappings . get ( 0 ) ) ; }
target:  Tests whether a filter with one mapping is correctly merged into an empty descriptor.