@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()); }
public Set<String> getDeclaredRoles() { return declaredRoles; }
WebApplicationDeclaredRoles { public Set<String> getDeclaredRoles() { return declaredRoles; } }
WebApplicationDeclaredRoles { public Set<String> getDeclaredRoles() { return declaredRoles; } WebApplicationDeclaredRoles(ServletContext servletContext); }
WebApplicationDeclaredRoles { public Set<String> getDeclaredRoles() { return declaredRoles; } WebApplicationDeclaredRoles(ServletContext servletContext); Set<String> getDeclaredRoles(); }
WebApplicationDeclaredRoles { public Set<String> getDeclaredRoles() { return declaredRoles; } WebApplicationDeclaredRoles(ServletContext servletContext); Set<String> getDeclaredRoles();  }