Class BaseInteractionConverter

java.lang.Object
com.easypost.easyvcr.interactionconverters.BaseInteractionConverter
Direct Known Subclasses:
HttpUrlConnectionInteractionConverter

public abstract class BaseInteractionConverter extends Object
Base for custom interaction converters to convert requests/responses to/from EasyVCR requests/responses.
  • Constructor Details

    • BaseInteractionConverter

      public BaseInteractionConverter()
  • Method Details

    • findMatchingInteraction

      public HttpInteraction findMatchingInteraction(Cassette cassette, Request request, MatchRules matchRules) throws VCRException
      Search for an existing interaction that matches the request.
      Parameters:
      cassette - The cassette to use to search for an existing interaction.
      request - The request to search for.
      matchRules - The match rules to use to determine if an interaction matches the request.
      Returns:
      The matching interaction, or null if no matching interaction was found.
      Throws:
      VCRException - If an error occurs while searching for an existing interaction.
    • createInteraction

      protected HttpInteraction createInteraction(Request request, Response response, long duration)
      Create an HttpInteraction from a request and response.
      Parameters:
      request - The request to create an HttpInteraction from.
      response - The response to create an HttpInteraction from.
      duration - The duration of the interaction.
      Returns:
      The created HttpInteraction.