16
16
17
17
package org .springframework .security .saml2 .provider .service .web .authentication ;
18
18
19
- import org .junit .Before ;
20
- import org .junit .Test ;
19
+ import org .junit .jupiter . api . BeforeEach ;
20
+ import org .junit .jupiter . api . Test ;
21
21
import org .opensaml .xmlsec .signature .support .SignatureConstants ;
22
22
23
23
import org .springframework .mock .web .MockHttpServletRequest ;
@@ -40,7 +40,7 @@ public class OpenSamlAuthenticationRequestResolverTests {
40
40
41
41
private RelyingPartyRegistration .Builder relyingPartyRegistrationBuilder ;
42
42
43
- @ Before
43
+ @ BeforeEach
44
44
public void setUp () {
45
45
this .relyingPartyRegistrationBuilder = TestRelyingPartyRegistrations .relyingPartyRegistration ();
46
46
}
@@ -102,7 +102,9 @@ public void resolveAuthenticationRequestWhenSignedThenCredentialIsRequired() {
102
102
.assertingPartyDetails ((party ) -> party .verificationX509Credentials ((c ) -> c .add (credential )))
103
103
.build ();
104
104
OpenSamlAuthenticationRequestResolver resolver = authenticationRequestResolver (registration );
105
- assertThatExceptionOfType (Saml2Exception .class ).isThrownBy (() -> resolver .resolve (request , null ));
105
+ assertThatExceptionOfType (Saml2Exception .class )
106
+ .isThrownBy (() -> resolver .resolve (request , (r , authnRequest ) -> {
107
+ }));
106
108
}
107
109
108
110
@ Test
@@ -161,7 +163,8 @@ public void resolveAuthenticationRequestWhenSHA1SignRequestThenSigns() {
161
163
(party ) -> party .signingAlgorithms ((algs ) -> algs .add (SignatureConstants .ALGO_ID_SIGNATURE_RSA_SHA1 )))
162
164
.build ();
163
165
OpenSamlAuthenticationRequestResolver resolver = authenticationRequestResolver (registration );
164
- Saml2RedirectAuthenticationRequest result = resolver .resolve (request , null );
166
+ Saml2RedirectAuthenticationRequest result = resolver .resolve (request , (r , authnRequest ) -> {
167
+ });
165
168
assertThat (result .getSamlRequest ()).isNotEmpty ();
166
169
assertThat (result .getRelayState ()).isNotNull ();
167
170
assertThat (result .getSigAlg ()).isEqualTo (SignatureConstants .ALGO_ID_SIGNATURE_RSA_SHA1 );
0 commit comments