for (Object descriptorType : descriptors) {
if (!(descriptorType instanceof EntityDescriptorType)) {
fail("Wrong type: " + descriptorType.getClass());
}
EntityDescriptorType entDescriptorType = (EntityDescriptorType)descriptorType;
if ("https://saml.salesforce.com".equals(entDescriptorType.getEntityID())) {
SPSSODescriptorType spDescriptor = CoreConfigUtil.getSPDescriptor(entDescriptorType);
assertTrue(spDescriptor.isAuthnRequestsSigned());
List<EndpointType> logoutEndpoints = spDescriptor.getSingleLogoutService();
assertNotNull(logoutEndpoints);
assertEquals(logoutEndpoints.size(), 1);
EndpointType endpoint = logoutEndpoints.get(0);
assertEquals("https://login.salesforce.com/saml/logout-request.jsp?saml=MgoTx78aEPkEM4eGV5ZzptlliwIVkRkOWYKlqXQq2StV_sLo0EiRqKYtIc",
endpoint.getLocation().toASCIIString());
assertEquals("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", endpoint.getBinding().toASCIIString());
}
else if ("google.com/a/somedomain.com".equals(entDescriptorType.getEntityID())) {
SPSSODescriptorType spDescriptor = CoreConfigUtil.getSPDescriptor(entDescriptorType);
assertFalse(spDescriptor.isAuthnRequestsSigned());
List<EndpointType> logoutEndpoints = spDescriptor.getSingleLogoutService();
assertNotNull(logoutEndpoints);
assertEquals(logoutEndpoints.size(), 0);
}
else {
fail("Wrong entityID: " + entDescriptorType.getEntityID());
}
}
}