@Test public void testMethodUriBodyWithAnyBoundaryMatchForDifferentBody() throws Exception { Multimap<String, String> headers = LinkedHashMultimap.create(); headers.put("Content-Type", "multipart/form-data; boundary=wxyz1234abcd5e"); RecordedHttpBody body1 = new RecordedStringHttpBody("------wxyz1234abcd5e\nContent-Disposition: form-data; " + "name=\"org\" \ngoogle\n------wxyz1234abcd5e"); RecordedHttpBody body2 = new RecordedStringHttpBody("------wxyz1234abcd5e\nContent-Disposition: form-data; " + "name=\"org\" \ndifferent google\n------wxyz1234abcd5e"); RecordedHttpRequest recordedHttpRequest1 = new RecordedHttpRequest("POST", new URI("http: RecordedHttpRequest recordedHttpRequest2 = new RecordedHttpRequest("POST", new URI("http: MatchRule matchRule = MatchRuleUtils.matchMethodUriBodyWithAnyBoundary(); Assert.assertFalse(matchRule.test(recordedHttpRequest1, recordedHttpRequest2)); Assert.assertTrue(matchRule.getMatchFailureDescriptionForRequests(recordedHttpRequest1, recordedHttpRequest2).contains("HTTP Body Mismatch")); }
public static MatchRule matchMethodUriBodyWithAnyBoundary() { CompositeMatchRule compositeMatchRule = new CompositeMatchRule(); compositeMatchRule.addRule(new MatchMethod()); compositeMatchRule.addRule(new MatchUri()); compositeMatchRule.addRule(new MatchBodyWithAnyBoundary()); return compositeMatchRule; }
MatchRuleUtils { public static MatchRule matchMethodUriBodyWithAnyBoundary() { CompositeMatchRule compositeMatchRule = new CompositeMatchRule(); compositeMatchRule.addRule(new MatchMethod()); compositeMatchRule.addRule(new MatchUri()); compositeMatchRule.addRule(new MatchBodyWithAnyBoundary()); return compositeMatchRule; } }
MatchRuleUtils { public static MatchRule matchMethodUriBodyWithAnyBoundary() { CompositeMatchRule compositeMatchRule = new CompositeMatchRule(); compositeMatchRule.addRule(new MatchMethod()); compositeMatchRule.addRule(new MatchUri()); compositeMatchRule.addRule(new MatchBodyWithAnyBoundary()); return compositeMatchRule; } private  MatchRuleUtils(); }
MatchRuleUtils { public static MatchRule matchMethodUriBodyWithAnyBoundary() { CompositeMatchRule compositeMatchRule = new CompositeMatchRule(); compositeMatchRule.addRule(new MatchMethod()); compositeMatchRule.addRule(new MatchUri()); compositeMatchRule.addRule(new MatchBodyWithAnyBoundary()); return compositeMatchRule; } 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 matchMethodUriBodyWithAnyBoundary() { CompositeMatchRule compositeMatchRule = new CompositeMatchRule(); compositeMatchRule.addRule(new MatchMethod()); compositeMatchRule.addRule(new MatchUri()); compositeMatchRule.addRule(new MatchBodyWithAnyBoundary()); return compositeMatchRule; } 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);  }