From af433fdbdf22ffe0335c53dd7d39671ff25c17a4 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Fri, 17 Apr 2020 09:16:16 -0600 Subject: [PATCH] Polish OpenSamlAuthenticationProviderTests - Add missing assertion Issue gh-6019 --- .../OpenSamlAuthenticationProviderTests.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/provider/service/authentication/OpenSamlAuthenticationProviderTests.java b/saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/provider/service/authentication/OpenSamlAuthenticationProviderTests.java index f2be29b1e7..c97f6f6e8b 100644 --- a/saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/provider/service/authentication/OpenSamlAuthenticationProviderTests.java +++ b/saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/provider/service/authentication/OpenSamlAuthenticationProviderTests.java @@ -116,6 +116,13 @@ public class OpenSamlAuthenticationProviderTests { @Test public void authenticateWhenInvalidDestinationThenThrowAuthenticationException() { Response response = response(recipientUri + "invalid", idpEntityId); + Assertion assertion = defaultAssertion(); + signXmlObject( + assertion, + assertingPartyCredentials(), + recipientEntityId + ); + response.getAssertions().add(assertion); token = responseXml(response); exception.expect(authenticationMatcher(Saml2ErrorCodes.INVALID_DESTINATION)); provider.authenticate(token);