Package dev.resteasy.junit.extension.annotations
package dev.resteasy.junit.extension.annotations
Annotations for the RESTEasy JUnit extension.
This package contains the primary annotations used to configure and use the RESTEasy JUnit extension for testing Jakarta REST applications.
Primary Annotations
@RestBootstrap- Marks a test class to start a Jakarta RESTSeBootstrapinstance@RestResource- Marks fields and parameters for injection of REST resources (Client, WebTarget, URI, etc.)
SSL Annotations
@SelfSignedCert- Generates self-signed certificates for SSL/TLS testing@SslCert- Marks fields for injection of the generatedSelfSignedCertificate
Qualifier Annotations
@RequestPath- Qualifies WebTarget or URI injection with a specific path@RestClientConfig- Qualifies Client or WebTarget injection with custom configuration
Example Usage
@RestBootstrap(MyApplication.class)
public class MyResourceTest {
@RestResource
private Client client;
@RestResource
@RequestPath("/orders")
private WebTarget ordersTarget;
@Test
public void testGetOrders() {
try (Response response = ordersTarget.request().get()) {
assertEquals(200, response.getStatus());
}
}
}
- Since:
- 1.0
- See Also:
-
Annotation TypesClassDescriptionQualifies the injection point for a
WebTargetorURIwith a relative path with a prefix ofSeBootstrap.Configuration.baseUriBuilder().An annotation which starts aSeBootstrap.Instancefor unit testing.Allows an injected client to be built based on the configuration provider.Marks a field or constructor parameter for injection by the RESTEasy JUnit extension.Enables generation of self-signed certificates for SSL/TLS testing.Marks a field for injection of aSelfSignedCertificate.