Skip to content

Commit b2adb39

Browse files
authored
Get build compatible with jdk 16 (#1519)
1 parent 0218674 commit b2adb39

File tree

7 files changed

+52
-25
lines changed

7 files changed

+52
-25
lines changed

apt-test-generator/pom.xml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<dependency>
3737
<groupId>com.github.jknack</groupId>
3838
<artifactId>handlebars</artifactId>
39-
<version>4.1.2</version>
39+
<version>4.3.0</version>
4040
</dependency>
4141

4242
<dependency>
@@ -48,9 +48,16 @@
4848
<dependency>
4949
<groupId>com.google.testing.compile</groupId>
5050
<artifactId>compile-testing</artifactId>
51-
<version>0.18</version>
51+
<version>0.19</version>
5252
<scope>test</scope>
5353
</dependency>
54+
<dependency>
55+
<groupId>org.slf4j</groupId>
56+
<artifactId>slf4j-jdk14</artifactId>
57+
<version>1.7.25</version>
58+
<scope>test</scope>
59+
</dependency>
60+
5461
<dependency>
5562
<groupId>com.google.guava</groupId>
5663
<artifactId>guava</artifactId>
@@ -171,4 +178,18 @@
171178
</plugin>
172179
</plugins>
173180
</build>
181+
182+
<profiles>
183+
<profile>
184+
<id>active-on-jdk-16</id>
185+
<activation>
186+
<jdk>[16,)</jdk>
187+
</activation>
188+
189+
<properties>
190+
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
191+
<jvm.options>--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</jvm.options>
192+
</properties>
193+
</profile>
194+
</profiles>
174195
</project>

json/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
<properties>
3131
<main.basedir>${project.basedir}/..</main.basedir>
32-
<mockito.version>1.10.19</mockito.version>
3332
</properties>
3433

3534
<dependencies>
@@ -48,7 +47,7 @@
4847
</dependency>
4948
<dependency>
5049
<groupId>org.mockito</groupId>
51-
<artifactId>mockito-all</artifactId>
50+
<artifactId>mockito-core</artifactId>
5251
<version>${mockito.version}</version>
5352
<scope>test</scope>
5453
</dependency>

json/src/test/java/feign/json/JsonDecoderTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
package feign.json;
1515

1616
import static feign.Util.UTF_8;
17-
import static org.junit.Assert.*;
18-
import static org.mockito.Matchers.any;
17+
import static org.junit.Assert.assertEquals;
18+
import static org.junit.Assert.assertNull;
19+
import static org.junit.Assert.assertThrows;
20+
import static org.junit.Assert.assertTrue;
21+
import static org.mockito.ArgumentMatchers.any;
1922
import static org.mockito.Mockito.mock;
2023
import static org.mockito.Mockito.when;
2124

pom.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
<main.signature.artifact>java18</main.signature.artifact>
7070

7171
<!-- default bytecode version for src/test -->
72-
<maven.compiler.source>1.8</maven.compiler.source>
73-
<maven.compiler.target>1.8</maven.compiler.target>
72+
<maven.compiler.source>${main.java.version}</maven.compiler.source>
73+
<maven.compiler.target>${main.java.version}</maven.compiler.target>
7474

7575
<main.basedir>${project.basedir}</main.basedir>
7676

@@ -86,6 +86,7 @@
8686
<jackson.version>2.12.5</jackson.version>
8787
<assertj.version>3.10.0</assertj.version>
8888
<hamcrest.version>2.2</hamcrest.version>
89+
<mockito.version>4.0.0</mockito.version>
8990

9091
<animal-sniffer-maven-plugin.version>1.17</animal-sniffer-maven-plugin.version>
9192
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
@@ -95,7 +96,7 @@
9596
<license-maven-plugin.version>3.0</license-maven-plugin.version>
9697
<maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
9798
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
98-
<maven-bundle-plugin.version>4.0.0</maven-bundle-plugin.version>
99+
<maven-bundle-plugin.version>5.1.2</maven-bundle-plugin.version>
99100
<centralsync-maven-plugin.version>0.1.0</centralsync-maven-plugin.version>
100101
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
101102
<bom-generator.version>0.14.3</bom-generator.version>
@@ -445,6 +446,10 @@
445446
<plugin>
446447
<artifactId>maven-compiler-plugin</artifactId>
447448
<inherited>true</inherited>
449+
<configuration>
450+
<source>${main.java.version}</source>
451+
<target>${main.java.version}</target>
452+
</configuration>
448453
<executions>
449454
<!-- Ensure main source tree compiles to Java ${main.java.version} bytecode. -->
450455
<execution>
@@ -459,7 +464,7 @@
459464
</configuration>
460465
</execution>
461466
<execution>
462-
<id>default-test-compile</id>
467+
<id>default-testCompile</id>
463468
<phase>test-compile</phase>
464469
<goals>
465470
<goal>testCompile</goal>

reactive/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
<reactor.version>3.3.0.RELEASE</reactor.version>
3232
<reactive.streams.version>1.0.3</reactive.streams.version>
3333
<reactivex.version>2.2.14</reactivex.version>
34-
<mockito.version>1.9.5</mockito.version>
3534
</properties>
3635

3736
<dependencies>
@@ -61,7 +60,7 @@
6160
</dependency>
6261
<dependency>
6362
<groupId>org.mockito</groupId>
64-
<artifactId>mockito-all</artifactId>
63+
<artifactId>mockito-core</artifactId>
6564
<version>${mockito.version}</version>
6665
<scope>test</scope>
6766
</dependency>

reactive/src/test/java/feign/reactive/ReactiveFeignIntegrationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2020 The Feign Authors
2+
* Copyright 2012-2021 The Feign Authors
33
*
44
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
55
* except in compliance with the License. You may obtain a copy of the License at
@@ -14,9 +14,9 @@
1414
package feign.reactive;
1515

1616
import static org.assertj.core.api.Assertions.assertThat;
17+
import static org.mockito.ArgumentMatchers.any;
18+
import static org.mockito.ArgumentMatchers.anyString;
1719
import static org.mockito.BDDMockito.given;
18-
import static org.mockito.Matchers.any;
19-
import static org.mockito.Matchers.anyString;
2020
import static org.mockito.Mockito.mock;
2121
import static org.mockito.Mockito.spy;
2222
import static org.mockito.Mockito.times;

reactive/src/test/java/feign/reactive/ReactiveInvocationHandlerTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2020 The Feign Authors
2+
* Copyright 2012-2021 The Feign Authors
33
*
44
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
55
* except in compliance with the License. You may obtain a copy of the License at
@@ -14,11 +14,11 @@
1414
package feign.reactive;
1515

1616
import static org.assertj.core.api.Assertions.assertThat;
17+
import static org.mockito.ArgumentMatchers.any;
1718
import static org.mockito.BDDMockito.given;
18-
import static org.mockito.Matchers.any;
1919
import static org.mockito.Mockito.times;
2020
import static org.mockito.Mockito.verify;
21-
import static org.mockito.Mockito.verifyZeroInteractions;
21+
import static org.mockito.Mockito.verifyNoInteractions;
2222

2323
import feign.InvocationHandlerFactory.MethodHandler;
2424
import feign.RequestLine;
@@ -31,7 +31,7 @@
3131
import org.junit.Test;
3232
import org.junit.runner.RunWith;
3333
import org.mockito.Mock;
34-
import org.mockito.runners.MockitoJUnitRunner;
34+
import org.mockito.junit.MockitoJUnitRunner;
3535
import reactor.core.publisher.Mono;
3636
import reactor.core.scheduler.Schedulers;
3737
import reactor.test.StepVerifier;
@@ -62,7 +62,7 @@ public void invokeOnSubscribeReactor() throws Throwable {
6262

6363
Object result = handler.invoke(method, this.methodHandler, new Object[] {});
6464
assertThat(result).isInstanceOf(Mono.class);
65-
verifyZeroInteractions(this.methodHandler);
65+
verifyNoInteractions(this.methodHandler);
6666

6767
/* subscribe and execute the method */
6868
StepVerifier.create((Mono) result).expectNext("Result").expectComplete().verify();
@@ -80,7 +80,7 @@ public void invokeOnSubscribeEmptyReactor() throws Throwable {
8080

8181
Object result = handler.invoke(method, this.methodHandler, new Object[] {});
8282
assertThat(result).isInstanceOf(Mono.class);
83-
verifyZeroInteractions(this.methodHandler);
83+
verifyNoInteractions(this.methodHandler);
8484

8585
/* subscribe and execute the method */
8686
StepVerifier.create((Mono) result).expectComplete().verify();
@@ -98,7 +98,7 @@ public void invokeFailureReactor() throws Throwable {
9898

9999
Object result = handler.invoke(this.method, this.methodHandler, new Object[] {});
100100
assertThat(result).isInstanceOf(Mono.class);
101-
verifyZeroInteractions(this.methodHandler);
101+
verifyNoInteractions(this.methodHandler);
102102

103103
/* subscribe and execute the method, should result in an error */
104104
StepVerifier.create((Mono) result).expectError(IOException.class).verify();
@@ -117,7 +117,7 @@ public void invokeOnSubscribeRxJava() throws Throwable {
117117

118118
Object result = handler.invoke(this.method, this.methodHandler, new Object[] {});
119119
assertThat(result).isInstanceOf(Flowable.class);
120-
verifyZeroInteractions(this.methodHandler);
120+
verifyNoInteractions(this.methodHandler);
121121

122122
/* subscribe and execute the method */
123123
StepVerifier.create((Flowable) result).expectNext("Result").expectComplete().verify();
@@ -135,7 +135,7 @@ public void invokeOnSubscribeEmptyRxJava() throws Throwable {
135135

136136
Object result = handler.invoke(this.method, this.methodHandler, new Object[] {});
137137
assertThat(result).isInstanceOf(Flowable.class);
138-
verifyZeroInteractions(this.methodHandler);
138+
verifyNoInteractions(this.methodHandler);
139139

140140
/* subscribe and execute the method */
141141
StepVerifier.create((Flowable) result).expectComplete().verify();
@@ -153,7 +153,7 @@ public void invokeFailureRxJava() throws Throwable {
153153

154154
Object result = handler.invoke(this.method, this.methodHandler, new Object[] {});
155155
assertThat(result).isInstanceOf(Flowable.class);
156-
verifyZeroInteractions(this.methodHandler);
156+
verifyNoInteractions(this.methodHandler);
157157

158158
/* subscribe and execute the method */
159159
StepVerifier.create((Flowable) result).expectError(IOException.class).verify();

0 commit comments

Comments
 (0)