PatrickRen commented on a change in pull request #18014:
URL: https://github.com/apache/flink/pull/18014#discussion_r771252701
##########
File path:
flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/source/reader/KafkaSourceReaderTest.java
##########
@@ -354,20 +354,22 @@ public void testKafkaSourceMetrics() throws Exception {
Matchers.greaterThan(0L));
// Committed offset should be NUM_RECORD_PER_SPLIT
- assertEquals(NUM_RECORDS_PER_SPLIT, getCommittedOffsetMetric(tp0,
metricListener));
- assertEquals(NUM_RECORDS_PER_SPLIT, getCommittedOffsetMetric(tp1,
metricListener));
+ assertThat(getCommittedOffsetMetric(tp0, metricListener))
+ .isEqualTo(NUM_RECORDS_PER_SPLIT);
+ assertThat(getCommittedOffsetMetric(tp1, metricListener))
+ .isEqualTo(NUM_RECORDS_PER_SPLIT);
// Number of successful commits should be greater than 0
final Optional<Counter> commitsSucceeded =
metricListener.getCounter(
KAFKA_SOURCE_READER_METRIC_GROUP,
COMMITS_SUCCEEDED_METRIC_COUNTER);
- assertTrue(commitsSucceeded.isPresent());
+ assertThat(commitsSucceeded.isPresent()).isTrue();
Review comment:
Nit: You can use `assertThat(Optional).isPresent()` for validating
`Optional`s
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]