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 REST SeBootstrap instance
  • @RestResource - Marks fields and parameters for injection of REST resources (Client, WebTarget, URI, etc.)

SSL Annotations

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 Types
    Class
    Description
    Qualifies the injection point for a WebTarget or URI with a relative path with a prefix of SeBootstrap.Configuration.baseUriBuilder().
    An annotation which starts a SeBootstrap.Instance for 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 a SelfSignedCertificate.