Skip to content

Commit 067cb45

Browse files
committed
Polish OpenSamlAuthenticationProviderTests
- Add missing assertion Issue gh-6019
1 parent 7b34b22 commit 067cb45

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/provider/service/authentication/OpenSamlAuthenticationProviderTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ public void authenticateWhenXmlErrorThenThrowAuthenticationException() {
116116
@Test
117117
public void authenticateWhenInvalidDestinationThenThrowAuthenticationException() {
118118
Response response = response(recipientUri + "invalid", idpEntityId);
119+
Assertion assertion = defaultAssertion();
120+
signXmlObject(
121+
assertion,
122+
assertingPartyCredentials(),
123+
recipientEntityId
124+
);
125+
response.getAssertions().add(assertion);
119126
token = responseXml(response, idpEntityId);
120127
exception.expect(authenticationMatcher(Saml2ErrorCodes.INVALID_DESTINATION));
121128
provider.authenticate(token);

0 commit comments

Comments
 (0)