@@ -41,10 +41,11 @@ public void shouldReturnAuthnContextFromAssertionAsAttribute() throws Exception
4141
4242 ResponseDocument respDoc = ResponseDocument .Factory .parse (
4343 new File ("src/test/resources/responseDocSigned.xml" ));
44- List <AssertionDocument > authnAssertions = SAMLUtils .extractAllAssertions (
45- respDoc .getResponse (), null ).stream ()
46- .filter (a -> a .getAssertion ().getAuthnStatementArray ().length > 0 )
47- .collect (Collectors .toList ());
44+ List <AssertionDocument > authnAssertions =
45+ SAMLUtils .extractAllAssertions (respDoc .getResponse (), null ).stream ()
46+ .map (wrap -> wrap .xmlBean )
47+ .filter (a -> a .getAssertion ().getAuthnStatementArray ().length > 0 )
48+ .collect (Collectors .toList ());
4849
4950 SSOAuthnResponseValidator validator = mock (SSOAuthnResponseValidator .class );
5051 when (validator .getAuthNAssertions ()).thenReturn (authnAssertions );
@@ -55,7 +56,7 @@ public void shouldReturnAuthnContextFromAssertionAsAttribute() throws Exception
5556 RemoteAttribute authnCtxAttr = authnInput .getAttributes ().get (AUTHN_CONTEXT_CLASS_REF_ATTR );
5657 assertThat (authnCtxAttr ).isNotNull ();
5758 assertThat (authnCtxAttr .getValues ().isEmpty ()).isFalse ();
58- assertThat (authnInput .getAttributes ().get (AUTHN_CONTEXT_CLASS_REF_ATTR ).getValues ().get ( 0 )).
59+ assertThat (authnInput .getAttributes ().get (AUTHN_CONTEXT_CLASS_REF_ATTR ).getValues ().getFirst ( )).
5960 isEqualTo ("urn:oasis:names:tc:SAML:2.0:ac:classes:Password" );
6061
6162 }
@@ -70,10 +71,11 @@ public void shouldReturnAuthnContextFromAssertionAsRemoteMetaContext() throws Ex
7071
7172 ResponseDocument respDoc = ResponseDocument .Factory .parse (
7273 new File ("src/test/resources/responseDocSigned.xml" ));
73- List <AssertionDocument > authnAssertions = SAMLUtils .extractAllAssertions (
74- respDoc .getResponse (), null ).stream ()
75- .filter (a -> a .getAssertion ().getAuthnStatementArray ().length > 0 )
76- .collect (Collectors .toList ());
74+ List <AssertionDocument > authnAssertions =
75+ SAMLUtils .extractAllAssertions (respDoc .getResponse (), null ).stream ()
76+ .map (wrap -> wrap .xmlBean )
77+ .filter (a -> a .getAssertion ().getAuthnStatementArray ().length > 0 )
78+ .collect (Collectors .toList ());
7779
7880 SSOAuthnResponseValidator validator = mock (SSOAuthnResponseValidator .class );
7981 when (validator .getAuthNAssertions ()).thenReturn (authnAssertions );
@@ -84,7 +86,7 @@ public void shouldReturnAuthnContextFromAssertionAsRemoteMetaContext() throws Ex
8486 RemoteAuthnMetadata remoteAuthnMeta = authnInput .getRemoteAuthnMetadata ();
8587 assertThat (remoteAuthnMeta ).isNotNull ();
8688 assertThat (remoteAuthnMeta .classReferences ().isEmpty ()).isFalse ();
87- assertThat (remoteAuthnMeta .classReferences ().get ( 0 )).
89+ assertThat (remoteAuthnMeta .classReferences ().getFirst ( )).
8890 isEqualTo ("urn:oasis:names:tc:SAML:2.0:ac:classes:Password" );
8991 assertThat (remoteAuthnMeta .protocol ()).isEqualTo (Protocol .SAML );
9092 assertThat (remoteAuthnMeta .remoteIdPId ()).isEqualTo ("http://centos6-unity1:8080/simplesaml/saml2/idp/metadata.php" );
@@ -101,8 +103,8 @@ public void shouldSaveAuthenticationTimeInAuthInput() throws Exception
101103 ResponseDocument respDoc = ResponseDocument .Factory .parse (new File ("src/test/resources/responseDocSigned.xml" ));
102104 List <AssertionDocument > authnAssertions = SAMLUtils .extractAllAssertions (respDoc .getResponse (), null )
103105 .stream ()
104- .filter ( a -> a . getAssertion ( )
105- .getAuthnStatementArray ().length > 0 )
106+ .map ( wrap -> wrap . xmlBean )
107+ . filter ( a -> a . getAssertion () .getAuthnStatementArray ().length > 0 )
106108 .collect (Collectors .toList ());
107109
108110 SSOAuthnResponseValidator validator = mock (SSOAuthnResponseValidator .class );
0 commit comments