JIRA: https://issues.redhat.com/browse/QQE-343 PR: quarkus-qe/quarkus-test-suite#1599
The test scope includes validating Quarkus's capability to handle non-JSON payloads in REST endpoints. For this testing scope I will choose some of them, for instance XML, YAML and images. Tests will cover both JVM and Native mode executions.
1. XML Payload Scenario:
* Verify the endpoint's ability to consume and produce XML payloads.
* Send a request with an XML payload to the endpoint.
* Validate the response, ensuring it matches the expected XML Schema.
2. YAML Payload Scenario:
* Check the endpoint's ability to return payload from a YAML file.
* Send a request with a YAML payload from a file to an endpoint.
* Validate the response, ensuring it matches the expected YAML content.
3. Image Payload Scenario:
* Verify the endpoint's ability to return an image by making a GET request.
* Send an image in a multipart form to the endpoint.
* Check the endpoint's handling of image upload as part of a multipart form by making a POST request.
New tests will be added inside http/http-advance-reactive module.
After the new test classes introduced in http/http-advanced-reactive module the execution in JVM was only increased by seconds:
[INFO] Quarkus QE TS: HTTP: advanced-reactive ............. SUCCESS [03:07 min]
(result from https://github.com/quarkus-qe/quarkus-test-suite/actions/runs/7673741087/job/20917606017?pr=1599).
Following actions were taken to ensure familiarity:
- Experiment with Quarkus REST functionalities for providing and consuming non-JSON payload (XML, YAML, images)
- Take a look and understand the Quarkus REST guides related to.
To handle YAML files, it was necessary to create a YAML Provider that implements MessageBodyReader and MessageBodyWriter to map the DTO used, enabling the serialization and deserialization of YAML data for the DTO (CityListDTO). Essentially, MessageBodyReader/MessageBodyWriter allows for the conversion of YAML streams into Java objects and vice versa. See YamlProvider class for more details.
- Feature epic: HTTP module / REST use-cases - Development topics
- RestEasy Reactive guide
- Rest Client guide
- Reactive resources
- Readers and Writers: mapping entities and HTTP bodies
- Tester: Jose Carranza [email protected]