update deprecated methods
diff --git a/.gitignore b/.gitignore
index a7c2d8b..c0af34f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,8 +2,10 @@
.idea
build/
target/
+bin/
.project
.settings/
+.classpath
# Ignore Gradle GUI config
gradle-app.setting
diff --git a/build.gradle b/build.gradle
index 1916846..24c0680 100644
--- a/build.gradle
+++ b/build.gradle
@@ -59,7 +59,7 @@
dependencyManagement {
imports {
- mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Hoxton.SR2'
+ mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Hoxton.SR3'
}
}
@@ -130,6 +130,8 @@
"gradlew.bat",
"README.md",
".project",
+ "bin/**",
+ ".classpath",
".settings/**"
]
}
diff --git a/src/test/java/org/apache/fineract/cn/api/util/AnnotatedErrorDecoderTest.java b/src/test/java/org/apache/fineract/cn/api/util/AnnotatedErrorDecoderTest.java
index b272ab7..aed2d6d 100644
--- a/src/test/java/org/apache/fineract/cn/api/util/AnnotatedErrorDecoderTest.java
+++ b/src/test/java/org/apache/fineract/cn/api/util/AnnotatedErrorDecoderTest.java
@@ -21,6 +21,7 @@
import feign.Feign;
import feign.FeignException;
import feign.Response;
+import feign.Request;
import org.apache.fineract.cn.api.annotation.ThrowsException;
import org.junit.Assert;
import org.junit.Test;
@@ -50,51 +51,62 @@
public static Collection testCases() throws NoSuchMethodException {
final Collection<TestCase> ret = new ArrayList<>();
+ final String TEST_URL = "http://igle.pop.org/app/v1/";
+ final Request request = Request.create("GET", TEST_URL, Collections.emptyMap(), new byte[]{}, Charset.defaultCharset());
+
final Response emptyInternalServerErrorResponse = Response.builder()
.status(HttpStatus.INTERNAL_SERVER_ERROR.value())
.body("blah", Charset.defaultCharset())
.headers(Collections.emptyMap())
+ .request(request)
.build();
final Response emptyBadRequestResponse = Response.builder()
.status(HttpStatus.BAD_REQUEST.value())
.body("blah", Charset.defaultCharset())
.headers(Collections.emptyMap())
+ .request(request)
.build();
final Response emptyBadRequestResponseWithNoBody = Response.builder()
.status(HttpStatus.BAD_REQUEST.value())
.headers(Collections.emptyMap())
+ .request(request)
.build();
final Response emptyNotFoundRequestResponse = Response.builder()
.status(HttpStatus.NOT_FOUND.value())
.body("blah", Charset.defaultCharset())
.headers(Collections.emptyMap())
+ .request(request)
.build();
final Response emptyConflictResponse = Response.builder()
.status(HttpStatus.CONFLICT.value())
.body("blah", Charset.defaultCharset())
.headers(Collections.emptyMap())
+ .request(request)
.build();
final Response emptyIAmATeapotResponse = Response.builder()
.status(HttpStatus.I_AM_A_TEAPOT.value())
.body("blah", Charset.defaultCharset())
.headers(Collections.emptyMap())
+ .request(request)
.build();
final Response emptyUnauthorizedResponse = Response.builder()
.status(HttpStatus.UNAUTHORIZED.value())
.body("blah", Charset.defaultCharset())
.headers(Collections.emptyMap())
+ .request(request)
.build();
final Response emptyForbiddenResponse = Response.builder()
.status(HttpStatus.FORBIDDEN.value())
.body("blah", Charset.defaultCharset())
.headers(Collections.emptyMap())
+ .request(request)
.build();
final String madeUpMethodKey = "x";
@@ -106,10 +118,10 @@
Feign.configKey(OneMethodInterface.class, OneMethodInterface.class.getMethod("method"));
final String onceAnnotatedMethodKey =
- Feign.configKey(OneMethodOneAnnotationInterface.class, OneMethodOneAnnotationInterface.class.getMethod("method"));
+ Feign.configKey(OneMethodOneAnnotationInterface.class, OneMethodOneAnnotationInterface.class.getMethod("method"));
final String onceAnnotatedWithStringExceptionMethodKey =
- Feign.configKey(OneMethodOneAnnotationStringParameteredExceptionInterface.class, OneMethodOneAnnotationStringParameteredExceptionInterface.class.getMethod("method"));
+ Feign.configKey(OneMethodOneAnnotationStringParameteredExceptionInterface.class, OneMethodOneAnnotationStringParameteredExceptionInterface.class.getMethod("method"));
ret.add(new TestCase("Methodless interface")
.clazz(MethodlessInterface.class)
@@ -154,10 +166,10 @@
.expectedResult(new ParameterlessException()));
ret.add(new TestCase("Interface with one method that has one annotation containing an exception which accepts a string parameter.")
- .clazz(OneMethodOneAnnotationStringParameteredExceptionInterface.class)
- .methodKey(onceAnnotatedWithStringExceptionMethodKey)
- .response(emptyBadRequestResponse)
- .expectedResult(new StringParameteredException("blah")));
+ .clazz(OneMethodOneAnnotationStringParameteredExceptionInterface.class)
+ .methodKey(onceAnnotatedWithStringExceptionMethodKey)
+ .response(emptyBadRequestResponse)
+ .expectedResult(new StringParameteredException("blah")));
ret.add(new TestCase("Bad request on an interface in which bad request isn't mapped.")
.clazz(AnnotationlessInterface.class)
@@ -166,17 +178,17 @@
.expectedResult(new IllegalArgumentException("blah")));
ret.add(new TestCase("Bad request with no body on an interface in which bad request isn't mapped.")
- .clazz(AnnotationlessInterface.class)
- .methodKey(annotationlessMethodKey)
- .response(emptyBadRequestResponseWithNoBody)
- .expectedResult(new IllegalArgumentException((String)null)));
+ .clazz(AnnotationlessInterface.class)
+ .methodKey(annotationlessMethodKey)
+ .response(emptyBadRequestResponseWithNoBody)
+ .expectedResult(new IllegalArgumentException((String)null)));
ret.add(new TestCase("Not found request on an interface in which not found request isn't mapped.")
- .clazz(AnnotationlessInterface.class)
- .methodKey(annotationlessMethodKey)
- .response(emptyNotFoundRequestResponse)
- .expectedResult(new NotFoundException("blah")));
+ .clazz(AnnotationlessInterface.class)
+ .methodKey(annotationlessMethodKey)
+ .response(emptyNotFoundRequestResponse)
+ .expectedResult(new NotFoundException("blah")));
ret.add(new TestCase("Request with invalid token.")
.clazz(OneMethodOneAnnotationInterface.class)
diff --git a/src/test/java/org/apache/fineract/cn/api/util/CookieInterceptingClientTest.java b/src/test/java/org/apache/fineract/cn/api/util/CookieInterceptingClientTest.java
index 0b64af1..1c4102c 100644
--- a/src/test/java/org/apache/fineract/cn/api/util/CookieInterceptingClientTest.java
+++ b/src/test/java/org/apache/fineract/cn/api/util/CookieInterceptingClientTest.java
@@ -38,12 +38,12 @@
*/
public class CookieInterceptingClientTest {
private final static String TEST_URL = "http://igle.pop.org/app/v1/";
+ private final Request request = Request.create("GET", TEST_URL, Collections.emptyMap(), new byte[]{}, Charset.defaultCharset());
@Test
public void cookiesPlacedInJarThenAttachedToRequest() throws IOException, URISyntaxException {
final CookieInterceptingClient testSubject = new CookieInterceptingClient(TEST_URL);
- //response
final CookieInterceptingClient spiedTestSubject = Mockito.spy(testSubject);
final Map<String, Collection<String>> cookieHeaders = new HashMap<>();
@@ -52,11 +52,12 @@
.status(HttpStatus.INTERNAL_SERVER_ERROR.value())
.reason("blah")
.headers(cookieHeaders)
+ .request(this.request)
.build();
Mockito.doReturn(dummyResponse).when(spiedTestSubject).superExecute(Mockito.anyObject(), Mockito.anyObject());
- spiedTestSubject.execute(Request.create("", TEST_URL +"request", Collections.emptyMap(), new byte[]{}, Charset.defaultCharset()), new Request.Options());
+ spiedTestSubject.execute(this.request, new Request.Options());
final Map<String, List<String>> ret = testSubject.cookieManager.get(new URI(TEST_URL), Collections.emptyMap());
Assert.assertEquals(ret.get("Cookie"), Collections.singletonList("x=y"));