Skip to content

Commit

Permalink
catch test
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Jun 21, 2023
1 parent af4ba15 commit 1810a74
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/java/io/github/eocqrs/kafka/fake/FkConsumerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,27 @@ void throwsIfNull() {
);
}

@Test
void throwsIfNullWithListener() {
final Consumer<String, String> consumer =
new FkConsumer<>(
UUID.randomUUID(),
this.broker
);
Assertions.assertThrows(
IllegalStateException.class,
() -> consumer.subscribe(new ConsumerRebalanceListener() {
@Override
public void onPartitionsRevoked(final Collection<TopicPartition> collection) {
}

@Override
public void onPartitionsAssigned(final Collection<TopicPartition> collection) {
}
}, (String) null)
);
}

@Test
void createsFakeConsumer() {
final FkConsumer<String, String> consumer =
Expand Down

0 comments on commit 1810a74

Please sign in to comment.