@@ -50,14 +50,12 @@ public void init() {
5050
5151 @ Test (expected = MissingRequiredAttributeException .class )
5252 public void testHttpParamsMissingIssuer () throws Exception {
53- ProviderInfoDiscovery service = new ProviderInfoDiscovery (serviceContext , null , null );
5453 service .getRequestParameters (new HashMap <String , Object >());
5554 }
5655
5756 @ Test
5857 public void testHttpParamsSuccessfulIssuer () throws Exception {
5958 serviceContext .setIssuer (issuer );
60- ProviderInfoDiscovery service = new ProviderInfoDiscovery (serviceContext , null , null );
6159 HttpArguments httpArguments = service .getRequestParameters (new HashMap <String , Object >());
6260 Assert .assertEquals ("https://www.example.com/.well-known/openid-configuration" ,
6361 httpArguments .getUrl ());
@@ -67,7 +65,6 @@ public void testHttpParamsSuccessfulIssuer() throws Exception {
6765 @ Test
6866 public void testHttpParamsSuccessFulIssuerTrailingSlash () throws Exception {
6967 serviceContext .setIssuer (issuer + "/" );
70- ProviderInfoDiscovery service = new ProviderInfoDiscovery (serviceContext , null , null );
7168 HttpArguments httpArguments = service .getRequestParameters (new HashMap <String , Object >());
7269 Assert .assertEquals ("https://www.example.com/.well-known/openid-configuration" ,
7370 httpArguments .getUrl ());
@@ -76,13 +73,18 @@ public void testHttpParamsSuccessFulIssuerTrailingSlash() throws Exception {
7673
7774 @ Test (expected = MissingRequiredAttributeException .class )
7875 public void testUpdateCtxMissingIssuer () throws Exception {
79- ProviderInfoDiscovery service = new ProviderInfoDiscovery (serviceContext , null , null );
8076 service .updateServiceContext (buildMinimalResponse (issuer ));
8177 }
8278
79+ @ Test (expected = InvalidClaimException .class )
80+ public void testUpdateCtxInvalidResponseContents () throws Exception {
81+ ASConfigurationResponse response = buildMinimalResponseWithEndpoints (issuer );
82+ response .addClaim ("revocation_endpoint" , Arrays .asList ("should" , "not" , "be" , "list" ));
83+ service .updateServiceContext (response );
84+ }
85+
8386 @ Test
8487 public void testUpdateCtxSuccess () throws Exception {
85- ProviderInfoDiscovery service = new ProviderInfoDiscovery (serviceContext , null , null );
8688 serviceContext .setIssuer (issuer );
8789 Assert .assertNull (service .getServiceContext ().getProviderConfigurationResponse ());
8890 service .updateServiceContext (buildMinimalResponse (issuer ));
@@ -96,7 +98,6 @@ public void testUpdateCtxSuccess() throws Exception {
9698
9799 @ Test
98100 public void testUpdateCtxSuccessMismatchAllowed () throws Exception {
99- ProviderInfoDiscovery service = new ProviderInfoDiscovery (serviceContext , null , null );
100101 serviceContext .setIssuer ("https://www.example.org" );
101102 Map <String , Boolean > allow = new HashMap <String , Boolean >();
102103 allow .put (Constants .ALLOW_PARAM_ISSUER_MISMATCH , Boolean .TRUE );
@@ -113,15 +114,13 @@ public void testUpdateCtxSuccessMismatchAllowed() throws Exception {
113114
114115 @ Test (expected = InvalidClaimException .class )
115116 public void testUpdateCtxFailedMismatch () throws Exception {
116- ProviderInfoDiscovery service = new ProviderInfoDiscovery (serviceContext , null , null );
117117 serviceContext .setIssuer ("https://www.example.org" );
118118 Assert .assertNull (service .getServiceContext ().getProviderConfigurationResponse ());
119119 service .updateServiceContext (buildMinimalResponse (issuer + "/" ));
120120 }
121121
122122 @ Test
123123 public void testUpdateCtxSuccessWithEndpoints () throws Exception {
124- ProviderInfoDiscovery service = new ProviderInfoDiscovery (serviceContext , null , null );
125124 serviceContext .setIssuer (issuer );
126125 Assert .assertNull (service .getServiceContext ().getProviderConfigurationResponse ());
127126 service .updateServiceContext (buildMinimalResponseWithEndpoints (issuer ));
0 commit comments