diff --git a/openid-connect-client/src/test/java/org/mitre/openid/connect/client/service/impl/TestSignedAuthRequestUrlBuilder.java b/openid-connect-client/src/test/java/org/mitre/openid/connect/client/service/impl/TestSignedAuthRequestUrlBuilder.java index e1caa7838..b27e2b305 100644 --- a/openid-connect-client/src/test/java/org/mitre/openid/connect/client/service/impl/TestSignedAuthRequestUrlBuilder.java +++ b/openid-connect-client/src/test/java/org/mitre/openid/connect/client/service/impl/TestSignedAuthRequestUrlBuilder.java @@ -26,12 +26,11 @@ import java.util.Map; import org.apache.http.client.utils.URIBuilder; import org.junit.Before; import org.junit.Test; -import org.junit.runner.RunWith; import org.mitre.jwt.signer.service.impl.DefaultJwtSigningAndValidationService; import org.mitre.oauth2.model.RegisteredClient; import org.mitre.openid.connect.config.ServerConfiguration; import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; +import org.springframework.security.authentication.AuthenticationServiceException; import com.google.common.base.Joiner; import com.google.common.collect.Maps; @@ -140,5 +139,13 @@ public class TestSignedAuthRequestUrlBuilder { assertEquals(expected, actual); } + + @Test(expected = AuthenticationServiceException.class) + public void buildAuthRequestUrl_badUri() { + + Mockito.when(serverConfig.getAuthorizationEndpointUri()).thenReturn("e=mc^2"); + + urlBuilder.buildAuthRequestUrl(serverConfig, clientConfig, "example.com", "", ""); + } }