Module dev.resteasy.junit.extension


module dev.resteasy.junit.extension
Provides a JUnit extension for testing Jakarta REST applications using SeBootstrap.

This module enables seamless integration testing of Jakarta REST endpoints by managing the SeBootstrap lifecycle and providing dependency injection for test resources.

Key Features

  • Automatic SeBootstrap instance management for test classes
  • Injection of REST clients, URIs, and other test resources
  • Support for custom server configuration via properties or providers
  • Extensible via ServiceLoader SPI
  • Implementation-agnostic - works with any Jakarta REST 3.1+ implementation

Usage Example

@RestBootstrap(HelloResource.class)
public class HelloResourceTest {

    @RestResource
    private Client client;

    @RestResource
    private URI baseUri;

    @Test
    public void testHello() {
        Response response = client.target(baseUri)
            .path("/hello")
            .request()
            .get();

        assertEquals(200, response.getStatus());
    }
}

Exported Packages

dev.resteasy.junit.extension.annotations
Primary annotations for marking test classes and resources (@RestBootstrap, @RestResource, @RequestPath)
dev.resteasy.junit.extension.api
Extension SPI for custom configuration providers and resource producers

Service Provider Interfaces

This module uses the following services via ServiceLoader:

Since:
1.0
Author:
James R. Perkins
See Also: