Annotation Type RestClientConfig


@Inherited @Documented @Target({FIELD,PARAMETER}) @Retention(RUNTIME) public @interface RestClientConfig
Allows an injected client to be built based on the configuration provider.

The default provider attempts to use a ServiceLoader to lookup the first provider found. If found that provider will be used. This can be useful when you want to use the same provider across all tests without having to define the type on each annotation.

In addition to, or instead of, a provider, individual Jakarta REST providers (filters, interceptors, message body readers/writers, etc.) may be registered directly on the client via providers().

Since:
1.0
Author:
James R. Perkins
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    Additional Jakarta REST providers to register on the injected client, such as filters, interceptors or message body readers/writers.
    The type of the configuration provider.
  • Element Details

    • value

      The type of the configuration provider.
      Returns:
      the configuration provider
      Default:
      dev.resteasy.junit.extension.api.RestClientBuilderProvider.class
    • providers

      Class<?>[] providers
      Additional Jakarta REST providers to register on the injected client, such as filters, interceptors or message body readers/writers.

      Each type is registered via Configurable.register(Class), so the Jakarta REST implementation is responsible for instantiating it. As a result each provider must have a public, no-argument constructor. A provider that requires constructor arguments or additional setup should be registered through a RestClientBuilderProvider instead.

      These providers are registered after the value() provider has configured the ClientBuilder, allowing a shared RestClientBuilderProvider to be combined with one or more providers specified at an individual injection point.

      Returns:
      the provider classes to register on the client
      Default:
      {}