SWATCH-1969: Generate an export service client from the openapi spec #2932
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira issue: SWATCH-1969
Description
In order for swatch to communicate with the export-service, we want to use their openapi spec to generate swatch client code - like we do with other external services (subscription, entitlement gateway, product service, etc.)
Spec: https://raw.githubusercontent.com/RedHatInsights/export-service-go/main/static/spec/private.yaml
In addition to the client, I also added a stub version of the client.
Testing
Added integration tests with Wiremock to ensure the communication is working fine. Further testing must be done when using the client in our export service.
Test with export service locally:
1.- Clone the repository:
2.- Start the export service:
3.- Create a dummy export request:
4.- Copy this file to clients/export-client/src/test/resources.
5.- Add the following test case in ExportApiClientFactoryTest:
6.- Run the test and you should see the following trace in the export service (from step 2):