MessagingRequestMatchers { public static <Req extends MessagingRequest> Matcher<Req> channelKindEquals(String channelKind) { if (channelKind == null) throw new NullPointerException("channelKind == null"); if (channelKind.isEmpty()) throw new NullPointerException("channelKind is empty"); return new MessagingChannelKindEquals<>(channelKind); }  static Matcher<Req> operationEquals(String operation); static Matcher<Req> channelKindEquals(String channelKind); static Matcher<Req> channelNameEquals(String channelName);  }
@Test public void channelKindEquals_matched() { when(request.channelKind()).thenReturn("queue"); assertThat(channelKindEquals("queue").matches(request)).isTrue(); }
@Test public void channelKindEquals_unmatched_mixedCase() { when(request.channelKind()).thenReturn("queue"); assertThat(channelKindEquals("Queue").matches(request)).isFalse(); }
@Test public void channelKindEquals_unmatched() { when(request.channelKind()).thenReturn("topic"); assertThat(channelKindEquals("queue").matches(request)).isFalse(); }
@Test public void channelKindEquals_unmatched_null() { assertThat(channelKindEquals("queue").matches(request)).isFalse(); }