Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get build compatible with jdk 16 #1519

Merged
merged 2 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 23 additions & 2 deletions apt-test-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>com.github.jknack</groupId>
<artifactId>handlebars</artifactId>
<version>4.1.2</version>
<version>4.3.0</version>
</dependency>

<dependency>
Expand All @@ -48,9 +48,16 @@
<dependency>
<groupId>com.google.testing.compile</groupId>
<artifactId>compile-testing</artifactId>
<version>0.18</version>
<version>0.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.25</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down Expand Up @@ -171,4 +178,18 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>active-on-jdk-16</id>
<activation>
<jdk>[16,)</jdk>
</activation>

<properties>
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
<jvm.options>--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</jvm.options>
</properties>
</profile>
</profiles>
</project>
3 changes: 1 addition & 2 deletions json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<mockito.version>1.10.19</mockito.version>
</properties>

<dependencies>
Expand All @@ -48,7 +47,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
Expand Down
21 changes: 12 additions & 9 deletions json/src/test/java/feign/json/JsonDecoderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
13 changes: 9 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
<main.signature.artifact>java18</main.signature.artifact>

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

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

Expand All @@ -86,6 +86,7 @@
<jackson.version>2.12.5</jackson.version>
<assertj.version>3.10.0</assertj.version>
<hamcrest.version>2.2</hamcrest.version>
<mockito.version>4.0.0</mockito.version>

<animal-sniffer-maven-plugin.version>1.17</animal-sniffer-maven-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
Expand All @@ -95,7 +96,7 @@
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-bundle-plugin.version>4.0.0</maven-bundle-plugin.version>
<maven-bundle-plugin.version>5.1.2</maven-bundle-plugin.version>
<centralsync-maven-plugin.version>0.1.0</centralsync-maven-plugin.version>
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
<bom-generator.version>0.14.3</bom-generator.version>
Expand Down Expand Up @@ -445,6 +446,10 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<source>${main.java.version}</source>
<target>${main.java.version}</target>
</configuration>
<executions>
<!-- Ensure main source tree compiles to Java ${main.java.version} bytecode. -->
<execution>
Expand All @@ -459,7 +464,7 @@
</configuration>
</execution>
<execution>
<id>default-test-compile</id>
<id>default-testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
Expand Down
3 changes: 1 addition & 2 deletions reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<reactor.version>3.3.0.RELEASE</reactor.version>
<reactive.streams.version>1.0.3</reactive.streams.version>
<reactivex.version>2.2.14</reactivex.version>
<mockito.version>1.9.5</mockito.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -61,7 +60,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down