From da277f6a13133f064ef6ef5f2c012da8f1439f63 Mon Sep 17 00:00:00 2001 From: Filip Hrisafov Date: Wed, 2 Aug 2023 11:21:44 +0200 Subject: [PATCH] Remove activity specific information from HttpRequest --- .../http/DefaultCmmnHttpActivityDelegate.java | 8 +- .../http/DefaultBpmnHttpActivityDelegate.java | 8 +- .../flowable/http/common/api/HttpRequest.java | 72 -------- .../common/impl/BaseHttpActivityDelegate.java | 158 ++++++++++++++---- .../java/org/flowable/http/HttpRequest.java | 113 ------------- .../org/flowable/http/HttpRequestTest.java | 64 ------- 6 files changed, 133 insertions(+), 290 deletions(-) diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/http/DefaultCmmnHttpActivityDelegate.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/http/DefaultCmmnHttpActivityDelegate.java index 2f4d36454be..16d3b956c5e 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/http/DefaultCmmnHttpActivityDelegate.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/http/DefaultCmmnHttpActivityDelegate.java @@ -65,7 +65,7 @@ protected FlowableHttpClient createHttpClient() { @Override public CompletableFuture execute(DelegatePlanItemInstance planItemInstance, AsyncTaskInvoker taskInvoker) { - HttpRequest request; + RequestData request; HttpServiceTask httpServiceTask = (HttpServiceTask) planItemInstance.getPlanItemDefinition(); try { @@ -83,11 +83,11 @@ public CompletableFuture execute(DelegatePlanItemInstance planIte HttpRequestHandler httpRequestHandler = createHttpRequestHandler(httpServiceTask.getHttpRequestHandler(), cmmnEngineConfiguration); if (httpRequestHandler != null) { - httpRequestHandler.handleHttpRequest(planItemInstance, request, null); + httpRequestHandler.handleHttpRequest(planItemInstance, request.getHttpRequest(), null); } // Validate request - validateRequest(request); + validateRequest(request.getHttpRequest()); boolean parallelInSameTransaction; if (httpServiceTask.getParallelInSameTransaction() != null) { @@ -102,7 +102,7 @@ public CompletableFuture execute(DelegatePlanItemInstance planIte @Override public void afterExecution(DelegatePlanItemInstance planItemInstance, ExecutionData result) { - HttpRequest request = result.getRequest(); + RequestData request = result.getRequest(); HttpResponse response = result.getResponse(); Throwable resultException = result.getException(); diff --git a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/http/DefaultBpmnHttpActivityDelegate.java b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/http/DefaultBpmnHttpActivityDelegate.java index 42d57d62943..3f8ed3725d6 100644 --- a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/http/DefaultBpmnHttpActivityDelegate.java +++ b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/http/DefaultBpmnHttpActivityDelegate.java @@ -77,7 +77,7 @@ protected FlowableHttpClient createHttpClient() { @Override public CompletableFuture execute(DelegateExecution execution, AsyncTaskInvoker taskInvoker) { - HttpRequest request; + RequestData request; HttpServiceTask httpServiceTask = (HttpServiceTask) execution.getCurrentFlowElement(); try { @@ -95,11 +95,11 @@ public CompletableFuture execute(DelegateExecution execution, Asy HttpRequestHandler httpRequestHandler = createHttpRequestHandler(httpServiceTask.getHttpRequestHandler(), processEngineConfiguration); if (httpRequestHandler != null) { - httpRequestHandler.handleHttpRequest(execution, request, null); + httpRequestHandler.handleHttpRequest(execution, request.getHttpRequest(), null); } // Validate request - validateRequest(request); + validateRequest(request.getHttpRequest()); boolean parallelInSameTransaction; if (httpServiceTask.getParallelInSameTransaction() != null) { @@ -114,7 +114,7 @@ public CompletableFuture execute(DelegateExecution execution, Asy @Override public void afterExecution(DelegateExecution execution, ExecutionData result) { - HttpRequest request = result.getRequest(); + RequestData request = result.getRequest(); HttpResponse response = result.getResponse(); Throwable resultException = result.getException(); diff --git a/modules/flowable-http-common/src/main/java/org/flowable/http/common/api/HttpRequest.java b/modules/flowable-http-common/src/main/java/org/flowable/http/common/api/HttpRequest.java index 3774e31c0d1..5730883ea17 100644 --- a/modules/flowable-http-common/src/main/java/org/flowable/http/common/api/HttpRequest.java +++ b/modules/flowable-http-common/src/main/java/org/flowable/http/common/api/HttpRequest.java @@ -14,7 +14,6 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Set; import org.flowable.common.engine.api.FlowableIllegalStateException; @@ -31,14 +30,6 @@ public class HttpRequest { protected Collection multiValueParts; protected int timeout; protected boolean noRedirects; - protected Set failCodes; - protected Set handleCodes; - protected boolean ignoreErrors; - protected boolean saveRequest; - protected boolean saveResponse; - protected boolean saveResponseTransient; - protected boolean saveResponseAsJson; - protected String prefix; public String getMethod() { return method; @@ -118,67 +109,4 @@ public void setNoRedirects(boolean noRedirects) { this.noRedirects = noRedirects; } - public Set getFailCodes() { - return failCodes; - } - - public void setFailCodes(Set failCodes) { - this.failCodes = failCodes; - } - - public Set getHandleCodes() { - return handleCodes; - } - - public void setHandleCodes(Set handleCodes) { - this.handleCodes = handleCodes; - } - - public boolean isIgnoreErrors() { - return ignoreErrors; - } - - public void setIgnoreErrors(boolean ignoreErrors) { - this.ignoreErrors = ignoreErrors; - } - - public boolean isSaveRequest() { - return saveRequest; - } - - public void setSaveRequest(boolean saveRequest) { - this.saveRequest = saveRequest; - } - - public boolean isSaveResponse() { - return saveResponse; - } - - public void setSaveResponse(boolean saveResponse) { - this.saveResponse = saveResponse; - } - - public boolean isSaveResponseTransient() { - return saveResponseTransient; - } - - public void setSaveResponseTransient(boolean saveResponseTransient) { - this.saveResponseTransient = saveResponseTransient; - } - - public boolean isSaveResponseAsJson() { - return saveResponseAsJson; - } - - public void setSaveResponseAsJson(boolean saveResponseAsJson) { - this.saveResponseAsJson = saveResponseAsJson; - } - - public String getPrefix() { - return prefix; - } - - public void setPrefix(String prefix) { - this.prefix = prefix; - } } diff --git a/modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/BaseHttpActivityDelegate.java b/modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/BaseHttpActivityDelegate.java index cbdeea2ca8d..f05b349d214 100644 --- a/modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/BaseHttpActivityDelegate.java +++ b/modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/BaseHttpActivityDelegate.java @@ -89,8 +89,10 @@ public BaseHttpActivityDelegate(FlowableHttpClient httpClient) { protected abstract FlowableHttpClient createHttpClient(); - protected HttpRequest createRequest(VariableContainer variableContainer, String prefix) { + protected RequestData createRequest(VariableContainer variableContainer, String fallbackPrefix) { HttpRequest request = new HttpRequest(); + RequestData requestData = new RequestData(); + requestData.setHttpRequest(request); request.setMethod(ExpressionUtils.getStringFromField(requestMethod, variableContainer)); request.setUrl(ExpressionUtils.getStringFromField(requestUrl, variableContainer)); @@ -99,46 +101,47 @@ protected HttpRequest createRequest(VariableContainer variableContainer, String request.setBodyEncoding(ExpressionUtils.getStringFromField(requestBodyEncoding, variableContainer)); request.setTimeout(ExpressionUtils.getIntFromField(requestTimeout, variableContainer)); request.setNoRedirects(ExpressionUtils.getBooleanFromField(disallowRedirects, variableContainer)); - request.setIgnoreErrors(ExpressionUtils.getBooleanFromField(ignoreException, variableContainer)); - request.setSaveRequest(ExpressionUtils.getBooleanFromField(saveRequestVariables, variableContainer)); - request.setSaveResponse(ExpressionUtils.getBooleanFromField(saveResponseParameters, variableContainer)); - request.setSaveResponseTransient(ExpressionUtils.getBooleanFromField(saveResponseParametersTransient, variableContainer)); - request.setSaveResponseAsJson(ExpressionUtils.getBooleanFromField(saveResponseVariableAsJson, variableContainer)); - request.setPrefix(ExpressionUtils.getStringFromField(resultVariablePrefix, variableContainer)); + requestData.setIgnoreErrors(ExpressionUtils.getBooleanFromField(ignoreException, variableContainer)); + requestData.setSaveRequest(ExpressionUtils.getBooleanFromField(saveRequestVariables, variableContainer)); + requestData.setSaveResponse(ExpressionUtils.getBooleanFromField(saveResponseParameters, variableContainer)); + requestData.setSaveResponseTransient(ExpressionUtils.getBooleanFromField(saveResponseParametersTransient, variableContainer)); + requestData.setSaveResponseAsJson(ExpressionUtils.getBooleanFromField(saveResponseVariableAsJson, variableContainer)); + requestData.setPrefix(ExpressionUtils.getStringFromField(resultVariablePrefix, variableContainer)); String failCodes = ExpressionUtils.getStringFromField(failStatusCodes, variableContainer); String handleCodes = ExpressionUtils.getStringFromField(handleStatusCodes, variableContainer); if (failCodes != null) { - request.setFailCodes(ExpressionUtils.getStringSetFromField(failCodes)); + requestData.setFailCodes(ExpressionUtils.getStringSetFromField(failCodes)); } if (handleCodes != null) { - request.setHandleCodes(ExpressionUtils.getStringSetFromField(handleCodes)); + requestData.setHandleCodes(ExpressionUtils.getStringSetFromField(handleCodes)); } - if (request.getPrefix() == null) { - request.setPrefix(prefix); + if (requestData.getPrefix() == null) { + requestData.setPrefix(fallbackPrefix); } // Save request fields - if (request.isSaveRequest()) { - variableContainer.setVariable(request.getPrefix() + "RequestMethod", request.getMethod()); - variableContainer.setVariable(request.getPrefix() + "RequestUrl", request.getUrl()); - variableContainer.setVariable(request.getPrefix() + "RequestHeaders", request.getHttpHeadersAsString()); - variableContainer.setVariable(request.getPrefix() + "RequestBody", request.getBody()); - variableContainer.setVariable(request.getPrefix() + "RequestBodyEncoding", request.getBodyEncoding()); - variableContainer.setVariable(request.getPrefix() + "RequestTimeout", request.getTimeout()); - variableContainer.setVariable(request.getPrefix() + "DisallowRedirects", request.isNoRedirects()); - variableContainer.setVariable(request.getPrefix() + "FailStatusCodes", failCodes); - variableContainer.setVariable(request.getPrefix() + "HandleStatusCodes", handleCodes); - variableContainer.setVariable(request.getPrefix() + "IgnoreException", request.isIgnoreErrors()); - variableContainer.setVariable(request.getPrefix() + "SaveRequestVariables", request.isSaveRequest()); - variableContainer.setVariable(request.getPrefix() + "SaveResponseParameters", request.isSaveResponse()); - } - return request; + if (requestData.isSaveRequest()) { + String prefix = requestData.getPrefix(); + variableContainer.setVariable(prefix + "RequestMethod", request.getMethod()); + variableContainer.setVariable(prefix + "RequestUrl", request.getUrl()); + variableContainer.setVariable(prefix + "RequestHeaders", request.getHttpHeadersAsString()); + variableContainer.setVariable(prefix + "RequestBody", request.getBody()); + variableContainer.setVariable(prefix + "RequestBodyEncoding", request.getBodyEncoding()); + variableContainer.setVariable(prefix + "RequestTimeout", request.getTimeout()); + variableContainer.setVariable(prefix + "DisallowRedirects", request.isNoRedirects()); + variableContainer.setVariable(prefix + "FailStatusCodes", failCodes); + variableContainer.setVariable(prefix + "HandleStatusCodes", handleCodes); + variableContainer.setVariable(prefix + "IgnoreException", requestData.isIgnoreErrors()); + variableContainer.setVariable(prefix + "SaveRequestVariables", requestData.isSaveRequest()); + variableContainer.setVariable(prefix + "SaveResponseParameters", requestData.isSaveResponse()); + } + return requestData; } - protected void saveResponseFields(VariableContainer variableContainer, HttpRequest request, HttpResponse response, ObjectMapper objectMapper) + protected void saveResponseFields(VariableContainer variableContainer, RequestData request, HttpResponse response, ObjectMapper objectMapper) throws IOException { // Save response fields if (response != null) { @@ -202,8 +205,8 @@ protected void saveResponseFields(VariableContainer variableContainer, HttpReque } } - protected CompletableFuture prepareAndExecuteRequest(HttpRequest request, boolean parallelInSameTransaction, AsyncTaskInvoker taskInvoker) { - ExecutableHttpRequest httpRequest = httpClient.prepareRequest(request); + protected CompletableFuture prepareAndExecuteRequest(RequestData request, boolean parallelInSameTransaction, AsyncTaskInvoker taskInvoker) { + ExecutableHttpRequest httpRequest = httpClient.prepareRequest(request.getHttpRequest()); if (!parallelInSameTransaction) { CompletableFuture future = new CompletableFuture<>(); @@ -264,21 +267,21 @@ protected HttpHeaders getRequestHeaders(VariableContainer variableContainer) { public static class ExecutionData { - protected HttpRequest request; + protected RequestData request; protected HttpResponse response; protected Throwable exception; - public ExecutionData(HttpRequest request, HttpResponse response) { + public ExecutionData(RequestData request, HttpResponse response) { this(request, response, null); } - public ExecutionData(HttpRequest request, HttpResponse response, Throwable exception) { + public ExecutionData(RequestData request, HttpResponse response, Throwable exception) { this.request = request; this.response = response; this.exception = exception; } - public HttpRequest getRequest() { + public RequestData getRequest() { return request; } @@ -290,4 +293,93 @@ public Throwable getException() { return exception; } } + + public static class RequestData { + + protected HttpRequest httpRequest; + protected Set failCodes; + protected Set handleCodes; + protected boolean ignoreErrors; + protected boolean saveRequest; + protected boolean saveResponse; + protected boolean saveResponseTransient; + protected boolean saveResponseAsJson; + protected String prefix; + + public HttpRequest getHttpRequest() { + return httpRequest; + } + + public void setHttpRequest(HttpRequest httpRequest) { + this.httpRequest = httpRequest; + } + + public Set getFailCodes() { + return failCodes; + } + + public void setFailCodes(Set failCodes) { + this.failCodes = failCodes; + } + + public Set getHandleCodes() { + return handleCodes; + } + + public void setHandleCodes(Set handleCodes) { + this.handleCodes = handleCodes; + } + + public boolean isIgnoreErrors() { + return ignoreErrors; + } + + public void setIgnoreErrors(boolean ignoreErrors) { + this.ignoreErrors = ignoreErrors; + } + + public boolean isSaveRequest() { + return saveRequest; + } + + public void setSaveRequest(boolean saveRequest) { + this.saveRequest = saveRequest; + } + + public boolean isSaveResponse() { + return saveResponse; + } + + public void setSaveResponse(boolean saveResponse) { + this.saveResponse = saveResponse; + } + + public boolean isSaveResponseTransient() { + return saveResponseTransient; + } + + public void setSaveResponseTransient(boolean saveResponseTransient) { + this.saveResponseTransient = saveResponseTransient; + } + + public boolean isSaveResponseAsJson() { + return saveResponseAsJson; + } + + public void setSaveResponseAsJson(boolean saveResponseAsJson) { + this.saveResponseAsJson = saveResponseAsJson; + } + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public boolean isNoRedirects() { + return httpRequest.isNoRedirects(); + } + } } diff --git a/modules/flowable-http/src/main/java/org/flowable/http/HttpRequest.java b/modules/flowable-http/src/main/java/org/flowable/http/HttpRequest.java index 066efe8fd03..eb9f9a2a67b 100644 --- a/modules/flowable-http/src/main/java/org/flowable/http/HttpRequest.java +++ b/modules/flowable-http/src/main/java/org/flowable/http/HttpRequest.java @@ -13,7 +13,6 @@ package org.flowable.http; import java.util.Collection; -import java.util.Set; import org.flowable.http.common.api.HttpHeaders; import org.flowable.http.common.api.MultiValuePart; @@ -174,118 +173,6 @@ public void setNoRedirects(boolean noRedirects) { } } - @Override - public Set getFailCodes() { - return delegate != null ? delegate.getFailCodes() : super.getFailCodes(); - } - - @Override - public void setFailCodes(Set failCodes) { - if (delegate != null) { - delegate.setFailCodes(failCodes); - } else { - super.setFailCodes(failCodes); - } - } - - @Override - public Set getHandleCodes() { - return delegate != null ? delegate.getHandleCodes() : super.getHandleCodes(); - } - - @Override - public void setHandleCodes(Set handleCodes) { - if (delegate != null) { - delegate.setHandleCodes(handleCodes); - } else { - super.setHandleCodes(handleCodes); - } - } - - @Override - public boolean isIgnoreErrors() { - return delegate != null ? delegate.isIgnoreErrors() : super.isIgnoreErrors(); - } - - @Override - public void setIgnoreErrors(boolean ignoreErrors) { - if (delegate != null) { - delegate.setIgnoreErrors(ignoreErrors); - } else { - super.setIgnoreErrors(ignoreErrors); - } - } - - @Override - public boolean isSaveRequest() { - return delegate != null ? delegate.isSaveRequest() : super.isSaveRequest(); - } - - @Override - public void setSaveRequest(boolean saveRequest) { - if (delegate != null) { - delegate.setSaveRequest(saveRequest); - } else { - super.setSaveRequest(saveRequest); - } - } - - @Override - public boolean isSaveResponse() { - return delegate != null ? delegate.isSaveResponse() : super.isSaveResponse(); - } - - @Override - public void setSaveResponse(boolean saveResponse) { - if (delegate != null) { - delegate.setSaveResponse(saveResponse); - } else { - super.setSaveResponse(saveResponse); - } - } - - @Override - public boolean isSaveResponseTransient() { - return delegate != null ? delegate.isSaveResponseTransient() : super.isSaveResponseTransient(); - } - - @Override - public void setSaveResponseTransient(boolean saveResponseTransient) { - if (delegate != null) { - delegate.setSaveResponseTransient(saveResponseTransient); - } else { - super.setSaveResponseTransient(saveResponseTransient); - } - } - - @Override - public boolean isSaveResponseAsJson() { - return delegate != null ? delegate.isSaveResponseAsJson() : super.isSaveResponseAsJson(); - } - - @Override - public void setSaveResponseAsJson(boolean saveResponseAsJson) { - if (delegate != null) { - delegate.setSaveResponseAsJson(saveResponseAsJson); - } else { - super.setSaveResponseAsJson(saveResponseAsJson); - } - } - - @Override - public String getPrefix() { - return delegate != null ? delegate.getPrefix() : super.getPrefix(); - } - - @Override - public void setPrefix(String prefix) { - if (delegate != null) { - delegate.setPrefix(prefix); - } else { - super.setPrefix(prefix); - } - } - public static HttpRequest fromApiHttpRequest(org.flowable.http.common.api.HttpRequest request) { return new HttpRequest(request); } diff --git a/modules/flowable-http/src/test/java/org/flowable/http/HttpRequestTest.java b/modules/flowable-http/src/test/java/org/flowable/http/HttpRequestTest.java index 8e1c99f7be0..60469f81fcc 100644 --- a/modules/flowable-http/src/test/java/org/flowable/http/HttpRequestTest.java +++ b/modules/flowable-http/src/test/java/org/flowable/http/HttpRequestTest.java @@ -38,14 +38,6 @@ void testHttpRequestWithoutApiHttpRequestDelegate() { assertThat(request.getBodyEncoding()).isNull(); assertThat(request.getTimeout()).isEqualTo(0); assertThat(request.isNoRedirects()).isFalse(); - assertThat(request.getFailCodes()).isNull(); - assertThat(request.getHandleCodes()).isNull(); - assertThat(request.isIgnoreErrors()).isFalse(); - assertThat(request.isSaveRequest()).isFalse(); - assertThat(request.isSaveResponse()).isFalse(); - assertThat(request.isSaveResponseTransient()).isFalse(); - assertThat(request.isSaveResponseAsJson()).isFalse(); - assertThat(request.getPrefix()).isNull(); request.setMethod("GET"); request.setUrl("flowable.org"); @@ -55,14 +47,6 @@ void testHttpRequestWithoutApiHttpRequestDelegate() { request.setBodyEncoding("UTF-8"); request.setTimeout(1000); request.setNoRedirects(true); - request.setFailCodes(Collections.singleton("5xx")); - request.setHandleCodes(Collections.singleton("4xx")); - request.setIgnoreErrors(true); - request.setSaveRequest(true); - request.setSaveResponse(true); - request.setSaveResponseTransient(true); - request.setSaveResponseAsJson(true); - request.setPrefix("prefix"); assertThat(request.getMethod()).isEqualTo("GET"); assertThat(request.getUrl()).isEqualTo("flowable.org"); @@ -71,14 +55,6 @@ void testHttpRequestWithoutApiHttpRequestDelegate() { assertThat(request.getBodyEncoding()).isEqualTo("UTF-8"); assertThat(request.getTimeout()).isEqualTo(1000); assertThat(request.isNoRedirects()).isTrue(); - assertThat(request.getFailCodes()).containsExactly("5xx"); - assertThat(request.getHandleCodes()).containsExactlyInAnyOrder("4xx"); - assertThat(request.isIgnoreErrors()).isTrue(); - assertThat(request.isSaveRequest()).isTrue(); - assertThat(request.isSaveResponse()).isTrue(); - assertThat(request.isSaveResponseTransient()).isTrue(); - assertThat(request.isSaveResponseAsJson()).isTrue(); - assertThat(request.getPrefix()).isEqualTo("prefix"); } @Test @@ -92,14 +68,6 @@ void testHttpRequestWithApiHttpRequestDelegate() { assertThat(apiRequest.getBodyEncoding()).isNull(); assertThat(apiRequest.getTimeout()).isEqualTo(0); assertThat(apiRequest.isNoRedirects()).isFalse(); - assertThat(apiRequest.getFailCodes()).isNull(); - assertThat(apiRequest.getHandleCodes()).isNull(); - assertThat(apiRequest.isIgnoreErrors()).isFalse(); - assertThat(apiRequest.isSaveRequest()).isFalse(); - assertThat(apiRequest.isSaveResponse()).isFalse(); - assertThat(apiRequest.isSaveResponseTransient()).isFalse(); - assertThat(apiRequest.isSaveResponseAsJson()).isFalse(); - assertThat(apiRequest.getPrefix()).isNull(); HttpRequest request = HttpRequest.fromApiHttpRequest(apiRequest); @@ -110,14 +78,6 @@ void testHttpRequestWithApiHttpRequestDelegate() { assertThat(request.getBodyEncoding()).isNull(); assertThat(request.getTimeout()).isEqualTo(0); assertThat(request.isNoRedirects()).isFalse(); - assertThat(request.getFailCodes()).isNull(); - assertThat(request.getHandleCodes()).isNull(); - assertThat(request.isIgnoreErrors()).isFalse(); - assertThat(request.isSaveRequest()).isFalse(); - assertThat(request.isSaveResponse()).isFalse(); - assertThat(request.isSaveResponseTransient()).isFalse(); - assertThat(request.isSaveResponseAsJson()).isFalse(); - assertThat(request.getPrefix()).isNull(); request.setMethod("GET"); request.setUrl("flowable.org"); @@ -127,14 +87,6 @@ void testHttpRequestWithApiHttpRequestDelegate() { request.setBodyEncoding("UTF-8"); request.setTimeout(1000); request.setNoRedirects(true); - request.setFailCodes(Collections.singleton("5xx")); - request.setHandleCodes(Collections.singleton("4xx")); - request.setIgnoreErrors(true); - request.setSaveRequest(true); - request.setSaveResponse(true); - request.setSaveResponseTransient(true); - request.setSaveResponseAsJson(true); - request.setPrefix("prefix"); assertThat(request.getMethod()).isEqualTo("GET"); assertThat(request.getUrl()).isEqualTo("flowable.org"); @@ -143,14 +95,6 @@ void testHttpRequestWithApiHttpRequestDelegate() { assertThat(request.getBodyEncoding()).isEqualTo("UTF-8"); assertThat(request.getTimeout()).isEqualTo(1000); assertThat(request.isNoRedirects()).isTrue(); - assertThat(request.getFailCodes()).containsExactly("5xx"); - assertThat(request.getHandleCodes()).containsExactlyInAnyOrder("4xx"); - assertThat(request.isIgnoreErrors()).isTrue(); - assertThat(request.isSaveRequest()).isTrue(); - assertThat(request.isSaveResponse()).isTrue(); - assertThat(request.isSaveResponseTransient()).isTrue(); - assertThat(request.isSaveResponseAsJson()).isTrue(); - assertThat(request.getPrefix()).isEqualTo("prefix"); assertThat(apiRequest.getMethod()).isEqualTo("GET"); assertThat(apiRequest.getUrl()).isEqualTo("flowable.org"); @@ -159,14 +103,6 @@ void testHttpRequestWithApiHttpRequestDelegate() { assertThat(apiRequest.getBodyEncoding()).isEqualTo("UTF-8"); assertThat(apiRequest.getTimeout()).isEqualTo(1000); assertThat(apiRequest.isNoRedirects()).isTrue(); - assertThat(apiRequest.getFailCodes()).containsExactly("5xx"); - assertThat(apiRequest.getHandleCodes()).containsExactlyInAnyOrder("4xx"); - assertThat(apiRequest.isIgnoreErrors()).isTrue(); - assertThat(apiRequest.isSaveRequest()).isTrue(); - assertThat(apiRequest.isSaveResponse()).isTrue(); - assertThat(apiRequest.isSaveResponseTransient()).isTrue(); - assertThat(apiRequest.isSaveResponseAsJson()).isTrue(); - assertThat(apiRequest.getPrefix()).isEqualTo("prefix"); } }