Both the OperationRequestFactory and OperationResponseFactory leads to unnecessary code in custom pre-processors:
new OperationRequestFactory().create(
uri,
request.getMethod(),
request.getContent(),
headers,
request.getParts(),
cookies
);
A possible way to simplify the request creation is to use the Builder design pattern:
new OperationRequestBuider(request)
.withUri(uri)
.withHeaders(headers)
.withCookies(cookies)
.build();
The OperationRequestBuilder will builds the new request using the request argument fields as defaults, like a StringBuilder.
Both the
OperationRequestFactoryandOperationResponseFactoryleads to unnecessary code in custom pre-processors:A possible way to simplify the request creation is to use the Builder design pattern:
The
OperationRequestBuilderwill builds the new request using the request argument fields as defaults, like aStringBuilder.