2222
2323import org .junit .jupiter .api .Assertions ;
2424import org .junit .jupiter .api .Test ;
25+ import org .junit .jupiter .api .condition .EnabledForJreRange ;
26+ import org .junit .jupiter .api .condition .JRE ;
2527import org .springframework .security .core .authority .SimpleGrantedAuthority ;
2628import org .springframework .security .oauth2 .client .OAuth2AuthorizedClient ;
2729import org .springframework .security .oauth2 .client .registration .ClientRegistration ;
3941
4042public class ObjectMapperCodecTest {
4143
42- private ObjectMapperCodec mapper = new ObjectMapperCodec ();
44+ private final ObjectMapperCodec mapper = new ObjectMapperCodec ();
4345
4446 @ Test
4547 public void testOAuth2AuthorizedClientCodec () {
@@ -54,6 +56,7 @@ public void testOAuth2AuthorizedClientCodec() {
5456 Assertions .assertNotNull (deserialize );
5557 }
5658
59+ @ EnabledForJreRange (min = JRE .JAVA_17 )
5760 @ Test
5861 public void bearerTokenAuthenticationTest () {
5962 BearerTokenAuthentication bearerTokenAuthentication = new BearerTokenAuthentication (
@@ -70,6 +73,7 @@ public void bearerTokenAuthenticationTest() {
7073 Assertions .assertNotNull (deserialize );
7174 }
7275
76+ @ EnabledForJreRange (min = JRE .JAVA_17 )
7377 @ Test
7478 public void oAuth2ClientAuthenticationTokenTest () {
7579 OAuth2ClientAuthenticationToken oAuth2ClientAuthenticationToken = new OAuth2ClientAuthenticationToken (
@@ -83,6 +87,7 @@ public void oAuth2ClientAuthenticationTokenTest() {
8387 Assertions .assertNotNull (deserialize );
8488 }
8589
90+ @ EnabledForJreRange (min = JRE .JAVA_17 )
8691 @ Test
8792 public void registeredClientTest () {
8893 RegisteredClient registeredClient = RegisteredClient .withId ("id" )
0 commit comments