From 79961e7b31109812ad8d558f57079c556723c8bb Mon Sep 17 00:00:00 2001 From: Marvin Froeder Date: Thu, 14 Oct 2021 11:12:30 +1300 Subject: [PATCH] Get build compatible with jdk 16 --- apt-test-generator/pom.xml | 25 +++++++++++++++++-- json/pom.xml | 3 +-- .../test/java/feign/json/JsonDecoderTest.java | 21 +++++++++------- pom.xml | 13 +++++++--- reactive/pom.xml | 3 +-- .../ReactiveFeignIntegrationTest.java | 6 ++--- .../ReactiveInvocationHandlerTest.java | 20 +++++++-------- 7 files changed, 59 insertions(+), 32 deletions(-) diff --git a/apt-test-generator/pom.xml b/apt-test-generator/pom.xml index 05243f530f..10648dfc1a 100644 --- a/apt-test-generator/pom.xml +++ b/apt-test-generator/pom.xml @@ -36,7 +36,7 @@ com.github.jknack handlebars - 4.1.2 + 4.3.0 @@ -48,9 +48,16 @@ com.google.testing.compile compile-testing - 0.18 + 0.19 test + + org.slf4j + slf4j-jdk14 + 1.7.25 + test + + com.google.guava guava @@ -171,4 +178,18 @@ + + + + active-on-jdk-9 + + [9,) + + + + 3.0.0-M5 + --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + + + diff --git a/json/pom.xml b/json/pom.xml index d135891233..beea4d8088 100644 --- a/json/pom.xml +++ b/json/pom.xml @@ -29,7 +29,6 @@ ${project.basedir}/.. - 1.10.19 @@ -48,7 +47,7 @@ org.mockito - mockito-all + mockito-core ${mockito.version} test diff --git a/json/src/test/java/feign/json/JsonDecoderTest.java b/json/src/test/java/feign/json/JsonDecoderTest.java index a90a0062f5..05eb7ead0c 100644 --- a/json/src/test/java/feign/json/JsonDecoderTest.java +++ b/json/src/test/java/feign/json/JsonDecoderTest.java @@ -13,23 +13,26 @@ */ package feign.json; +import static feign.Util.UTF_8; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import feign.Request; import feign.Response; import feign.codec.DecodeException; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.Date; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.junit.BeforeClass; import org.junit.Test; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Collections; -import java.util.Date; -import static feign.Util.UTF_8; -import static org.junit.Assert.*; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; public class JsonDecoderTest { diff --git a/pom.xml b/pom.xml index 7c979e08af..ffb36fac46 100644 --- a/pom.xml +++ b/pom.xml @@ -69,8 +69,8 @@ java18 - 1.8 - 1.8 + ${main.java.version} + ${main.java.version} ${project.basedir} @@ -86,6 +86,7 @@ 2.12.5 3.10.0 2.2 + 4.0.0 1.17 3.8.0 @@ -95,7 +96,7 @@ 3.0 3.1.0 2.5.3 - 4.0.0 + 5.1.2 0.1.0 2.22.0 0.14.3 @@ -445,6 +446,10 @@ maven-compiler-plugin true + + ${main.java.version} + ${main.java.version} + @@ -459,7 +464,7 @@ - default-test-compile + default-testCompile test-compile testCompile diff --git a/reactive/pom.xml b/reactive/pom.xml index 929cbec0bb..5a2773b338 100644 --- a/reactive/pom.xml +++ b/reactive/pom.xml @@ -31,7 +31,6 @@ 3.3.0.RELEASE 1.0.3 2.2.14 - 1.9.5 @@ -61,7 +60,7 @@ org.mockito - mockito-all + mockito-core ${mockito.version} test diff --git a/reactive/src/test/java/feign/reactive/ReactiveFeignIntegrationTest.java b/reactive/src/test/java/feign/reactive/ReactiveFeignIntegrationTest.java index 613ca03d2c..347358bd00 100644 --- a/reactive/src/test/java/feign/reactive/ReactiveFeignIntegrationTest.java +++ b/reactive/src/test/java/feign/reactive/ReactiveFeignIntegrationTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2012-2020 The Feign Authors + * Copyright 2012-2021 The Feign Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,9 +14,9 @@ package feign.reactive; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.BDDMockito.given; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; diff --git a/reactive/src/test/java/feign/reactive/ReactiveInvocationHandlerTest.java b/reactive/src/test/java/feign/reactive/ReactiveInvocationHandlerTest.java index 517d227d9c..2f3b42a2ac 100644 --- a/reactive/src/test/java/feign/reactive/ReactiveInvocationHandlerTest.java +++ b/reactive/src/test/java/feign/reactive/ReactiveInvocationHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2012-2020 The Feign Authors + * Copyright 2012-2021 The Feign Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,11 +14,11 @@ package feign.reactive; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; -import static org.mockito.Matchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import feign.InvocationHandlerFactory.MethodHandler; import feign.RequestLine; import feign.Target; @@ -30,7 +30,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; import reactor.test.StepVerifier; @@ -60,7 +60,7 @@ public void invokeOnSubscribeReactor() throws Throwable { Object result = handler.invoke(method, this.methodHandler, new Object[] {}); assertThat(result).isInstanceOf(Mono.class); - verifyZeroInteractions(this.methodHandler); + verifyNoInteractions(this.methodHandler); /* subscribe and execute the method */ StepVerifier.create((Mono) result) @@ -78,7 +78,7 @@ public void invokeOnSubscribeEmptyReactor() throws Throwable { Object result = handler.invoke(method, this.methodHandler, new Object[] {}); assertThat(result).isInstanceOf(Mono.class); - verifyZeroInteractions(this.methodHandler); + verifyNoInteractions(this.methodHandler); /* subscribe and execute the method */ StepVerifier.create((Mono) result) @@ -95,7 +95,7 @@ public void invokeFailureReactor() throws Throwable { Object result = handler.invoke(this.method, this.methodHandler, new Object[] {}); assertThat(result).isInstanceOf(Mono.class); - verifyZeroInteractions(this.methodHandler); + verifyNoInteractions(this.methodHandler); /* subscribe and execute the method, should result in an error */ StepVerifier.create((Mono) result) @@ -115,7 +115,7 @@ public void invokeOnSubscribeRxJava() throws Throwable { Object result = handler.invoke(this.method, this.methodHandler, new Object[] {}); assertThat(result).isInstanceOf(Flowable.class); - verifyZeroInteractions(this.methodHandler); + verifyNoInteractions(this.methodHandler); /* subscribe and execute the method */ StepVerifier.create((Flowable) result) @@ -135,7 +135,7 @@ public void invokeOnSubscribeEmptyRxJava() throws Throwable { Object result = handler.invoke(this.method, this.methodHandler, new Object[] {}); assertThat(result).isInstanceOf(Flowable.class); - verifyZeroInteractions(this.methodHandler); + verifyNoInteractions(this.methodHandler); /* subscribe and execute the method */ StepVerifier.create((Flowable) result) @@ -154,7 +154,7 @@ public void invokeFailureRxJava() throws Throwable { Object result = handler.invoke(this.method, this.methodHandler, new Object[] {}); assertThat(result).isInstanceOf(Flowable.class); - verifyZeroInteractions(this.methodHandler); + verifyNoInteractions(this.methodHandler); /* subscribe and execute the method */ StepVerifier.create((Flowable) result)