|
60 | 60 | */ |
61 | 61 | class RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandlerTests { |
62 | 62 |
|
| 63 | + @Test |
| 64 | + void setServerSecurityContextRepositoryWhenNullThenException() { |
| 65 | + assertThatException() |
| 66 | + .isThrownBy(() -> new RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler() |
| 67 | + .setServerSecurityContextRepository(null)) |
| 68 | + .withMessage("serverSecurityContextRepository cannot be null"); |
| 69 | + } |
| 70 | + |
| 71 | + @Test |
| 72 | + void setJwtDecoderFactoryWhenNullThenException() { |
| 73 | + assertThatException() |
| 74 | + .isThrownBy(() -> new RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler().setJwtDecoderFactory(null)) |
| 75 | + .withMessage("jwtDecoderFactory cannot be null"); |
| 76 | + } |
| 77 | + |
| 78 | + @Test |
| 79 | + void setAuthoritiesMapperWhenNullThenException() { |
| 80 | + assertThatException() |
| 81 | + .isThrownBy(() -> new RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler().setAuthoritiesMapper(null)) |
| 82 | + .withMessage("authoritiesMapper cannot be null"); |
| 83 | + } |
| 84 | + |
| 85 | + @Test |
| 86 | + void setUserServiceWhenNullThenException() { |
| 87 | + assertThatException() |
| 88 | + .isThrownBy(() -> new RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler().setUserService(null)) |
| 89 | + .withMessage("userService cannot be null"); |
| 90 | + } |
| 91 | + |
| 92 | + @Test |
| 93 | + void setClockSkewWhenNullThenException() { |
| 94 | + assertThatException() |
| 95 | + .isThrownBy(() -> new RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler().setClockSkew(null)) |
| 96 | + .withMessage("clockSkew cannot be null"); |
| 97 | + } |
| 98 | + |
63 | 99 | @Test |
64 | 100 | void onAuthorizationSuccessWhenIdTokenValidThenSecurityContextRefreshed() { |
65 | 101 | ClientRegistration clientRegistration = TestClientRegistrations.clientRegistration().build(); |
@@ -352,42 +388,6 @@ void onAuthorizationSuccessWhenIdTokenNonceNotSameThenException() { |
352 | 388 | .verifyErrorMessage("[invalid_nonce] Invalid nonce"); |
353 | 389 | } |
354 | 390 |
|
355 | | - @Test |
356 | | - void setServerSecurityContextRepositoryWhenNullThenException() { |
357 | | - assertThatException() |
358 | | - .isThrownBy(() -> new RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler() |
359 | | - .setServerSecurityContextRepository(null)) |
360 | | - .withMessage("serverSecurityContextRepository cannot be null"); |
361 | | - } |
362 | | - |
363 | | - @Test |
364 | | - void setJwtDecoderFactoryWhenNullThenException() { |
365 | | - assertThatException() |
366 | | - .isThrownBy(() -> new RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler().setJwtDecoderFactory(null)) |
367 | | - .withMessage("jwtDecoderFactory cannot be null"); |
368 | | - } |
369 | | - |
370 | | - @Test |
371 | | - void setAuthoritiesMapperWhenNullThenException() { |
372 | | - assertThatException() |
373 | | - .isThrownBy(() -> new RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler().setAuthoritiesMapper(null)) |
374 | | - .withMessage("authoritiesMapper cannot be null"); |
375 | | - } |
376 | | - |
377 | | - @Test |
378 | | - void setUserServiceWhenNullThenException() { |
379 | | - assertThatException() |
380 | | - .isThrownBy(() -> new RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler().setUserService(null)) |
381 | | - .withMessage("userService cannot be null"); |
382 | | - } |
383 | | - |
384 | | - @Test |
385 | | - void setClockSkewWhenNullThenException() { |
386 | | - assertThatException() |
387 | | - .isThrownBy(() -> new RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler().setClockSkew(null)) |
388 | | - .withMessage("clockSkew cannot be null"); |
389 | | - } |
390 | | - |
391 | 391 | private static OAuth2AccessToken createAccessToken() { |
392 | 392 | Instant issuedAt = Instant.now().minus(Duration.ofDays(1)); |
393 | 393 | Instant expiresAt = issuedAt.plus(Duration.ofMinutes(60)); |
|
0 commit comments