MessagingRequestMatchers { public static <Req extends MessagingRequest> Matcher<Req> operationEquals(String operation) { if (operation == null) throw new NullPointerException("operation == null"); if (operation.isEmpty()) throw new NullPointerException("operation is empty"); return new MessagingOperationEquals<>(operation); }  static Matcher<Req> operationEquals(String operation); static Matcher<Req> channelKindEquals(String channelKind); static Matcher<Req> channelNameEquals(String channelName);  }
@Test public void operationEquals_matched() { when(request.operation()).thenReturn("send"); assertThat(operationEquals("send").matches(request)).isTrue(); }
@Test public void operationEquals_unmatched_mixedCase() { when(request.operation()).thenReturn("send"); assertThat(operationEquals("Send").matches(request)).isFalse(); }
@Test public void operationEquals_unmatched() { when(request.operation()).thenReturn("receive"); assertThat(operationEquals("send").matches(request)).isFalse(); }
@Test public void operationEquals_unmatched_null() { assertThat(operationEquals("send").matches(request)).isFalse(); }