Details
-
Task
-
Status: Closed (View Workflow)
-
P2
-
Resolution: Done
-
None
-
-
CP: sprint 111, CP: sprint 112
-
2
-
Core: Platform
Description
Deprecate HttpClientInterface. It is based on java.util.concurrent.CompletableFuture.
RMB based modules should use Vert.x WebClient instead that is based on io.vertx.core.Future.
Vert.x futurisation makes using Future more easy and concise: https://github.com/folio-org/raml-module-builder/blob/master/doc/futurisation.md
RMB has
- HttpClientInterface
- HttpModuleClient2 implements HttpClientInterface
- HttpClientMock2 implements HttpClientInterface
- HttpClientFactory returning HttpClientInterface (either HttpClientMock2 or HttpModuleClient2)
RestVerticle sets HttpClientMock2.MOCK_MODE, HttpClientFactory reads it.
RMB based modules should use vertx.createHttpServer() to mock a server, or use mockito (or any other mocking possibility) to mock WebClient.
There are no plans to remove these classes yet. Deprecation only to discourage usage.
This was discussed on raml-module-builder slack channel on August 28, 2020 and nobody disagreed.
Tasks:
Deprecate HttpClientInterface, HttpModuleClient2, HttpClientMock2, HttpClientFactory.
Add the @Deprecated annotation to each of them.
Add a @deprecated Javadoc tag to each of them explaining what to use instead.
Explain the deprecation and possible replacements in the RMB upgrading notes.
Rewrite the README section that mentions these deprecated classes.
TestRail: Results
Attachments
Issue Links
- relates to
-
MODORDERS-724 Replace use of deprecated class HttpClientFactory
-
- Closed
-
-
RMB-609 Migrate RMB to Vert.x 4
-
- Closed
-
-
RMB-763 Migrate RMB to Vert.x 4 (development)
-
- Closed
-
-
RMB-247 OkapiUrl with scheme and path in HttpModuleClient* HttpClient*
-
- Open
-
-
RMB-811 HttpClientFactory mock can never be unset
-
- Closed
-