FrankChen021 commented on code in PR #20057:
URL: https://github.com/apache/druid/pull/20057#discussion_r3805190176
##########
server/src/test/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCacheTest.java:
##########
@@ -677,21 +677,21 @@
};
serverView.addSegment(newSegment(datasource, 1),
ServerType.INDEXER_EXECUTOR);
- Assert.assertTrue(addSegmentLatch.await(1, TimeUnit.SECONDS));
+ Assertions.assertTrue(addSegmentLatch.await(1, TimeUnit.SECONDS));
- Assert.assertEquals(7, schema.getTotalSegments());
+ Assertions.assertEquals(7, schema.getTotalSegments());
List<AvailableSegmentMetadata> metadatas = schema
.getSegmentMetadataSnapshot()
.values()
.stream()
.filter(metadata ->
datasource.equals(metadata.getSegment().getDataSource()))
.collect(Collectors.toList());
- Assert.assertEquals(1, metadatas.size());
+ Assertions.assertEquals(1, metadatas.size());
AvailableSegmentMetadata metadata = metadatas.get(0);
- Assert.assertEquals(1, metadata.isRealtime());
- Assert.assertEquals(0, metadata.getNumRows());
-
Assert.assertTrue(schema.getSegmentsNeedingRefresh().contains(metadata.getSegment().getId()));
-
Assert.assertTrue(schema.getMutableSegments().contains(metadata.getSegment().getId()));
+ Assertions.assertEquals(1, metadata.isRealtime());
+ Assertions.assertEquals(0, metadata.getNumRows());
Review Comment:
Pre-existing on `offical/master`: the same `metadata.getNumRows()`
invocation is present at base line 692. PR2 only changed the JUnit assertion
from `Assert.assertEquals` to `Assertions.assertEquals`.
##########
server/src/test/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCacheTest.java:
##########
@@ -993,23 +993,23 @@
DataSegment segment = newSegment(datasource, 1);
serverView.addSegment(segment, ServerType.HISTORICAL);
serverView.addSegment(segment, ServerType.BROKER);
- Assert.assertTrue(addSegmentLatch.await(1, TimeUnit.SECONDS));
+ Assertions.assertTrue(addSegmentLatch.await(1, TimeUnit.SECONDS));
serverView.removeSegment(segment, ServerType.HISTORICAL);
- Assert.assertTrue(removeServerSegmentLatch.await(1, TimeUnit.SECONDS));
+ Assertions.assertTrue(removeServerSegmentLatch.await(1, TimeUnit.SECONDS));
- Assert.assertEquals(7, schema.getTotalSegments());
+ Assertions.assertEquals(7, schema.getTotalSegments());
List<AvailableSegmentMetadata> metadatas = schema
.getSegmentMetadataSnapshot()
.values()
.stream()
.filter(metadata ->
datasource.equals(metadata.getSegment().getDataSource()))
.collect(Collectors.toList());
- Assert.assertEquals(1, metadatas.size());
+ Assertions.assertEquals(1, metadatas.size());
AvailableSegmentMetadata metadata = metadatas.get(0);
- Assert.assertEquals(0, metadata.isRealtime());
- Assert.assertEquals(0, metadata.getNumRows());
- Assert.assertEquals(0, metadata.getNumReplicas()); // brokers are not
counted as replicas yet
+ Assertions.assertEquals(0, metadata.isRealtime());
+ Assertions.assertEquals(0, metadata.getNumRows());
Review Comment:
Pre-existing on `offical/master`: the same `metadata.getNumRows()`
invocation is present at base line 1011. PR2 only changed the JUnit assertion
from `Assert.assertEquals` to `Assertions.assertEquals`.
##########
server/src/test/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCacheTest.java:
##########
@@ -1832,10 +1832,10 @@
.findFirst()
.orElse(null);
final AvailableSegmentMetadata currentMetadata =
segmentsMetadata.get(currentSegment.getId());
- Assert.assertEquals(currentSegment.getId(),
currentMetadata.getSegment().getId());
- Assert.assertEquals(5L, currentMetadata.getNumRows());
+ Assertions.assertEquals(currentSegment.getId(),
currentMetadata.getSegment().getId());
+ Assertions.assertEquals(5L, currentMetadata.getNumRows());
Review Comment:
Pre-existing on `offical/master`: the same `metadata.getNumRows()`
invocation is present at base line 1836. PR2 only changed the JUnit assertion
from `Assert.assertEquals` to `Assertions.assertEquals`.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]