ServletSecurityElement extends HttpConstraintElement { public Collection<HttpMethodConstraintElement> getHttpMethodConstraints() { return Collections.unmodifiableCollection(methodConstraints); } ServletSecurityElement();  ServletSecurityElement(HttpConstraintElement constraint);  ServletSecurityElement(Collection<HttpMethodConstraintElement> methodConstraints);  ServletSecurityElement(HttpConstraintElement constraint, Collection<HttpMethodConstraintElement> methodConstraints);  ServletSecurityElement(ServletSecurity annotation); Collection<HttpMethodConstraintElement> getHttpMethodConstraints(); Collection<String> getMethodNames();  }
@Test void testConstructor() { HttpConstraintElement httpConstraintElement = new HttpConstraintElement(ServletSecurity.EmptyRoleSemantic.PERMIT); ServletSecurityElement element = new ServletSecurityElement(httpConstraintElement); assertEquals(ServletSecurity.EmptyRoleSemantic.PERMIT, element.getEmptyRoleSemantic()); assertNotNull(element.getHttpMethodConstraints()); }
@Test void testConstructor2() { HttpConstraintElement httpConstraintElement = new HttpConstraintElement(ServletSecurity.EmptyRoleSemantic.PERMIT); ArrayList<HttpMethodConstraintElement> methodConstraints = new ArrayList<>(); methodConstraints.add(new HttpMethodConstraintElement("HEAD")); ServletSecurityElement element = new ServletSecurityElement(httpConstraintElement, methodConstraints); assertEquals(ServletSecurity.EmptyRoleSemantic.PERMIT, element.getEmptyRoleSemantic()); assertNotNull(element.getHttpMethodConstraints()); assertEquals("HEAD", element.getHttpMethodConstraints().iterator().next().getMethodName()); }
@Test void testGetHttpMethodConstraints() { ServletSecurityElement element = new ServletSecurityElement(); assertNotNull(element.getHttpMethodConstraints()); element = new ServletSecurityElement(new ArrayList<>()); assertNotNull(element.getHttpMethodConstraints()); }