Browse Source

Bumps dependency versions for integrations

* OkHttp/MockWebServer 2.4.0
* Gson 2.3.1
* Jackson 2.6.0
* Ribbon 2.1.0
* SLF4J 1.7.12
pull/252/head
Adrian Cole 9 years ago committed by Adrian Cole
parent
commit
eb351f843d
  1. 8
      CHANGELOG.md
  2. 14
      benchmark/pom.xml
  3. 2
      build.gradle
  4. 6
      core/build.gradle
  5. 3
      core/src/test/java/feign/FeignTest.java
  6. 42
      core/src/test/java/feign/assertj/RecordedRequestAssert.java
  7. 3
      core/src/test/java/feign/client/DefaultClientTest.java
  8. 4
      example-github/build.gradle
  9. 6
      example-github/pom.xml
  10. 4
      example-wikipedia/build.gradle
  11. 4
      example-wikipedia/pom.xml
  12. 4
      gradle/wrapper/gradle-wrapper.properties
  13. 4
      gson/build.gradle
  14. 4
      httpclient/build.gradle
  15. 4
      jackson/build.gradle
  16. 2
      jaxb/build.gradle
  17. 2
      jaxrs/build.gradle
  18. 6
      okhttp/build.gradle
  19. 14
      okhttp/src/main/java/feign/okhttp/OkHttpClient.java
  20. 2
      okhttp/src/test/java/feign/okhttp/OkHttpClientTest.java
  21. 6
      ribbon/build.gradle
  22. 5
      ribbon/src/test/java/feign/ribbon/LoadBalancingTargetTest.java
  23. 2
      sax/build.gradle
  24. 6
      slf4j/build.gradle

8
CHANGELOG.md

@ -1,3 +1,11 @@ @@ -1,3 +1,11 @@
### Version 8.7
* Bumps dependency versions for integrations
* OkHttp/MockWebServer 2.4.0
* Gson 2.3.1
* Jackson 2.6.0
* Ribbon 2.1.0
* SLF4J 1.7.12
### Version 8.6
* Adds base api support via single-inheritance interfaces

14
benchmark/pom.xml

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<name>Feign Benchmark (JMH)</name>
<properties>
<jmh.version>1.8</jmh.version>
<jmh.version>1.10.3</jmh.version>
</properties>
<dependencies>
@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>mockwebserver</artifactId>
<version>2.3.0</version>
<version>2.4.0</version>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
@ -44,17 +44,17 @@ @@ -44,17 +44,17 @@
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxnetty</artifactId>
<version>0.4.8</version>
<version>0.4.11</version>
</dependency>
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>1.0.9</version>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<version>4.0.26.Final</version>
<version>4.0.30.Final</version>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
@ -75,7 +75,7 @@ @@ -75,7 +75,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
@ -96,7 +96,7 @@ @@ -96,7 +96,7 @@
<plugin>
<groupId>org.skife.maven</groupId>
<artifactId>really-executable-jar-maven-plugin</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
<configuration>
<programFile>benchmark</programFile>
</configuration>

2
build.gradle

