Class RestCallAnalyzer

java.lang.Object
ru.vyarus.dropwizard.guice.test.client.builder.call.RestCallAnalyzer

public final class RestCallAnalyzer extends Object
Allows using direct call for a resource method to configure rest client endpoint: target url is configured from method Path annotation. Optionally, PathParam and QueryParam parameters could be configured by providing non-null values.

Limitation: this will work only with methods with DIRECTLY applied annotations: neither implemented interface method (when annotations only on interface) nor overridden method would work.

Since:
21.09.2025
  • Method Details

    • configure

      public static <T> TestClientRequestBuilder configure(ResourceClient<T> client, Caller<T> method, @Nullable Object body)
      Configure rest client by direct resource method call.

      Internally, javassist proxy is used to intercept method call.

      Limitation: this will work only with methods with DIRECTLY applied annotations: neither implemented interface method (when annotations only on interface) nor overridden method would work.

      Type Parameters:
      T - resource type
      Parameters:
      client - rest client instance
      method - consumer with a required method call inside
      body - body object (could be null)
      Returns:
      pre-configured builder
    • getSubResourcePath

      public static <T> String getSubResourcePath(Class<T> type, Caller<T> method)
      Resolve sub resource mapping path from lookup method.
      Type Parameters:
      T - resource type
      Parameters:
      type - resource type
      method - lookup method caller
      Returns:
      lookup method path