RpcRequestMatchers { public static <Req extends RpcRequest> Matcher<Req> serviceEquals(String service) { if (service == null) throw new NullPointerException("service == null"); if (service.isEmpty()) throw new NullPointerException("service is empty"); return new RpcServiceEquals<>(service); }  static Matcher<Req> methodEquals(String method); static Matcher<Req> serviceEquals(String service);  }
@Test public void serviceEquals_matched() { when(request.service()).thenReturn("grpc.health.v1.Health"); assertThat(serviceEquals("grpc.health.v1.Health").matches(request)).isTrue(); }
@Test public void serviceEquals_unmatched_mixedCase() { when(request.service()).thenReturn("grpc.health.v1.Health"); assertThat(serviceEquals("grpc.health.v1.health").matches(request)).isFalse(); }
@Test public void serviceEquals_unmatched() { when(request.service()).thenReturn("scribe"); assertThat(serviceEquals("grpc.health.v1.Health").matches(request)).isFalse(); }
@Test public void serviceEquals_unmatched_null() { assertThat(serviceEquals("grpc.health.v1.Health").matches(request)).isFalse(); }