@ -6,7 +6,7 @@ buildscript { @@ -6,7 +6,7 @@ buildscript {
}
plugins {
id 'nebula.netflixoss' version '2.2.9'
id 'nebula.netflixoss' version '2.2.10'
}
ext {

6
core/build.gradle

@ -4,7 +4,7 @@ sourceCompatibility = 1.6 @@ -4,7 +4,7 @@ sourceCompatibility = 1.6
dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'com.squareup.okhttp:mockwebserver:2.2.0'
testCompile 'com.google.code.gson:gson:2.2.4' // for example
testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7
testCompile 'com.squareup.okhttp:mockwebserver:2.4.0'
testCompile 'com.google.code.gson:gson:2.3.1' // for example
}

3
core/src/test/java/feign/FeignTest.java

@ -22,6 +22,7 @@ import com.squareup.okhttp.mockwebserver.MockResponse; @@ -22,6 +22,7 @@ import com.squareup.okhttp.mockwebserver.MockResponse;
import com.squareup.okhttp.mockwebserver.SocketPolicy;
import com.squareup.okhttp.mockwebserver.rule.MockWebServerRule;
import okio.Buffer;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@ -426,7 +427,7 @@ public class FeignTest { @@ -426,7 +427,7 @@ public class FeignTest {
@Test
public void decodeLogicSupportsByteArray() throws Exception {
byte[] expectedResponse = {12, 34, 56};
server.enqueue(new MockResponse().setBody(expectedResponse));
server.enqueue(new MockResponse().setBody(new Buffer().write(expectedResponse)));
OtherTestInterface
api =

42
core/src/test/java/feign/assertj/RecordedRequestAssert.java

@ -15,23 +15,29 @@ @@ -15,23 +15,29 @@
*/
package feign.assertj;
import com.squareup.okhttp.Headers;
import com.squareup.okhttp.mockwebserver.RecordedRequest;
import org.assertj.core.api.AbstractAssert;
import org.assertj.core.data.MapEntry;
import org.assertj.core.internal.ByteArrays;
import org.assertj.core.internal.Failures;
import org.assertj.core.internal.Iterables;
import org.assertj.core.internal.Maps;
import org.assertj.core.internal.Objects;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.zip.GZIPInputStream;
import java.util.zip.InflaterInputStream;
import feign.Util;
import static org.assertj.core.data.MapEntry.entry;
import static org.assertj.core.error.ShouldNotContain.shouldNotContain;
public final class RecordedRequestAssert
@ -39,7 +45,7 @@ public final class RecordedRequestAssert @@ -39,7 +45,7 @@ public final class RecordedRequestAssert
ByteArrays arrays = ByteArrays.instance();
Objects objects = Objects.instance();
Iterables iterables = Iterables.instance();
Maps maps = Maps.instance();
Failures failures = Failures.instance();
public RecordedRequestAssert(RecordedRequest actual) {
@ -60,13 +66,13 @@ public final class RecordedRequestAssert @@ -60,13 +66,13 @@ public final class RecordedRequestAssert
public RecordedRequestAssert hasBody(String utf8Expected) {
isNotNull();
objects.assertEqual(info, actual.getUtf8Body(), utf8Expected);
objects.assertEqual(info, actual.getBody().readUtf8(), utf8Expected);
return this;
}
public RecordedRequestAssert hasGzippedBody(byte[] expectedUncompressed) {
isNotNull();
byte[] compressedBody = actual.getBody();
byte[] compressedBody = actual.getBody().readByteArray();
byte[] uncompressedBody;
try {
uncompressedBody =
@ -80,7 +86,7 @@ public final class RecordedRequestAssert @@ -80,7 +86,7 @@ public final class RecordedRequestAssert
public RecordedRequestAssert hasDeflatedBody(byte[] expectedUncompressed) {
isNotNull();
byte[] compressedBody = actual.getBody();
byte[] compressedBody = actual.getBody().readByteArray();
byte[] uncompressedBody;
try {
uncompressedBody =
@ -94,20 +100,38 @@ public final class RecordedRequestAssert @@ -94,20 +100,38 @@ public final class RecordedRequestAssert
public RecordedRequestAssert hasBody(byte[] expected) {
isNotNull();
arrays.assertContains(info, actual.getBody(), expected);
arrays.assertContains(info, actual.getBody().readByteArray(), expected);
return this;
}
public RecordedRequestAssert hasHeaders(String... headers) {
/**
* @deprecated use {@link #hasHeaders(MapEntry...)}
*/
@Deprecated
public RecordedRequestAssert hasHeaders(String... headerLines) {
isNotNull();
iterables.assertContainsSubsequence(info, actual.getHeaders(), headers);
Headers.Builder builder = new Headers.Builder();
for (String next : headerLines) {
builder.add(next);
}
List<MapEntry> expected = new ArrayList<MapEntry>();
for (Map.Entry<String, List<String>> next : builder.build().toMultimap().entrySet()) {
expected.add(entry(next.getKey(), next.getValue()));
}
hasHeaders(expected.toArray(new MapEntry[expected.size()]));
return this;
}
public RecordedRequestAssert hasHeaders(MapEntry... expected) {
isNotNull();
maps.assertContains(info, actual.getHeaders().toMultimap(), expected);
return this;
}
public RecordedRequestAssert hasNoHeaderNamed(final String... names) {
isNotNull();
Set<String> found = new LinkedHashSet<String>();
for (String header : actual.getHeaders()) {
for (String header : actual.getHeaders().names()) {
for (String name : names) {
if (header.toLowerCase().startsWith(name.toLowerCase() + ":")) {
found.add(header);

3
core/src/test/java/feign/client/DefaultClientTest.java

@ -50,8 +50,7 @@ public class DefaultClientTest { @@ -50,8 +50,7 @@ public class DefaultClientTest {
@Rule
public final MockWebServerRule server = new MockWebServerRule();
Client trustSSLSockets = new Client.Default(TrustingSSLSocketFactory.get(), null);
Client
disableHostnameVerification =
Client disableHostnameVerification =
new Client.Default(TrustingSSLSocketFactory.get(), new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {

4
example-github/build.gradle

@ -12,8 +12,8 @@ configurations { @@ -12,8 +12,8 @@ configurations {
}
dependencies {
compile 'com.netflix.feign:feign-core:8.1.0'
compile 'com.netflix.feign:feign-gson:8.1.0'
compile 'com.netflix.feign:feign-core:8.6.0'
compile 'com.netflix.feign:feign-gson:8.6.0'
}
// create a self-contained jar that is executable

6
example-github/pom.xml

@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
<groupId>com.netflix.feign</groupId>
<artifactId>feign-example-github</artifactId>
<packaging>jar</packaging>
<version>8.1.0</version>
<version>8.6.0</version>
<name>GitHub Example</name>
<dependencies>
@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
<plugin>
<groupId>org.skife.maven</groupId>
<artifactId>really-executable-jar-maven-plugin</artifactId>
<version>1.3.0</version>
<version>1.4.1</version>
<configuration>
<programFile>github</programFile>
</configuration>

4
example-wikipedia/build.gradle

@ -12,8 +12,8 @@ configurations { @@ -12,8 +12,8 @@ configurations {
}
dependencies {
compile 'com.netflix.feign:feign-core:8.1.0'
compile 'com.netflix.feign:feign-gson:8.1.0'
compile 'com.netflix.feign:feign-core:8.6.0'
compile 'com.netflix.feign:feign-gson:8.6.0'
}
// create a self-contained jar that is executable

4
example-wikipedia/pom.xml

@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
<groupId>com.netflix.feign</groupId>
<artifactId>feign-example-wikipedia</artifactId>
<packaging>jar</packaging>
<version>8.1.0</version>
<version>8.6.0</version>
<name>Wikipedia Example</name>
<dependencies>
@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>

4
gradle/wrapper/gradle-wrapper.properties vendored

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#Fri Jan 02 13:14:58 PST 2015
#Sun Aug 02 08:22:13 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

4
gson/build.gradle

@ -4,8 +4,8 @@ sourceCompatibility = 1.6 @@ -4,8 +4,8 @@ sourceCompatibility = 1.6
dependencies {
compile project(':feign-core')
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.code.gson:gson:2.3.1'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7
testCompile project(':feign-core').sourceSets.test.output // for assertions
}

4
httpclient/build.gradle

@ -6,7 +6,7 @@ dependencies { @@ -6,7 +6,7 @@ dependencies {
compile project(':feign-core')
compile 'org.apache.httpcomponents:httpclient:4.4.1'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'com.squareup.okhttp:mockwebserver:2.2.0'
testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7
testCompile 'com.squareup.okhttp:mockwebserver:2.4.0'
testCompile project(':feign-core').sourceSets.test.output // for assertions
}

4
jackson/build.gradle

@ -4,8 +4,8 @@ sourceCompatibility = 1.6 @@ -4,8 +4,8 @@ sourceCompatibility = 1.6
dependencies {
compile project(':feign-core')
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.0'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7
testCompile project(':feign-core').sourceSets.test.output // for assertions
}

2
jaxb/build.gradle

@ -3,6 +3,6 @@ apply plugin: 'java' @@ -3,6 +3,6 @@ apply plugin: 'java'
dependencies {
compile project(':feign-core')
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7
testCompile project(':feign-core').sourceSets.test.output // for assertions
}

2
jaxrs/build.gradle

@ -6,7 +6,7 @@ dependencies { @@ -6,7 +6,7 @@ dependencies {
compile project(':feign-core')
compile 'javax.ws.rs:jsr311-api:1.1.1'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7
testCompile project(':feign-core').sourceSets.test.output // for assertions
testCompile project(':feign-gson') // for github example
}

6
okhttp/build.gradle

@ -4,9 +4,9 @@ sourceCompatibility = 1.6 @@ -4,9 +4,9 @@ sourceCompatibility = 1.6
dependencies {
compile project(':feign-core')
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'com.squareup.okhttp:mockwebserver:2.2.0'
testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7
testCompile 'com.squareup.okhttp:mockwebserver:2.4.0'
testCompile project(':feign-core').sourceSets.test.output // for assertions
}

14
okhttp/src/main/java/feign/okhttp/OkHttpClient.java

@ -26,7 +26,6 @@ import java.io.IOException; @@ -26,7 +26,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@ -83,23 +82,16 @@ public final class OkHttpClient implements Client { @@ -83,23 +82,16 @@ public final class OkHttpClient implements Client {
return requestBuilder.build();
}
private static feign.Response toFeignResponse(Response input) {
private static feign.Response toFeignResponse(Response input) throws IOException {
return feign.Response
.create(input.code(), input.message(), toMap(input.headers()), toBody(input.body()));
}
private static Map<String, Collection<String>> toMap(Headers headers) {
Map<String, Collection<String>>
result =
new LinkedHashMap<String, Collection<String>>(headers.size());
for (String name : headers.names()) {
// TODO: this is very inefficient as headers.values iterate case insensitively.
result.put(name, headers.values(name));
}
return result;
return (Map) headers.toMultimap();
}
private static feign.Response.Body toBody(final ResponseBody input) {
private static feign.Response.Body toBody(final ResponseBody input) throws IOException {
if (input == null || input.contentLength() == 0) {
return null;
}

2
okhttp/src/test/java/feign/okhttp/OkHttpClientTest.java

@ -18,6 +18,7 @@ package feign.okhttp; @@ -18,6 +18,7 @@ package feign.okhttp;
import com.squareup.okhttp.mockwebserver.MockResponse;
import com.squareup.okhttp.mockwebserver.rule.MockWebServerRule;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@ -82,6 +83,7 @@ public class OkHttpClientTest { @@ -82,6 +83,7 @@ public class OkHttpClientTest {
}
@Test
@Ignore // TODO: Remove on OkHttp 2.5 https://github.com/square/okhttp/issues/1778
public void patch() throws IOException, InterruptedException {
server.enqueue(new MockResponse().setBody("foo"));
server.enqueue(new MockResponse());

6
ribbon/build.gradle

@ -4,9 +4,9 @@ sourceCompatibility = 1.6 @@ -4,9 +4,9 @@ sourceCompatibility = 1.6
dependencies {
compile project(':feign-core')
compile 'com.netflix.ribbon:ribbon-loadbalancer:2.0-RC13'
compile 'com.netflix.ribbon:ribbon-loadbalancer:2.1.0'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'com.squareup.okhttp:mockwebserver:2.2.0'
testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7
testCompile 'com.squareup.okhttp:mockwebserver:2.4.0'
testCompile project(':feign-core').sourceSets.test.output
}

5
ribbon/src/test/java/feign/ribbon/LoadBalancingTargetTest.java

@ -28,7 +28,6 @@ import feign.Feign; @@ -28,7 +28,6 @@ import feign.Feign;
import feign.RequestLine;
import static com.netflix.config.ConfigurationManager.getConfigInstance;
import static feign.Util.UTF_8;
import static org.junit.Assert.assertEquals;
public class LoadBalancingTargetTest {
@ -48,8 +47,8 @@ public class LoadBalancingTargetTest { @@ -48,8 +47,8 @@ public class LoadBalancingTargetTest {
String name = "LoadBalancingTargetTest-loadBalancingDefaultPolicyRoundRobin";
String serverListKey = name + ".ribbon.listOfServers";
server1.enqueue(new MockResponse().setBody("success!".getBytes(UTF_8)));
server2.enqueue(new MockResponse().setBody("success!".getBytes(UTF_8)));
server1.enqueue(new MockResponse().setBody("success!"));
server2.enqueue(new MockResponse().setBody("success!"));
getConfigInstance().setProperty(serverListKey,
hostAndPort(server1.getUrl("")) + "," + hostAndPort(

2
sax/build.gradle

@ -5,5 +5,5 @@ sourceCompatibility = 1.6 @@ -5,5 +5,5 @@ sourceCompatibility = 1.6
dependencies {
compile project(':feign-core')
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7
}

6
slf4j/build.gradle

@ -2,8 +2,8 @@ apply plugin: 'java' @@ -2,8 +2,8 @@ apply plugin: 'java'
dependencies {
compile project(':feign-core')
compile 'org.slf4j:slf4j-api:1.7.5'
compile 'org.slf4j:slf4j-api:1.7.12'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.slf4j:slf4j-simple:1.7.5'
testCompile 'org.assertj:assertj-core:1.7.1' // last version supporting JDK 7
testCompile 'org.slf4j:slf4j-simple:1.7.12'
}

Loading…
Cancel
Save