Interface LoopbackRestClient

All Superinterfaces:
org.refcodes.web.BasicAuthCredentialsAccessor, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestClient>, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty, org.refcodes.web.MediaTypeFactoryLookup, org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.web.OauthTokenAccessor, org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder<RestClient>, org.refcodes.web.OauthTokenAccessor.OauthTokenMutator, org.refcodes.web.OauthTokenAccessor.OauthTokenProperty, org.refcodes.runtime.RequestCorrelation<RestClient>, RestClient, RestDeleteClient, RestGetClient, RestPostClient, RestPutClient, RestRequestClient, RestRequestHandler, org.refcodes.runtime.SessionCorrelation<RestClient>, org.refcodes.web.UserAgentAccessor, org.refcodes.web.UserAgentAccessor.UserAgentBuilder<RestClient>, org.refcodes.web.UserAgentAccessor.UserAgentMutator, org.refcodes.web.UserAgentAccessor.UserAgentProperty
All Known Implementing Classes:
LoopbackRestClientImpl, LoopbackRestClientSingleton

public interface LoopbackRestClient extends RestClient
Extends a RestClient to be used as loopback device e.g. for testing purposes such as testing your RestResponseConsumer implementations. Register your custom RestRequestHandler with onRestRequest(RestRequestHandler) to simulate REST responses on the LoopbackRestClient.
  • Method Details

    • onRestRequest

      void onRestRequest(RestRequestHandler aHandler)
      Registers a RestRequestHandler to simulate a REST response: The RestRequestHandler.doRequest(org.refcodes.web.HttpClientRequest) method is invoked with a prepared RestResponseHandler instance representing the request being sent and produces an according RestResponseEvent to be passed back to the issuer of the request.
      Parameters:
      aHandler - The RestRequestHandler for handling the HTTP request and producing the RestResponseEvent.
    • withBasicAuthCredentials

      default LoopbackRestClient withBasicAuthCredentials(org.refcodes.web.BasicAuthCredentials aBasicAuthCredentials)
      Specified by:
      withBasicAuthCredentials in interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestClient>
    • withBasicAuthCredentials

      default LoopbackRestClient withBasicAuthCredentials(String aUserName, String aSecret)
      Specified by:
      withBasicAuthCredentials in interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestClient>
    • withDisableRequestCorrelation

      default LoopbackRestClient withDisableRequestCorrelation()
      Specified by:
      withDisableRequestCorrelation in interface org.refcodes.runtime.RequestCorrelation<RestClient>
    • withDisableSessionCorrelation

      default LoopbackRestClient withDisableSessionCorrelation()
      Specified by:
      withDisableSessionCorrelation in interface org.refcodes.runtime.SessionCorrelation<RestClient>
    • withEnableRequestCorrelation

      default LoopbackRestClient withEnableRequestCorrelation()
      Specified by:
      withEnableRequestCorrelation in interface org.refcodes.runtime.RequestCorrelation<RestClient>
    • withEnableSessionCorrelation

      default LoopbackRestClient withEnableSessionCorrelation()
      Specified by:
      withEnableSessionCorrelation in interface org.refcodes.runtime.SessionCorrelation<RestClient>
    • withOAuthToken

      default LoopbackRestClient withOAuthToken(org.refcodes.web.OauthToken aOauthToken)
      Specified by:
      withOAuthToken in interface org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder<RestClient>
    • withRequestCorrelation

      default LoopbackRestClient withRequestCorrelation(boolean hasRequestCorrelation)
      Specified by:
      withRequestCorrelation in interface org.refcodes.runtime.RequestCorrelation<RestClient>
    • withSessionCorrelation

      default LoopbackRestClient withSessionCorrelation(boolean hasSessionCorrelation)
      Specified by:
      withSessionCorrelation in interface org.refcodes.runtime.SessionCorrelation<RestClient>
    • withUserAgent

      default LoopbackRestClient withUserAgent(String aUserAgent)
      Specified by:
      withUserAgent in interface org.refcodes.web.UserAgentAccessor.UserAgentBuilder<RestClient>