RpcRequestMatchers { public static <Req extends RpcRequest> Matcher<Req> methodEquals(String method) { if (method == null) throw new NullPointerException("method == null"); if (method.isEmpty()) throw new NullPointerException("method is empty"); return new RpcMethodEquals<>(method); }  static Matcher<Req> methodEquals(String method); static Matcher<Req> serviceEquals(String service);  }
@Test public void methodEquals_matched() { when(request.method()).thenReturn("Check"); assertThat(methodEquals("Check").matches(request)).isTrue(); }
@Test public void methodEquals_unmatched_mixedCase() { when(request.method()).thenReturn("Check"); assertThat(methodEquals("check").matches(request)).isFalse(); }
@Test public void methodEquals_unmatched() { when(request.method()).thenReturn("Log"); assertThat(methodEquals("Check").matches(request)).isFalse(); }
@Test public void methodEquals_unmatched_null() { assertThat(methodEquals("Check").matches(request)).isFalse(); }