@Test public void testNotMatchWrongKey() throws Exception { Multimap<String, String> headers1 = LinkedHashMultimap.create(); headers1.put("key1", "value1"); headers1.put("key2", "value2"); RecordedHttpRequest recordedHttpRequest1 = new RecordedHttpRequest(null, null, headers1, null); Multimap<String, String> headers2 = LinkedHashMultimap.create(); headers2.put("key1", "value1"); headers2.put("key3", "value2"); RecordedHttpRequest recordedHttpRequest2 = new RecordedHttpRequest(null, null, headers2, null); MatchRule matchRule = new MatchHeaders(); Assert.assertFalse(matchRule.test(recordedHttpRequest1, recordedHttpRequest2)); }
@Override public boolean test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest) { return _transform.transform(multimapToCommaSeparatedMap(incomingRequest.getHeaders())) .equals(_transform.transform(multimapToCommaSeparatedMap(expectedRequest.getHeaders()))); }
MatchHeaders extends BaseMatchRule { @Override public boolean test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest) { return _transform.transform(multimapToCommaSeparatedMap(incomingRequest.getHeaders())) .equals(_transform.transform(multimapToCommaSeparatedMap(expectedRequest.getHeaders()))); } }
MatchHeaders extends BaseMatchRule { @Override public boolean test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest) { return _transform.transform(multimapToCommaSeparatedMap(incomingRequest.getHeaders())) .equals(_transform.transform(multimapToCommaSeparatedMap(expectedRequest.getHeaders()))); } MatchHeaders();  MatchHeaders(MatchRuleMapTransform transform); }
MatchHeaders extends BaseMatchRule { @Override public boolean test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest) { return _transform.transform(multimapToCommaSeparatedMap(incomingRequest.getHeaders())) .equals(_transform.transform(multimapToCommaSeparatedMap(expectedRequest.getHeaders()))); } MatchHeaders();  MatchHeaders(MatchRuleMapTransform transform); @Override boolean test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest); String getMatchFailureDescriptionForRequests(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest); }
MatchHeaders extends BaseMatchRule { @Override public boolean test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest) { return _transform.transform(multimapToCommaSeparatedMap(incomingRequest.getHeaders())) .equals(_transform.transform(multimapToCommaSeparatedMap(expectedRequest.getHeaders()))); } MatchHeaders();  MatchHeaders(MatchRuleMapTransform transform); @Override boolean test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest); String getMatchFailureDescriptionForRequests(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest);  }