@Test
public void parsesRolesFromWebXml() {

    ServletContext servletContext = mock(ServletContext.class);
    when(servletContext.getResourceAsStream("/WEB-INF/web.xml")).thenReturn(new ByteArrayInputStream(webXmlWithRoles.getBytes()));
    WebApplicationDeclaredRoles webApplicationDeclaredRoles = new WebApplicationDeclaredRoles(servletContext);
    assertEquals(new HashSet<>(Arrays.asList("user", "admin")), webApplicationDeclaredRoles.getDeclaredRoles());
}