Skip to content

Commit d81e6f4

Browse files
Add missing SAMLResponse to unit test
Related gh-18469 Signed-off-by: Tran Ngoc Nhan <[email protected]>
1 parent 4602797 commit d81e6f4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurerTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,9 @@ public void saml2LogoutRequestWhenCustomLogoutRequestHandlerThenUses() throws Ex
409409
logoutRequest.setIssueInstant(Instant.now());
410410
given(getBean(Saml2LogoutRequestValidator.class).validate(any()))
411411
.willReturn(Saml2LogoutValidatorResult.success());
412-
Saml2LogoutResponse logoutResponse = Saml2LogoutResponse.withRelyingPartyRegistration(registration).build();
412+
Saml2LogoutResponse logoutResponse = Saml2LogoutResponse.withRelyingPartyRegistration(registration)
413+
.samlResponse("response")
414+
.build();
413415
given(getBean(Saml2LogoutResponseResolver.class).resolve(any(), any())).willReturn(logoutResponse);
414416
this.mvc.perform(post("/logout/saml2/slo").param("SAMLRequest", "samlRequest").with(authentication(this.user)))
415417
.andReturn();

config/src/test/java/org/springframework/security/config/http/Saml2LogoutBeanDefinitionParserTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ public void saml2LogoutRequestWhenCustomLogoutRequestHandlerThenUses() throws Ex
306306
logoutRequest.setIssueInstant(Instant.now());
307307
given(getBean(Saml2LogoutRequestValidator.class).validate(any()))
308308
.willReturn(Saml2LogoutValidatorResult.success());
309-
Saml2LogoutResponse logoutResponse = Saml2LogoutResponse.withRelyingPartyRegistration(registration).build();
309+
Saml2LogoutResponse logoutResponse = Saml2LogoutResponse.withRelyingPartyRegistration(registration)
310+
.samlResponse("response")
311+
.build();
310312
given(getBean(Saml2LogoutResponseResolver.class).resolve(any(), any())).willReturn(logoutResponse);
311313
this.mvc
312314
.perform(post("/logout/saml2/slo").param("SAMLRequest", "samlRequest").with(authentication(this.saml2User)))

0 commit comments

Comments
 (0)