Browse Source

Polish OpenSamlAuthenticationProviderTests

- Add missing assertion

Issue gh-6019
pull/8724/head
Josh Cummings 6 years ago
parent
commit
af433fdbdf
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
  1. 7
      saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/provider/service/authentication/OpenSamlAuthenticationProviderTests.java

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

@ -116,6 +116,13 @@ public class OpenSamlAuthenticationProviderTests { @@ -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);

Loading…
Cancel
Save