Skip to content

Commit 8031aaa

Browse files
authored
Add jre range annotation to oauth2 test cases which need jdk17+ (#15485)
1 parent e4c8fe9 commit 8031aaa

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

dubbo-plugin/dubbo-spring-security/src/test/java/org/apache/dubbo/spring/security/jackson/ObjectMapperCodecTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
import org.junit.jupiter.api.Assertions;
2424
import org.junit.jupiter.api.Test;
25+
import org.junit.jupiter.api.condition.EnabledForJreRange;
26+
import org.junit.jupiter.api.condition.JRE;
2527
import org.springframework.security.core.authority.SimpleGrantedAuthority;
2628
import org.springframework.security.oauth2.client.OAuth2AuthorizedClient;
2729
import org.springframework.security.oauth2.client.registration.ClientRegistration;
@@ -39,7 +41,7 @@
3941

4042
public 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

Comments
 (0)