TestHTTPEndpoint supplies the URL of a chosen REST endpoint during a Quarkus test. Combine it with TestHTTPResource to inject a URL that can be passed to RestAssured when building requests. section 5.2.1
A typical endpoint test uses the annotation to:
- Associate the injected URL with a resource class such as ReservationResource. section 5.2.1
- Submit a JSON request through RestAssured to the reservation endpoint. section 5.2.1
- Verify the returned reservation, including its assigned identifier. section 5.2.1
Reservation resource test
Annotate a URL field with @TestHTTPEndpoint(ReservationResource.class) and @TestHTTPResource, then pass reservationResource to RestAssured while testing the POST /reservation operation. The test creates a reservation and checks that the response contains an assigned ID.
