From 95eb02d7e9aabd79d7c05d9c1d7d73e66cc3b113 Mon Sep 17 00:00:00 2001 From: Tomasz Nurkiewicz Date: Thu, 4 Dec 2014 15:06:04 +0100 Subject: [PATCH] [#13] No point in keeping separate subclasses of ResponseTypeRelatedRequestsExecutor --- ...ResponseTypeRelatedRequestsExecutor.groovy | 11 +++++--- ...DeleteExecuteForResponseTypeRelated.groovy | 25 ------------------ .../fluent/delete/DeleteMethodBuilder.groovy | 8 ++++-- .../GetExecuteForResponseTypeRelated.groovy | 26 ------------------- .../fluent/get/GetMethodBuilder.groovy | 8 +++--- .../HeadExecuteForResponseTypeRelated.groovy | 25 ------------------ .../fluent/head/HeadMethodBuilder.groovy | 6 +++-- ...ptionsExecuteForResponseTypeRelated.groovy | 25 ------------------ .../options/OptionsMethodBuilder.groovy | 6 +++-- .../PostExecuteForResponseTypeRelated.groovy | 25 ------------------ .../fluent/post/PostMethodBuilder.groovy | 5 ++-- .../PutExecuteForResponseTypeRelated.groovy | 26 ------------------- .../fluent/put/PutMethodBuilder.groovy | 5 ++-- 13 files changed, 32 insertions(+), 169 deletions(-) delete mode 100644 micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/delete/DeleteExecuteForResponseTypeRelated.groovy delete mode 100644 micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/get/GetExecuteForResponseTypeRelated.groovy delete mode 100644 micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/head/HeadExecuteForResponseTypeRelated.groovy delete mode 100644 micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/options/OptionsExecuteForResponseTypeRelated.groovy delete mode 100644 micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/post/PostExecuteForResponseTypeRelated.groovy delete mode 100644 micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/put/PutExecuteForResponseTypeRelated.groovy diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/common/response/executor/ResponseTypeRelatedRequestsExecutor.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/common/response/executor/ResponseTypeRelatedRequestsExecutor.groovy index bbe27d1b..cb44c3d8 100644 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/common/response/executor/ResponseTypeRelatedRequestsExecutor.groovy +++ b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/common/response/executor/ResponseTypeRelatedRequestsExecutor.groovy @@ -3,10 +3,13 @@ package com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor import com.google.common.util.concurrent.ListenableFuture import com.nurkiewicz.asyncretry.RetryExecutor import groovy.transform.TypeChecked +import org.springframework.http.HttpMethod import org.springframework.http.HttpMethod as SpringHttpMethod import org.springframework.http.ResponseEntity import org.springframework.web.client.RestOperations +import static org.springframework.http.HttpMethod.DELETE + /** * Abstraction over {@link RestOperations} that for a {@link ResponseTypeRelatedRequestsExecutor#getHttpMethod()} * checks whether user passed an URL or a template. Basing on this we create an execute a request. @@ -23,20 +26,20 @@ import org.springframework.web.client.RestOperations * @see RestOperations */ @TypeChecked -abstract class ResponseTypeRelatedRequestsExecutor { +public class ResponseTypeRelatedRequestsExecutor { protected final RestExecutor restExecutor protected final Map params private final Class responseType + final HttpMethod httpMethod - ResponseTypeRelatedRequestsExecutor(Map params, RestOperations restOperations, RetryExecutor retryExecutor, Class responseType) { + public ResponseTypeRelatedRequestsExecutor(Map params, RestOperations restOperations, RetryExecutor retryExecutor, Class responseType, HttpMethod httpMethod) { this.params = params this.responseType = responseType this.restExecutor = new RestExecutor(restOperations, retryExecutor) + this.httpMethod = httpMethod } - protected abstract SpringHttpMethod getHttpMethod() - ResponseEntity exchange() { return restExecutor.exchange(httpMethod, params, responseType) } diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/delete/DeleteExecuteForResponseTypeRelated.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/delete/DeleteExecuteForResponseTypeRelated.groovy deleted file mode 100644 index ed5ba8de..00000000 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/delete/DeleteExecuteForResponseTypeRelated.groovy +++ /dev/null @@ -1,25 +0,0 @@ -package com.ofg.infrastructure.web.resttemplate.fluent.delete - -import com.nurkiewicz.asyncretry.RetryExecutor -import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor -import groovy.transform.CompileStatic -import org.springframework.http.HttpMethod -import org.springframework.web.client.RestOperations - -import static org.springframework.http.HttpMethod.DELETE -/** - * Implementation of method execution for the {@link HttpMethod#DELETE} method. - */ -@CompileStatic -class DeleteExecuteForResponseTypeRelated extends ResponseTypeRelatedRequestsExecutor { - - DeleteExecuteForResponseTypeRelated(Map params, RestOperations restOperations, RetryExecutor retryExecutor) { - super(params, restOperations, retryExecutor, Object) - } - - @Override - HttpMethod getHttpMethod() { - return DELETE - } - -} diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/delete/DeleteMethodBuilder.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/delete/DeleteMethodBuilder.groovy index f6c6c591..373312d9 100644 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/delete/DeleteMethodBuilder.groovy +++ b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/delete/DeleteMethodBuilder.groovy @@ -5,14 +5,18 @@ import com.google.common.util.concurrent.Futures import com.google.common.util.concurrent.ListenableFuture import com.nurkiewicz.asyncretry.RetryExecutor import com.nurkiewicz.asyncretry.SyncRetryExecutor +import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.BodylessWithHeaders import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.HeadersHaving import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.PredefinedHttpHeaders import groovy.transform.TypeChecked import org.springframework.http.HttpEntity +import org.springframework.http.HttpMethod import org.springframework.http.ResponseEntity import org.springframework.web.client.RestOperations +import javax.ws.rs.DELETE + import static com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.PredefinedHttpHeaders.NO_PREDEFINED_HEADERS /** @@ -91,8 +95,8 @@ class DeleteMethodBuilder implements DeleteMethod, UrlParameterizableDeleteMetho return delete().exchangeAsync() } - private DeleteExecuteForResponseTypeRelated delete() { - return new DeleteExecuteForResponseTypeRelated(params, restOperations, retryExecutor) + private ResponseTypeRelatedRequestsExecutor delete() { + return new ResponseTypeRelatedRequestsExecutor(params, restOperations, retryExecutor, Object, HttpMethod.DELETE) } @Override diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/get/GetExecuteForResponseTypeRelated.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/get/GetExecuteForResponseTypeRelated.groovy deleted file mode 100644 index 991fb3bd..00000000 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/get/GetExecuteForResponseTypeRelated.groovy +++ /dev/null @@ -1,26 +0,0 @@ -package com.ofg.infrastructure.web.resttemplate.fluent.get - -import com.nurkiewicz.asyncretry.RetryExecutor -import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor -import groovy.transform.CompileStatic -import org.springframework.http.HttpMethod -import org.springframework.web.client.RestOperations - -import static org.springframework.http.HttpMethod.GET -/** - * Implementation of method execution for the {@link HttpMethod#GET} method. - * TODO Does this have to be a subclass? - */ -@CompileStatic -class GetExecuteForResponseTypeRelated extends ResponseTypeRelatedRequestsExecutor { - - GetExecuteForResponseTypeRelated(Map params, RestOperations restOperations, RetryExecutor retryExecutor, Class responseType) { - super(params, restOperations, retryExecutor, responseType) - } - - @Override - HttpMethod getHttpMethod() { - return GET - } - -} diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/get/GetMethodBuilder.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/get/GetMethodBuilder.groovy index 014e264b..97ef413c 100644 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/get/GetMethodBuilder.groovy +++ b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/get/GetMethodBuilder.groovy @@ -5,6 +5,7 @@ import com.google.common.util.concurrent.Futures import com.google.common.util.concurrent.ListenableFuture import com.nurkiewicz.asyncretry.RetryExecutor import com.nurkiewicz.asyncretry.SyncRetryExecutor +import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.BodyContainingWithHeaders import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.HeadersHaving import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.ObjectReceiving @@ -12,6 +13,7 @@ import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.Pr import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.ResponseEntityReceiving import groovy.transform.TypeChecked import org.springframework.http.HttpEntity +import org.springframework.http.HttpMethod import org.springframework.http.ResponseEntity import org.springframework.web.client.RestOperations @@ -87,7 +89,7 @@ class GetMethodBuilder implements GetMethod, UrlParameterizableGetMethod, Respon @Override public ListenableFuture ofTypeAsync(Class responseType) { - GetExecuteForResponseTypeRelated get = get(responseType) + ResponseTypeRelatedRequestsExecutor get = get(responseType) ListenableFuture> future = get.exchangeAsync() return Futures.transform(future, { ResponseEntity input -> return input?.body @@ -111,8 +113,8 @@ class GetMethodBuilder implements GetMethod, UrlParameterizableGetMethod, Respon } } - private GetExecuteForResponseTypeRelated get(Class responseType) { - return new GetExecuteForResponseTypeRelated(params, restOperations, retryExecutor, responseType) + private ResponseTypeRelatedRequestsExecutor get(Class responseType) { + return new ResponseTypeRelatedRequestsExecutor(params, restOperations, retryExecutor, responseType, HttpMethod.GET) } @Override diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/head/HeadExecuteForResponseTypeRelated.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/head/HeadExecuteForResponseTypeRelated.groovy deleted file mode 100644 index 4600a867..00000000 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/head/HeadExecuteForResponseTypeRelated.groovy +++ /dev/null @@ -1,25 +0,0 @@ -package com.ofg.infrastructure.web.resttemplate.fluent.head - -import com.nurkiewicz.asyncretry.RetryExecutor -import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor -import groovy.transform.CompileStatic -import org.springframework.http.HttpMethod -import org.springframework.web.client.RestOperations - -import static org.springframework.http.HttpMethod.HEAD -/** - * Implementation of method execution for the {@link HttpMethod#HEAD} method. - */ -@CompileStatic -class HeadExecuteForResponseTypeRelated extends ResponseTypeRelatedRequestsExecutor { - - HeadExecuteForResponseTypeRelated(Map params, RestOperations restOperations, RetryExecutor retryExecutor) { - super(params, restOperations, retryExecutor, Object) - } - - @Override - HttpMethod getHttpMethod() { - return HEAD - } - -} diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/head/HeadMethodBuilder.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/head/HeadMethodBuilder.groovy index 9dd4f1ae..8ed694a9 100644 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/head/HeadMethodBuilder.groovy +++ b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/head/HeadMethodBuilder.groovy @@ -5,12 +5,14 @@ import com.google.common.util.concurrent.Futures import com.google.common.util.concurrent.ListenableFuture import com.nurkiewicz.asyncretry.RetryExecutor import com.nurkiewicz.asyncretry.SyncRetryExecutor +import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.BodylessWithHeaders import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.HeadersHaving import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.PredefinedHttpHeaders import groovy.transform.TypeChecked import org.springframework.http.HttpEntity import org.springframework.http.HttpHeaders +import org.springframework.http.HttpMethod import org.springframework.http.ResponseEntity import org.springframework.web.client.RestOperations @@ -97,8 +99,8 @@ class HeadMethodBuilder implements HeadMethod, UrlParameterizableHeadMethod, Res return Futures.transform(future, {ResponseEntity re -> re?.headers} as Function) } - private HeadExecuteForResponseTypeRelated head() { - return new HeadExecuteForResponseTypeRelated(params, restOperations, retryExecutor) + private ResponseTypeRelatedRequestsExecutor head() { + return new ResponseTypeRelatedRequestsExecutor(params, restOperations, retryExecutor, Object, HttpMethod.HEAD) } @Override diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/options/OptionsExecuteForResponseTypeRelated.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/options/OptionsExecuteForResponseTypeRelated.groovy deleted file mode 100644 index 7b3591e9..00000000 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/options/OptionsExecuteForResponseTypeRelated.groovy +++ /dev/null @@ -1,25 +0,0 @@ -package com.ofg.infrastructure.web.resttemplate.fluent.options - -import com.nurkiewicz.asyncretry.RetryExecutor -import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor -import groovy.transform.CompileStatic -import org.springframework.http.HttpMethod -import org.springframework.web.client.RestOperations - -import static org.springframework.http.HttpMethod.OPTIONS -/** - * Implementation of method execution for the {@link HttpMethod#OPTIONS} method. - */ -@CompileStatic -class OptionsExecuteForResponseTypeRelated extends ResponseTypeRelatedRequestsExecutor { - - OptionsExecuteForResponseTypeRelated(Map params, RestOperations restOperations, RetryExecutor retryExecutor, Class responseType) { - super(params, restOperations, retryExecutor, responseType) - } - - @Override - HttpMethod getHttpMethod() { - return OPTIONS - } - -} diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/options/OptionsMethodBuilder.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/options/OptionsMethodBuilder.groovy index 153dddba..05a812f0 100644 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/options/OptionsMethodBuilder.groovy +++ b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/options/OptionsMethodBuilder.groovy @@ -5,6 +5,7 @@ import com.google.common.util.concurrent.Futures import com.google.common.util.concurrent.ListenableFuture import com.nurkiewicz.asyncretry.RetryExecutor import com.nurkiewicz.asyncretry.SyncRetryExecutor +import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.HeadersHaving import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.ObjectReceiving import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.PredefinedHttpHeaders @@ -16,6 +17,7 @@ import org.springframework.http.ResponseEntity import org.springframework.web.client.RestOperations import static com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.PredefinedHttpHeaders.NO_PREDEFINED_HEADERS +import static org.springframework.http.HttpMethod.OPTIONS /** * Implementation of the {@link org.springframework.http.HttpMethod#HEAD method} fluent API @@ -117,8 +119,8 @@ class OptionsMethodBuilder implements } } - private OptionsExecuteForResponseTypeRelated options(Class responseType) { - return new OptionsExecuteForResponseTypeRelated(params, restOperations, retryExecutor, responseType) + private ResponseTypeRelatedRequestsExecutor options(Class responseType) { + return new ResponseTypeRelatedRequestsExecutor(params, restOperations, retryExecutor, responseType, OPTIONS) } @Override diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/post/PostExecuteForResponseTypeRelated.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/post/PostExecuteForResponseTypeRelated.groovy deleted file mode 100644 index 07efaa2a..00000000 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/post/PostExecuteForResponseTypeRelated.groovy +++ /dev/null @@ -1,25 +0,0 @@ -package com.ofg.infrastructure.web.resttemplate.fluent.post - -import com.nurkiewicz.asyncretry.RetryExecutor -import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor -import groovy.transform.CompileStatic -import org.springframework.http.HttpMethod -import org.springframework.web.client.RestOperations - -import static org.springframework.http.HttpMethod.POST -/** - * Implementation of method execution for the {@link HttpMethod#POST} method. - */ -@CompileStatic -class PostExecuteForResponseTypeRelated extends ResponseTypeRelatedRequestsExecutor { - - PostExecuteForResponseTypeRelated(Map params, RestOperations restOperations, RetryExecutor retryExecutor, Class responseType) { - super(params, restOperations, retryExecutor, responseType) - } - - @Override - HttpMethod getHttpMethod() { - return POST - } - -} diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/post/PostMethodBuilder.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/post/PostMethodBuilder.groovy index 1865bccf..881a58f7 100644 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/post/PostMethodBuilder.groovy +++ b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/post/PostMethodBuilder.groovy @@ -6,6 +6,7 @@ import com.google.common.util.concurrent.ListenableFuture import com.nurkiewicz.asyncretry.RetryExecutor import com.nurkiewicz.asyncretry.SyncRetryExecutor import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.LocationFindingExecutor +import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.BodyContainingWithHeaders import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.HeadersSetting import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.ObjectReceiving @@ -127,8 +128,8 @@ class PostMethodBuilder extends LocationFindingExecutor implements } } - private PostExecuteForResponseTypeRelated post(Class responseType) { - return new PostExecuteForResponseTypeRelated(params, restOperations, retryExecutor, responseType) + private ResponseTypeRelatedRequestsExecutor post(Class responseType) { + return new ResponseTypeRelatedRequestsExecutor(params, restOperations, retryExecutor, responseType, POST) } @Override diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/put/PutExecuteForResponseTypeRelated.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/put/PutExecuteForResponseTypeRelated.groovy deleted file mode 100644 index f54a63be..00000000 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/put/PutExecuteForResponseTypeRelated.groovy +++ /dev/null @@ -1,26 +0,0 @@ -package com.ofg.infrastructure.web.resttemplate.fluent.put - -import com.nurkiewicz.asyncretry.RetryExecutor -import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor -import groovy.transform.CompileStatic -import org.springframework.http.HttpMethod -import org.springframework.web.client.RestOperations - -import static org.springframework.http.HttpMethod.PUT - -/** - * Implementation of method execution for the {@link HttpMethod#PUT} method. - */ -@CompileStatic -class PutExecuteForResponseTypeRelated extends ResponseTypeRelatedRequestsExecutor { - - PutExecuteForResponseTypeRelated(Map params, RestOperations restOperations, RetryExecutor retryExecutor, Class responseType) { - super(params, restOperations, retryExecutor, responseType) - } - - @Override - HttpMethod getHttpMethod() { - return PUT - } - -} diff --git a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/put/PutMethodBuilder.groovy b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/put/PutMethodBuilder.groovy index 72867a39..96fab22a 100644 --- a/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/put/PutMethodBuilder.groovy +++ b/micro-infra-spring-base/src/main/groovy/com/ofg/infrastructure/web/resttemplate/fluent/put/PutMethodBuilder.groovy @@ -6,6 +6,7 @@ import com.google.common.util.concurrent.ListenableFuture import com.nurkiewicz.asyncretry.RetryExecutor import com.nurkiewicz.asyncretry.SyncRetryExecutor import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.LocationFindingExecutor +import com.ofg.infrastructure.web.resttemplate.fluent.common.response.executor.ResponseTypeRelatedRequestsExecutor import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.BodyContainingWithHeaders import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.HeadersSetting import com.ofg.infrastructure.web.resttemplate.fluent.common.response.receive.ObjectReceiving @@ -128,8 +129,8 @@ class PutMethodBuilder extends LocationFindingExecutor implements } } - private PutExecuteForResponseTypeRelated put(Class responseType) { - return new PutExecuteForResponseTypeRelated(params, restOperations, retryExecutor, responseType) + private ResponseTypeRelatedRequestsExecutor put(Class responseType) { + return new ResponseTypeRelatedRequestsExecutor(params, restOperations, retryExecutor, responseType, PUT) } @Override