File tree Expand file tree Collapse file tree
src/main/java/com/easypost/easyvcr Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33## Next Release
44
5+ - New ` byCustomRule ` function to allow users to define their own matching rule when finding a matching interaction in a cassette
56- Improve error messages when a matching interaction is not found (human-readable error messages)
67- Fix bug where the base URL matching rule was not comparing the scheme, host, and port of the request URL properly
78
Original file line number Diff line number Diff line change @@ -248,6 +248,18 @@ public MatchRules byMethod() {
248248 return this ;
249249 }
250250
251+ /**
252+ * Add a rule to compare two requests by a custom rule.
253+ * @param rule A BiFunction that accepts two Request instances and returns true if they match, false otherwise.
254+ * The first parameter is the current in-flight request,
255+ * the second parameter is the recorded request from the current cassette.
256+ * @return This MatchRules factory.
257+ */
258+ public MatchRules byCustomRule (BiFunction <Request , Request , Boolean > rule ) {
259+ by (rule );
260+ return this ;
261+ }
262+
251263 /**
252264 * Execute rules to determine if the received request matches the recorded request.
253265 *
You can’t perform that action at this time.
0 commit comments