FrankChen021 commented on code in PR #19915:
URL: https://github.com/apache/druid/pull/19915#discussion_r3736371651


##########
extensions-contrib/aliyun-oss-extensions/src/test/java/org/apache/druid/storage/aliyun/OssDataSegmentMoverTest.java:
##########
@@ -150,27 +154,29 @@
     ), ImmutableMap.of("bucket", "DOES NOT EXIST", "baseKey", "baseKey"));
   }
 
-  @Test(expected = SegmentLoadingException.class)
-  public void testFailsToMoveMissing() throws Exception
+  @Test
+  public void testFailsToMoveMissing()
   {
-    MockClient client = new MockClient();
-    OssDataSegmentMover mover = new 
OssDataSegmentMover(Suppliers.ofInstance(client), new OssStorageConfig());
-    mover.move(new DataSegment(
-        "test",
-        Intervals.of("2013-01-01/2013-01-02"),
-        "1",
-        ImmutableMap.of(
-            "key",
-            
"baseKey/test/2013-01-01T00:00:00.000Z_2013-01-02T00:00:00.000Z/1/0/index.zip",
-            "bucket",
-            "DOES NOT EXIST"
-        ),
-        ImmutableList.of("dim1", "dim1"),
-        ImmutableList.of("metric1", "metric2"),
-        NoneShardSpec.instance(),
-        0,
-        1
-    ), ImmutableMap.of("bucket", "DOES NOT EXIST", "baseKey", "baseKey2"));
+    assertThrows(SegmentLoadingException.class, () -> {
+      MockClient client = new MockClient();
+      OssDataSegmentMover mover = new 
OssDataSegmentMover(Suppliers.ofInstance(client), new OssStorageConfig());
+      mover.move(new DataSegment(
+          "test",
+          Intervals.of("2013-01-01/2013-01-02"),
+          "1",
+          ImmutableMap.of(
+              "key",
+              
"baseKey/test/2013-01-01T00:00:00.000Z_2013-01-02T00:00:00.000Z/1/0/index.zip",
+              "bucket",
+              "DOES NOT EXIST"
+          ),
+          ImmutableList.of("dim1", "dim1"),
+          ImmutableList.of("metric1", "metric2"),
+          NoneShardSpec.instance(),
+          0,
+          1
+      ), ImmutableMap.of("bucket", "DOES NOT EXIST", "baseKey", "baseKey2"));

Review Comment:
   Thanks for flagging this. This call predates the JUnit 5 migration; the PR 
only moved it into an assertThrows lambda. Migrating the deprecated DataSegment 
constructor to a builder is outside this PR’s scope, so I’m intentionally 
leaving it unchanged.



##########
extensions-contrib/rabbit-stream-indexing-service/src/test/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfigTest.java:
##########
@@ -87,21 +82,21 @@
                 TuningConfig.class)),
         TuningConfig.class);
 
-    Assert.assertNull(config.getBasePersistDirectory());
-    Assert.assertEquals(new OnheapIncrementalIndex.Spec(), 
config.getAppendableIndexSpec());
-    Assert.assertEquals(150000, config.getMaxRowsInMemory());
-    Assert.assertEquals(5_000_000, config.getMaxRowsPerSegment().intValue());
-    Assert.assertEquals(new Period("PT10M"), 
config.getIntermediatePersistPeriod());
-    Assert.assertEquals(0, config.getMaxPendingPersists());
-    // Assert.assertEquals(IndexSpec.getDefault(), config.getIndexSpec());
-    Assert.assertEquals(false, config.isReportParseExceptions());
-    Assert.assertEquals(java.time.Duration.ofMinutes(15).toMillis(), 
config.getHandoffConditionTimeout());
-    Assert.assertNull(config.getWorkerThreads());
-    Assert.assertEquals(8L, (long) config.getChatRetries());
-    Assert.assertEquals(Duration.standardSeconds(10), config.getHttpTimeout());
-    Assert.assertEquals(Duration.standardSeconds(80), 
config.getShutdownTimeout());
-    Assert.assertEquals(Duration.standardSeconds(120), 
config.getRepartitionTransitionDuration());
-    Assert.assertEquals(100, config.getMaxRecordsPerPollOrDefault());
+    Assertions.assertNull(config.getBasePersistDirectory());
+    Assertions.assertEquals(new OnheapIncrementalIndex.Spec(), 
config.getAppendableIndexSpec());
+    Assertions.assertEquals(150000, config.getMaxRowsInMemory());
+    Assertions.assertEquals(5_000_000, 
config.getMaxRowsPerSegment().intValue());
+    Assertions.assertEquals(new Period("PT10M"), 
config.getIntermediatePersistPeriod());
+    Assertions.assertEquals(0, config.getMaxPendingPersists());

Review Comment:
   Thanks for flagging this. This call predates the JUnit 5 migration; this PR 
only changes Assert to Assertions here. Deprecated API cleanup is outside this 
PR’s scope, so I’m intentionally leaving it unchanged.



##########
extensions-contrib/rabbit-stream-indexing-service/src/test/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfigTest.java:
##########
@@ -106,18 +101,18 @@
         TuningConfig.class
     );
 
