Class BaseInteractionConverter
java.lang.Object
com.easypost.easyvcr.interactionconverters.BaseInteractionConverter
- Direct Known Subclasses:
HttpUrlConnectionInteractionConverter
Base for custom interaction converters to convert requests/responses to/from EasyVCR requests/responses.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected HttpInteractioncreateInteraction(Request request, Response response, long duration)Create an HttpInteraction from a request and response.findMatchingInteraction(Cassette cassette, Request request, MatchRules matchRules)Search for an existing interaction that matches the request.
-
Constructor Details
-
BaseInteractionConverter
public BaseInteractionConverter()
-
-
Method Details
-
findMatchingInteraction
public HttpInteraction findMatchingInteraction(Cassette cassette, Request request, MatchRules matchRules) throws VCRExceptionSearch 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
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.
-