@Test
void testParseWebXml() throws Exception {

    DefaultWebApplication webApplication = new DefaultWebApplication();
    webApplication.addResource(new DirectoryResource(new File("src/test/webxml/parse")));
    InputStream inputStream = webApplication.getResourceAsStream("WEB-INF/web.xml");
    WebXmlParser parser = new WebXmlParser();
    WebXml webXml = parser.parse(inputStream);
    assertFalse(webXml.getServlets().isEmpty());
    assertEquals(2, webXml.getServlets().size());
    assertNotEquals(webXml.getServlets().get(0).getServletName(), webXml.getServlets().get(1).getServletName());
    assertTrue(webXml.getServlets().get(0).isAsyncSupported());
    assertFalse(webXml.getServlets().get(1).isAsyncSupported());
    assertFalse(webXml.getFilters().isEmpty());
    assertEquals(1, webXml.getFilters().size());
    assertEquals("/defaultContextPath", webXml.getDefaultContextPath());
    assertTrue(webXml.getDenyUncoveredHttpMethods());
    assertEquals("myServletContextName", webXml.getDisplayName());
    assertTrue(webXml.isDistributable());
    assertEquals("UTF-8", webXml.getResponseCharacterEncoding());
}