Annotation Type RequestPath


@Inherited @Documented @Target({FIELD,PARAMETER}) @Retention(RUNTIME) public @interface RequestPath
Qualifies the injection point for a WebTarget or URI with a relative path with a prefix of SeBootstrap.Configuration.baseUriBuilder().
@RestBootstrap(OrderApplication.class)
public class OrderTest {
    @RestResource
    @RequestPath("/orders")
    private WebTarget ordersTarget;

    @RestResource
    @RequestPath("/orders")
    private URI ordersUri;

    @Test
    public void listOrders() throws Exception {
        try (Response response = ordersTarget.request().get()) {
            Assertions.assertEquals(200, response.getStatus(),
                    () -> String.format("Failed to get orders: %s", response.readEntity(String.class)));
        }
    }

    @Test
    public void getOrdersUri(@RestResource @RequestPath("/orders/123") URI orderUri) {
        Assertions.assertTrue(orderUri.toString().endsWith("/orders/123"));
    }
}
Since:
1.0
Author:
James R. Perkins
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The relative path the Client.target(URI) should use based on the SeBootstrap.Configuration.baseUriBuilder() path.
  • Element Details

    • value

      String value
      The relative path the Client.target(URI) should use based on the SeBootstrap.Configuration.baseUriBuilder() path.
      Returns:
      the relative path