@@ -307,12 +307,10 @@ public void testMissingJwksUrl() throws Exception {
307307
308308 Subject subject = new Subject ();
309309 OAuth2LoginModule module = new OAuth2LoginModule ();
310- module .initialize (subject , new TokenCallbackHandler ("token" ), new HashMap <>(), options );
311-
312310 try {
313- module .login ( );
314- fail ("Should have thrown LoginException for missing JWKS URL" );
315- } catch (LoginException e ) {
311+ module .initialize ( subject , new TokenCallbackHandler ( "token" ), new HashMap <>(), options );
312+ fail ("Should have thrown IllegalArgumentException for missing JWKS URL" );
313+ } catch (IllegalArgumentException e ) {
316314 assertTrue ("Error should mention JWKS URL" , e .getMessage ().contains ("JWKS URL" ));
317315 }
318316 }
@@ -323,12 +321,10 @@ public void testMissingIssuer() throws Exception {
323321
324322 Subject subject = new Subject ();
325323 OAuth2LoginModule module = new OAuth2LoginModule ();
326- module .initialize (subject , new TokenCallbackHandler ("token" ), new HashMap <>(), options );
327-
328324 try {
329- module .login ( );
330- fail ("Should have thrown LoginException for missing issuer" );
331- } catch (LoginException e ) {
325+ module .initialize ( subject , new TokenCallbackHandler ( "token" ), new HashMap <>(), options );
326+ fail ("Should have thrown IllegalArgumentException for missing issuer" );
327+ } catch (IllegalArgumentException e ) {
332328 assertTrue ("Error should mention issuer" , e .getMessage ().contains ("issuer" ));
333329 }
334330 }
0 commit comments