{
WebMetaData webApp = unmarshal();
List<SecurityConstraintMetaData> scs = webApp.getSecurityContraints();
assertEquals(8, scs.size());
// SC1
SecurityConstraintMetaData sc1 = scs.get(0);
WebResourceCollectionsMetaData sc1WRC = sc1.getResourceCollections();
assertEquals(2, sc1WRC.size());
WebResourceCollectionMetaData sc1WRC1 = sc1WRC.get(0);
assertEquals(Collections.emptyList(), sc1WRC1.getHttpMethods());
List<String> sc1WRC1URLs = sc1WRC1.getUrlPatterns();
assertEquals(4, sc1WRC1URLs.size());
assertEquals("/excluded/*", sc1WRC1URLs.get(0));
assertEquals("/restricted/get-only/excluded/*", sc1WRC1URLs.get(1));
assertEquals("/restricted/post-only/excluded/*", sc1WRC1URLs.get(2));
assertEquals("/restricted/any/excluded/*", sc1WRC1URLs.get(3));
WebResourceCollectionMetaData sc1WRC2 = sc1WRC.get(1);
List<String> sc1WRC2URLs = sc1WRC2.getUrlPatterns();
assertEquals(1, sc1WRC2URLs.size());
assertEquals("/restricted/*", sc1WRC2URLs.get(0));
List<String> sc1WRC2Http = sc1WRC2.getHttpMethods();
ArrayList<String> sc1WRC2HttpExpected = new ArrayList<String>();
sc1WRC2HttpExpected.add("DELETE");
sc1WRC2HttpExpected.add("PUT");
sc1WRC2HttpExpected.add("HEAD");
sc1WRC2HttpExpected.add("OPTIONS");
sc1WRC2HttpExpected.add("TRACE");
sc1WRC2HttpExpected.add("GET");
sc1WRC2HttpExpected.add("POST");
assertEquals(sc1WRC2HttpExpected, sc1WRC2Http);
AuthConstraintMetaData sc1AC = sc1.getAuthConstraint();
List<String> sc1Roles = sc1AC.getRoleNames();
assertEquals(null, sc1Roles);
TransportGuaranteeType sc1TG = sc1.getTransportGuarantee();
assertEquals(TransportGuaranteeType.NONE, sc1TG);
sc1Roles = sc1.getRoleNames();
assertEquals(0, sc1Roles.size());
assertTrue(sc1.isExcluded());
assertFalse(sc1.isUnchecked());
// SC2
SecurityConstraintMetaData sc2 = scs.get(1);
// SC8
SecurityConstraintMetaData sc8 = scs.get(7);
AuthConstraintMetaData sc8AC = sc8.getAuthConstraint();
assertEquals(null, sc8AC);
WebResourceCollectionMetaData sc8ACWRC = sc8.getResourceCollections().get(0);
assertEquals("/restricted/not/*", sc8ACWRC.getUrlPatterns().get(0));
assertFalse(sc8.isExcluded());
assertTrue(sc8.isUnchecked());
}