-    Assert.assertNull(config.getBasePersistDirectory());
-    Assert.assertEquals(new OnheapIncrementalIndex.Spec(), 
config.getAppendableIndexSpec());
-    Assert.assertEquals(100, config.getMaxRowsInMemory());
-    Assert.assertEquals(100, config.getMaxRowsPerSegment().intValue());
-    Assert.assertEquals(new Period("PT1H"), 
config.getIntermediatePersistPeriod());
-    Assert.assertEquals(100, config.getMaxPendingPersists());
-    Assert.assertTrue(config.isReportParseExceptions());
-    Assert.assertEquals(100, config.getHandoffConditionTimeout());
-    Assert.assertEquals(1000, (int) config.getRecordBufferSizeConfigured());
-    Assert.assertEquals(1000, 
config.getRecordBufferSizeOrDefault(1_000_000_000));
-    Assert.assertEquals(500, config.getRecordBufferOfferTimeout());
-    Assert.assertFalse(config.isResetOffsetAutomatically());
+    Assertions.assertNull(config.getBasePersistDirectory());
+    Assertions.assertEquals(new OnheapIncrementalIndex.Spec(), 
config.getAppendableIndexSpec());
+    Assertions.assertEquals(100, config.getMaxRowsInMemory());
+    Assertions.assertEquals(100, config.getMaxRowsPerSegment().intValue());
+    Assertions.assertEquals(new Period("PT1H"), 
config.getIntermediatePersistPeriod());
+    Assertions.assertEquals(100, config.getMaxPendingPersists());

Review Comment:
   Thanks for flagging this. This call predates the JUnit 5 migration; this PR 
only changes Assert to Assertions here. Deprecated API cleanup is outside this 
PR’s scope, so I’m intentionally leaving it unchanged.



##########
extensions-contrib/rabbit-stream-indexing-service/src/test/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfigTest.java:
##########
@@ -134,22 +129,22 @@
                 TuningConfig.class)),
         TuningConfig.class);
 
-    Assert.assertNull(config.getBasePersistDirectory());
-    Assert.assertEquals(new OnheapIncrementalIndex.Spec(), 
config.getAppendableIndexSpec());
-    Assert.assertEquals(100, config.getMaxRowsInMemory());
-    Assert.assertEquals(100, config.getMaxRowsPerSegment().intValue());
-    Assert.assertEquals(new Period("PT1H"), 
config.getIntermediatePersistPeriod());
-    Assert.assertEquals(100, config.getMaxPendingPersists());
-    Assert.assertEquals(true, config.isReportParseExceptions());
-    Assert.assertEquals(100, config.getHandoffConditionTimeout());
-    Assert.assertEquals(12, (int) config.getWorkerThreads());
-    Assert.assertEquals(14L, (long) config.getChatRetries());
-    Assert.assertEquals(15, (int) config.getRecordBufferSizeConfigured());
-    Assert.assertEquals(16, (int) config.getRecordBufferOfferTimeout());
-    Assert.assertEquals(17, (int) config.getMaxRecordsPerPollConfigured());
-    Assert.assertEquals(Duration.standardSeconds(15), config.getHttpTimeout());
-    Assert.assertEquals(Duration.standardSeconds(95), 
config.getShutdownTimeout());
-    Assert.assertEquals(Duration.standardSeconds(120), 
config.getRepartitionTransitionDuration());
+    Assertions.assertNull(config.getBasePersistDirectory());
+    Assertions.assertEquals(new OnheapIncrementalIndex.Spec(), 
config.getAppendableIndexSpec());
+    Assertions.assertEquals(100, config.getMaxRowsInMemory());
+    Assertions.assertEquals(100, config.getMaxRowsPerSegment().intValue());
+    Assertions.assertEquals(new Period("PT1H"), 
config.getIntermediatePersistPeriod());
+    Assertions.assertEquals(100, config.getMaxPendingPersists());

Review Comment:
   Thanks for flagging this. This call predates the JUnit 5 migration; this PR 
only changes Assert to Assertions here. Deprecated API cleanup is outside this 
PR’s scope, so I’m intentionally leaving it unchanged.



##########
extensions-contrib/rabbit-stream-indexing-service/src/test/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfigTest.java:
##########
@@ -61,22 +56,22 @@
         TuningConfig.class
     );
 
-    Assert.assertNull(config.getBasePersistDirectory());
-    Assert.assertEquals(new OnheapIncrementalIndex.Spec(), 
config.getAppendableIndexSpec());
-    Assert.assertEquals(150000, config.getMaxRowsInMemory());
-    Assert.assertEquals(5_000_000, config.getMaxRowsPerSegment().intValue());
-    Assert.assertEquals(new Period("PT10M"), 
config.getIntermediatePersistPeriod());
-    Assert.assertEquals(0, config.getMaxPendingPersists());
-    // Assert.assertEquals(IndexSpec.getDefault(), config.getIndexSpec());
-    Assert.assertEquals(false, config.isReportParseExceptions());
-    Assert.assertEquals(Duration.ofMinutes(15).toMillis(), 
config.getHandoffConditionTimeout());
-
-    Assert.assertNull(config.getRecordBufferSizeConfigured());
-    Assert.assertEquals(10000, 
config.getRecordBufferSizeOrDefault(1_000_000_000));
-    Assert.assertEquals(5000, config.getRecordBufferOfferTimeout());
-
-    Assert.assertFalse(config.isSkipSequenceNumberAvailabilityCheck());
-    Assert.assertFalse(config.isResetOffsetAutomatically());
+    Assertions.assertNull(config.getBasePersistDirectory());
+    Assertions.assertEquals(new OnheapIncrementalIndex.Spec(), 
config.getAppendableIndexSpec());
+    Assertions.assertEquals(150000, config.getMaxRowsInMemory());
+    Assertions.assertEquals(5_000_000, 
config.getMaxRowsPerSegment().intValue());
+    Assertions.assertEquals(new Period("PT10M"), 
config.getIntermediatePersistPeriod());
+    Assertions.assertEquals(0, config.getMaxPendingPersists());

Review Comment:
   Thanks for flagging this. This call predates the JUnit 5 migration; this PR 
only changes Assert to Assertions here. Deprecated API cleanup is outside this 
PR’s scope, so I’m intentionally leaving it unchanged.



-- 
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]

Reply via email to