public void testAssertionWithSubjectAndAttributes() throws Exception {
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
InputStream configStream = tcl.getResourceAsStream("parser/saml2/saml2-response-assertion-subject.xml");
SAMLParser parser = new SAMLParser();
ResponseType response = (ResponseType) parser.parse(configStream);
assertNotNull(response);
assertEquals("ID_45df1ea5-81e4-4147-a39a-43a4ef613f4e", response.getID());
assertEquals(XMLTimeUtil.parse("2010-11-04T00:19:16.847-05:00"), response.getIssueInstant());
assertEquals("2.0", response.getVersion());
assertEquals("http://localhost:8080/employee/", response.getDestination());
assertEquals("ID_04ded476-d73c-48af-b3a9-232a52905ffb", response.getInResponseTo());
// Issuer
assertEquals("http://localhost:8080/idp/", response.getIssuer().getValue());
// Status
StatusType status = response.getStatus();
assertEquals("urn:oasis:names:tc:SAML:2.0:status:Success", status.getStatusCode().getValue().toString());
// Get the assertion
AssertionType assertion = response.getAssertions().get(0).getAssertion();
assertEquals("ID_8be1534d-9155-4837-9f26-70ea2c15e327", assertion.getID());
assertEquals(XMLTimeUtil.parse("2010-11-04T00:19:16.842-05:00"), assertion.getIssueInstant());
assertEquals("2.0", assertion.getVersion());
assertEquals("http://localhost:8080/idp/", assertion.getIssuer().getValue());