@Test public void testPostParameterBlacklistMatch() throws Exception { RecordedStringHttpBody stringHttpBody1 = new RecordedStringHttpBody("a=a&b=b&c=c"); RecordedStringHttpBody stringHttpBody2 = new RecordedStringHttpBody("a=a&b=x&c=c&d=d"); Multimap<String, String> headers = LinkedHashMultimap.create(); headers.put("Content-Type", "application/x-www-form-urlencoded"); Set<String> blackList = new HashSet<>(); blackList.add("b"); blackList.add("d"); RecordedHttpRequest recordedHttpRequest1 = new RecordedHttpRequest(null, null, headers, stringHttpBody1); RecordedHttpRequest recordedHttpRequest2 = new RecordedHttpRequest(null, null, headers, stringHttpBody2); MatchRule matchRule = MatchRuleUtils.matchBodyPostParametersWithBlacklist(blackList); Assert.assertTrue(matchRule.test(recordedHttpRequest1, recordedHttpRequest2)); }
public static MatchRule matchBodyPostParametersWithBlacklist(Set<String> blackList) { return new MatchBodyPostParameters(new MatchRuleBlacklistTransform(blackList)); }
MatchRuleUtils { public static MatchRule matchBodyPostParametersWithBlacklist(Set<String> blackList) { return new MatchBodyPostParameters(new MatchRuleBlacklistTransform(blackList)); } }
MatchRuleUtils { public static MatchRule matchBodyPostParametersWithBlacklist(Set<String> blackList) { return new MatchBodyPostParameters(new MatchRuleBlacklistTransform(blackList)); } private  MatchRuleUtils(); }
MatchRuleUtils { public static MatchRule matchBodyPostParametersWithBlacklist(Set<String> blackList) { return new MatchBodyPostParameters(new MatchRuleBlacklistTransform(blackList)); } 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 matchBodyPostParametersWithBlacklist(Set<String> blackList) { return new MatchBodyPostParameters(new MatchRuleBlacklistTransform(blackList)); } 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);  }