@Test public void testHeaderWhitelistMatch() 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("key2", "value2"); headers2.put("key3", "value3"); RecordedHttpRequest recordedHttpRequest2 = new RecordedHttpRequest(null, null, headers2, null); Set<String> wList = new HashSet<>(); wList.add("key1"); wList.add("key2"); MatchRule matchRule = MatchRuleUtils.matchHeadersWithWhitelist(wList); Assert.assertTrue(matchRule.test(recordedHttpRequest1, recordedHttpRequest2)); }
public static MatchRule matchHeadersWithWhitelist(Set<String> whiteList) { return new MatchHeaders(new MatchRuleWhitelistTransform(whiteList)); }
MatchRuleUtils { public static MatchRule matchHeadersWithWhitelist(Set<String> whiteList) { return new MatchHeaders(new MatchRuleWhitelistTransform(whiteList)); } }
MatchRuleUtils { public static MatchRule matchHeadersWithWhitelist(Set<String> whiteList) { return new MatchHeaders(new MatchRuleWhitelistTransform(whiteList)); } private  MatchRuleUtils(); }
MatchRuleUtils { public static MatchRule matchHeadersWithWhitelist(Set<String> whiteList) { return new MatchHeaders(new MatchRuleWhitelistTransform(whiteList)); } private  MatchRuleUtils(); static MatchRule matchEntireRequest(); static MatchRule matchMethodUri(); static MatchRule matchMethodBodyUri(); static MatchRule matchMethodUriBodyWithAnyBoundary(); static MatchRule matchUriWithQueryWhitelist(Set<String> whiteList); static MatchRule matchUriWithQueryBlacklist(Set<String> blackList); static MatchRule matchHeadersWithWhitelist(Set<String> whiteList); static MatchRule matchHeadersWithBlacklist(Set<String> blackList); static MatchRule matchBodyPostParametersWithWhitelist(Set<String> whiteList); static MatchRule matchBodyPostParametersWithBlacklist(Set<String> blackList); }
MatchRuleUtils { public static MatchRule matchHeadersWithWhitelist(Set<String> whiteList) { return new MatchHeaders(new MatchRuleWhitelistTransform(whiteList)); } private  MatchRuleUtils(); static MatchRule matchEntireRequest(); static MatchRule matchMethodUri(); static MatchRule matchMethodBodyUri(); static MatchRule matchMethodUriBodyWithAnyBoundary(); static MatchRule matchUriWithQueryWhitelist(Set<String> whiteList); static MatchRule matchUriWithQueryBlacklist(Set<String> blackList); static MatchRule matchHeadersWithWhitelist(Set<String> whiteList); static MatchRule matchHeadersWithBlacklist(Set<String> blackList); static MatchRule matchBodyPostParametersWithWhitelist(Set<String> whiteList); static MatchRule matchBodyPostParametersWithBlacklist(Set<String> blackList);  }