java.lang.Object
ru.vyarus.dropwizard.guice.test.client.builder.track.RequestData

public class RequestData extends Object
Recorder request configuration data. Each applied value is recorded with an application source (line).

All values tracked with the recorded configuration source (source line, called method), that's why all values are wrapped with SourceAwareValue.

Since:
04.10.2025
  • Constructor Details

    • RequestData

      public RequestData(@Nullable Runnable preRequestAction)
      Create a request data object.
      Parameters:
      preRequestAction - action to be performed before request execution (e.g. logging)
  • Method Details

    • path

      public void path(String path)
      Record path configuration WebTarget.path(String).
      Parameters:
      path - provided path
    • resolveTemplate

      public void resolveTemplate(String name, Object value, boolean encodeSlashInPath, boolean encoded)
      Record path param WebTarget.resolveTemplate(String, Object) (and all other variations).
      Parameters:
      name - param name
      value - param value
      encodeSlashInPath - true if slash encoding required
      encoded - true if value already encoded
    • resolveTemplates

      public void resolveTemplates(Map<String,Object> value, boolean encodeSlashInPath, boolean encoded)
      Record multiple path params WebTarget.resolveTemplates(java.util.Map) (and all other variations).
      Parameters:
      value - path parameters
      encodeSlashInPath - true if slash encoding required
      encoded - true if values already encoded
    • matrixParam

      public void matrixParam(String name, Object... value)
      Record matric param WebTarget.matrixParam(String, Object...).
      Parameters:
      name - param name
      value - param values
    • queryParam

      public void queryParam(String name, Object... value)
      Record query param WebTarget.queryParam(String, Object...).
      Parameters:
      name - param name
      value - param values
    • accept

      public void accept(String... value)
      Expected response type WebTarget.request(String...), Invocation.Builder.accept(String...).
      Parameters:
      value - response types
    • property

      public void property(String name, Object value)
      Record property Configurable.property(String, Object), Invocation.Builder.property(String, Object).
      Parameters:
      name - property name
      value - property value
    • register

      public void register(Object value, int priority, Class<?>... contracts)
      Record extension (by class or instance) Configurable.register(Class).
      Parameters:
      value - extension class or instance
      priority - priority
      contracts - constracts
    • register

      public void register(Object value, Map<Class<?>,Integer> contracts)
      Record extension (by class or instance) Configurable.register(Object, java.util.Map).
      Parameters:
      value - extension class or instance
      contracts - contracts with priority
    • method

      public void method(String method, @Nullable jakarta.ws.rs.client.Entity<?> entity)
      Record http method SyncInvoker.method(String) and shortcuts like SyncInvoker.get().
      Parameters:
      method - http method
      entity - entity
    • method

      public void method(String method, @Nullable jakarta.ws.rs.client.Entity<?> entity, @Nullable Class<?> responseType)
      Record http method SyncInvoker.method(String) and shortcuts like SyncInvoker.get(Class).
      Parameters:
      method - http method
      entity - entity
      responseType - requested response mapping
    • method

      public void method(String method, @Nullable jakarta.ws.rs.client.Entity<?> entity, @Nullable jakarta.ws.rs.core.GenericType<?> responseType)
      Record http method SyncInvoker.method(String) and shortcuts like SyncInvoker.get(jakarta.ws.rs.core.GenericType).
      Parameters:
      method - http method
      entity - entity
      responseType - requested response mapping
    • language

      public void language(String... value)
      Register required language Invocation.Builder.acceptLanguage(String...).
      Parameters:
      value - required languages
    • encoding

      public void encoding(String... value)
      Register required encoding Invocation.Builder.acceptEncoding(String...).
      Parameters:
      value - required encodings
    • cookie

      public void cookie(jakarta.ws.rs.core.Cookie value)
      Register cookie Invocation.Builder.cookie(String, String).
      Parameters:
      value - cookie
    • cacheControl

      public void cacheControl(jakarta.ws.rs.core.CacheControl value)
      Register cache control Invocation.Builder.cacheControl(jakarta.ws.rs.core.CacheControl).
      Parameters:
      value - cache control
    • header

      public void header(String name, Object value)
      Register header Invocation.Builder.header(String, Object).
      Parameters:
      name - header name
      value - header value
    • headers

      public void headers(jakarta.ws.rs.core.MultivaluedMap<String,Object> value)
      Record multiple headers Invocation.Builder.headers(jakarta.ws.rs.core.MultivaluedMap).
      Parameters:
      value - headers
    • url

      public void url(String url)
      Record target url. Called after WebTarget.request().
      Parameters:
      url - url
    • getQueryParams

      public Map<String,SourceAwareValue<Object>> getQueryParams()
      Returns:
      query params
    • getMatrixParams

      public Map<String,SourceAwareValue<Object>> getMatrixParams()
      Returns:
      matric params
    • getPathParams

      public List<SourceAwareValue<RequestData.PathParam>> getPathParams()
      Returns:
      path params
    • getHeaders

      public Map<String,SourceAwareValue<Object>> getHeaders()
      Returns:
      headers
    • getCookies

      public Map<String,SourceAwareValue<jakarta.ws.rs.core.Cookie>> getCookies()
      Returns:
      cookies
    • getProperties

      public Map<String,SourceAwareValue<Object>> getProperties()
      Returns:
      properties
    • getExtensions

      public Map<Class<?>,SourceAwareValue<RequestData.Extension>> getExtensions()
      Returns:
      extensions
    • getPaths

      public List<SourceAwareValue<String>> getPaths()
      Returns:
      paths
    • getAcceptHeader

      public @Nullable SourceAwareValue<String[]> getAcceptHeader()
      Returns:
      accept header values
    • getLanguageHeader

      public @Nullable SourceAwareValue<String[]> getLanguageHeader()
      Returns:
      accept language header values
    • getEncodingHeader

      public @Nullable SourceAwareValue<String[]> getEncodingHeader()
      Returns:
      accept encoding header values
    • getCache

      public @Nullable SourceAwareValue<jakarta.ws.rs.core.CacheControl> getCache()
      Returns:
      cache control header value
    • getMethod

      public @Nullable SourceAwareValue<String> getMethod()
      Returns:
      called http method
    • getEntity

      public @Nullable SourceAwareValue<jakarta.ws.rs.client.Entity<?>> getEntity()
      Returns:
      used entity
    • getResultMapping

      public @Nullable SourceAwareValue<jakarta.ws.rs.core.GenericType<?>> getResultMapping()
      Covers both Class and GenericType options (in case of class, use generic type constructor).
      Returns:
      result mapping (if specified)
    • getUrl

      public @Nullable String getUrl()
      Returns:
      target url
    • getLog

      public String getLog()
      Returns:
      modifications log