Skip to content

Commit

Permalink
Merge pull request #28 from SimY4/master
Browse files Browse the repository at this point in the history
Fix compatibility with 10.7.0
  • Loading branch information
saintf committed May 15, 2020
2 parents eb77215 + 878e0bf commit 5467524
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.github.openfeign</groupId>
<artifactId>parent</artifactId>
<version>10.2.0</version>
<version>10.7.0</version>
</parent>

<artifactId>feign-annotation-error-decoder</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/feign/error/ExceptionGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class ExceptionGenerator {
.status(500)
.body((Response.Body) null)
.headers(testHeaders)
.request(Request.create(Request.HttpMethod.GET, "http://test", testHeaders, null))
.request(Request.create(Request.HttpMethod.GET, "http://test", testHeaders,
Request.Body.empty(), null))
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import feign.Request;
import feign.Response;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -42,9 +42,10 @@ Response testResponse(int status, String body) {
Response testResponse(int status, String body, Map<String, Collection<String>> headers) {
return Response.builder()
.status(status)
.body(body, Charset.forName("UTF-8"))
.body(body, StandardCharsets.UTF_8)
.headers(headers)
.request(Request.create(Request.HttpMethod.GET, "http://test", headers, null))
.request(Request.create(Request.HttpMethod.GET, "http://test", headers,
Request.Body.empty(), null))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
*/
package feign.error;

import feign.Request;
import feign.codec.Decoder;
import feign.optionals.OptionalDecoder;
import org.junit.Test;
import org.junit.runner.Request;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.runners.Parameterized.Parameter;
import javax.swing.text.html.Option;
import java.util.*;
import static org.assertj.core.api.Assertions.assertThat;
import static feign.error.AnnotationErrorDecoderExceptionConstructorsTest.TestClientInterfaceWithDifferentExceptionConstructors;
Expand All @@ -36,7 +35,7 @@ public class AnnotationErrorDecoderExceptionConstructorsTest extends
private static final Object NULL_BODY = null;
private static final String NON_NULL_BODY = "A GIVEN BODY";
private static final feign.Request REQUEST = feign.Request.create(feign.Request.HttpMethod.GET,
"http://test", Collections.emptyMap(), null);
"http://test", Collections.emptyMap(), Request.Body.empty(), null);
private static final feign.Request NO_REQUEST = null;
private static final Map<String, Collection<String>> NON_NULL_HEADERS =
new HashMap<String, Collection<String>>();
Expand Down

0 comments on commit 5467524

Please sign in to comment.