Beispiel #1
0
  @Test
  public void pathEqual() throws Exception {
    Matcher<HttpRequest> matcher = path(equal("/ping"));

    assertTrue(matcher.matches(requestAs("/ping")));
    assertFalse(matcher.matches(requestAs("/echo")));
  }
Beispiel #2
0
  @Test
  public void pathEndsWith() throws Exception {
    Matcher<HttpRequest> matcher = path(endsWith(".gif"));

    assertTrue(matcher.matches(requestAs("/fav.gif")));
    assertTrue(matcher.matches(requestAs("/images/fav.gif")));
    assertFalse(matcher.matches(requestAs("/images/fav.png")));
  }