-
Task
-
Resolution: Done
-
Major
-
None
-
None
At the moment, we have some client stubs with hard-coded values that are activated when a concrete property is enabled (for example: rhsm-subscriptions.XX.use-stub=true). Then, we have a “factory bean” that will inject the stub client or the real one:
@ApplicationScoped @Produces @ContractsClient public DefaultApi getApi( @ConfigProperty(name = "rhsm-subscriptions.contracts.use-stub", defaultValue = "false") boolean useStub, @RestClient DefaultApi contractsApi) { if (useStub) { return new StubContractsApi(); } return contractsApi; }
Then, we need to use the “@ContractsClient” qualifier, to inject the client in our services:
@Inject
@ContractsClient
public DefaultApi client;
When using the Quarkus Resteasy REST Client extension, this solution does not work any longer because it will only generate one client, so having the stub in place, will cause the real client not to be generated.
Therefore, we need to move the stubs into wiremock.
Acceptance Criteria
- Remove stubs for Quarkus clients
- Remove no longer used "XX.use-stub" properties
- Move the stubs into the wiremock instance that is started in docker-compose.yml, and add some documentation about how to use these mocks.
- Verify that USE STUBS isn't being used in ClowdApp templates or ephemeral. If it is, we'll need to configure that wiremock too. This can be done as part of this card.
- blocks
-
SWATCH-3529 Migrate Quarkus Resteasy Reactive to Quarkus Resteasy extensions
-
- Closed
-