HttpRequestMatchers { public static Matcher<HttpRequest> methodEquals(String method) { if (method == null) throw new NullPointerException("method == null"); if (method.isEmpty()) throw new NullPointerException("method is empty"); return new MethodEquals(method); }  static Matcher<HttpRequest> methodEquals(String method); static Matcher<HttpRequest> pathStartsWith(String pathPrefix);  }
@Test public void methodEquals_matched() { when(httpRequest.method()).thenReturn("GET"); assertThat(methodEquals("GET").matches(httpRequest)).isTrue(); }
@Test public void methodEquals_unmatched_mixedCase() { when(httpRequest.method()).thenReturn("PoSt"); assertThat(methodEquals("POST").matches(httpRequest)).isFalse(); }
@Test public void methodEquals_unmatched() { when(httpRequest.method()).thenReturn("POST"); assertThat(methodEquals("GET").matches(httpRequest)).isFalse(); }
@Test public void methodEquals_unmatched_null() { assertThat(methodEquals("GET").matches(httpRequest)).isFalse(); }