You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "FrankChen021 (via GitHub)" <gi...@apache.org> on 2026/08/07 17:03:09 UTC

[PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

FrankChen021 opened a new pull request, #19920:
URL: https://github.com/apache/druid/pull/19920

   ## Summary
   
   - Migrate the common indexing-service support tests to JUnit 5.
   - Cover appenderator, residual common support, task logs, compact, input, and scheduled-batch tests.
   - Replace JUnit 4 and Hamcrest usage with Jupiter and AssertJ APIs, while using Druid's existing temporary-directory utilities.
   - Keep this batch independent from the Task Actions/Compaction, ingestion/parallel, Overlord, seekable-stream, and worker batches.
   
   ## Validation
   
   - Test compilation passed.
   - 33 targeted classes passed: 191 tests, 0 failures, 0 errors, 0 skips.
   - Maven static verification passed with Checkstyle, forbidden APIs, PMD, and Enforcer.
   - Legacy/prohibited usage scans and `git diff --check` passed.
   
   ## Tracking
   
   Part of [#13948](https://github.com/apache/druid/issues/13948).
   
   Related: [#19910](https://github.com/apache/druid/pull/19910).
   


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #19920:
URL: https://github.com/apache/druid/pull/19920#discussion_r3737629412


##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -87,13 +81,13 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertFalse(tuningConfig.isReportParseExceptions());
-    Assert.assertEquals(IndexSpec.getDefault(), tuningConfig.getIndexSpec());
-    Assert.assertEquals(new Period(Integer.MAX_VALUE), tuningConfig.getIntermediatePersistPeriod());
-    Assert.assertEquals(0, tuningConfig.getMaxPendingPersists());
-    Assert.assertEquals(1000000, tuningConfig.getMaxRowsInMemory());
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertFalse(tuningConfig.isReportParseExceptions());
+    Assertions.assertEquals(IndexSpec.getDefault(), tuningConfig.getIndexSpec());
+    Assertions.assertEquals(new Period(Integer.MAX_VALUE), tuningConfig.getIntermediatePersistPeriod());
+    Assertions.assertEquals(0, tuningConfig.getMaxPendingPersists());
+    Assertions.assertEquals(1000000, tuningConfig.getMaxRowsInMemory());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11706)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -87,13 +81,13 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertFalse(tuningConfig.isReportParseExceptions());
-    Assert.assertEquals(IndexSpec.getDefault(), tuningConfig.getIndexSpec());
-    Assert.assertEquals(new Period(Integer.MAX_VALUE), tuningConfig.getIntermediatePersistPeriod());
-    Assert.assertEquals(0, tuningConfig.getMaxPendingPersists());
-    Assert.assertEquals(1000000, tuningConfig.getMaxRowsInMemory());
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertFalse(tuningConfig.isReportParseExceptions());
+    Assertions.assertEquals(IndexSpec.getDefault(), tuningConfig.getIndexSpec());
+    Assertions.assertEquals(new Period(Integer.MAX_VALUE), tuningConfig.getIntermediatePersistPeriod());
+    Assertions.assertEquals(0, tuningConfig.getMaxPendingPersists());
+    Assertions.assertEquals(1000000, tuningConfig.getMaxRowsInMemory());
+    Assertions.assertNull(tuningConfig.getNumShards());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getNumShards](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11705)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11710)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11714)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":10, \"numShards\":-1}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":-1, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertNotNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(PartitionsSpec.DEFAULT_MAX_ROWS_PER_SEGMENT, tuningConfig.getMaxRowsPerSegment().intValue());
+    Assertions.assertNull(tuningConfig.getNumShards());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getNumShards](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11718)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":10, \"numShards\":-1}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":-1, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertNotNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(PartitionsSpec.DEFAULT_MAX_ROWS_PER_SEGMENT, tuningConfig.getMaxRowsPerSegment().intValue());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertNotNull(tuningConfig.getMaxRowsPerSegment());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11719)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -247,35 +252,35 @@
     Thread.sleep(100); // Just want to run the clock a bit to make sure the task id doesn't change
     final IndexTask task2 = (IndexTask) jsonMapper.readValue(json, Task.class);
 
-    Assert.assertEquals("foo", task.getDataSource());
+    Assertions.assertEquals("foo", task.getDataSource());
 
-    Assert.assertEquals(task.getId(), task2.getId());
-    Assert.assertEquals(task.getGroupId(), task2.getGroupId());
-    Assert.assertEquals(task.getDataSource(), task2.getDataSource());
+    Assertions.assertEquals(task.getId(), task2.getId());
+    Assertions.assertEquals(task.getGroupId(), task2.getGroupId());
+    Assertions.assertEquals(task.getDataSource(), task2.getDataSource());
 
     IndexTask.IndexIOConfig taskIoConfig = task.getIngestionSchema().getIOConfig();
     IndexTask.IndexIOConfig task2IoConfig = task2.getIngestionSchema().getIOConfig();
 
-    Assert.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
-    Assert.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
+    Assertions.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
+    Assertions.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
 
     IndexTask.IndexTuningConfig taskTuningConfig = task.getIngestionSchema().getTuningConfig();
     IndexTask.IndexTuningConfig task2TuningConfig = task2.getIngestionSchema().getTuningConfig();
 
-    Assert.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
-    Assert.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
-    Assert.assertEquals(
+    Assertions.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
+    Assertions.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
+    Assertions.assertEquals(
         taskTuningConfig.getIntermediatePersistPeriod(),
         task2TuningConfig.getIntermediatePersistPeriod()
     );
-    Assert.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
-    Assert.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(taskTuningConfig.isReportParseExceptions(), task2TuningConfig.isReportParseExceptions());
-    Assert.assertEquals(taskTuningConfig.getAwaitSegmentAvailabilityTimeoutMillis(), task2TuningConfig.getAwaitSegmentAvailabilityTimeoutMillis());
+    Assertions.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
+    Assertions.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11724)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -247,35 +252,35 @@
     Thread.sleep(100); // Just want to run the clock a bit to make sure the task id doesn't change
     final IndexTask task2 = (IndexTask) jsonMapper.readValue(json, Task.class);
 
-    Assert.assertEquals("foo", task.getDataSource());
+    Assertions.assertEquals("foo", task.getDataSource());
 
-    Assert.assertEquals(task.getId(), task2.getId());
-    Assert.assertEquals(task.getGroupId(), task2.getGroupId());
-    Assert.assertEquals(task.getDataSource(), task2.getDataSource());
+    Assertions.assertEquals(task.getId(), task2.getId());
+    Assertions.assertEquals(task.getGroupId(), task2.getGroupId());
+    Assertions.assertEquals(task.getDataSource(), task2.getDataSource());
 
     IndexTask.IndexIOConfig taskIoConfig = task.getIngestionSchema().getIOConfig();
     IndexTask.IndexIOConfig task2IoConfig = task2.getIngestionSchema().getIOConfig();
 
-    Assert.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
-    Assert.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
+    Assertions.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
+    Assertions.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
 
     IndexTask.IndexTuningConfig taskTuningConfig = task.getIngestionSchema().getTuningConfig();
     IndexTask.IndexTuningConfig task2TuningConfig = task2.getIngestionSchema().getTuningConfig();
 
-    Assert.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
-    Assert.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
-    Assert.assertEquals(
+    Assertions.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
+    Assertions.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
+    Assertions.assertEquals(
         taskTuningConfig.getIntermediatePersistPeriod(),
         task2TuningConfig.getIntermediatePersistPeriod()
     );
-    Assert.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
-    Assert.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(taskTuningConfig.isReportParseExceptions(), task2TuningConfig.isReportParseExceptions());
-    Assert.assertEquals(taskTuningConfig.getAwaitSegmentAvailabilityTimeoutMillis(), task2TuningConfig.getAwaitSegmentAvailabilityTimeoutMillis());
+    Assertions.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
+    Assertions.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11723)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11707)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11712)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11709)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getNumShards](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11708)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getNumShards](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11713)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":10, \"numShards\":-1}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":-1, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertNotNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(PartitionsSpec.DEFAULT_MAX_ROWS_PER_SEGMENT, tuningConfig.getMaxRowsPerSegment().intValue());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertNotNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(PartitionsSpec.DEFAULT_MAX_ROWS_PER_SEGMENT, tuningConfig.getMaxRowsPerSegment().intValue());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11720)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -247,35 +252,35 @@
     Thread.sleep(100); // Just want to run the clock a bit to make sure the task id doesn't change
     final IndexTask task2 = (IndexTask) jsonMapper.readValue(json, Task.class);
 
-    Assert.assertEquals("foo", task.getDataSource());
+    Assertions.assertEquals("foo", task.getDataSource());
 
-    Assert.assertEquals(task.getId(), task2.getId());
-    Assert.assertEquals(task.getGroupId(), task2.getGroupId());
-    Assert.assertEquals(task.getDataSource(), task2.getDataSource());
+    Assertions.assertEquals(task.getId(), task2.getId());
+    Assertions.assertEquals(task.getGroupId(), task2.getGroupId());
+    Assertions.assertEquals(task.getDataSource(), task2.getDataSource());
 
     IndexTask.IndexIOConfig taskIoConfig = task.getIngestionSchema().getIOConfig();
     IndexTask.IndexIOConfig task2IoConfig = task2.getIngestionSchema().getIOConfig();
 
-    Assert.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
-    Assert.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
+    Assertions.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
+    Assertions.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
 
     IndexTask.IndexTuningConfig taskTuningConfig = task.getIngestionSchema().getTuningConfig();
     IndexTask.IndexTuningConfig task2TuningConfig = task2.getIngestionSchema().getTuningConfig();
 
-    Assert.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
-    Assert.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
-    Assert.assertEquals(
+    Assertions.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
+    Assertions.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
+    Assertions.assertEquals(
         taskTuningConfig.getIntermediatePersistPeriod(),
         task2TuningConfig.getIntermediatePersistPeriod()
     );
-    Assert.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
-    Assert.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(taskTuningConfig.isReportParseExceptions(), task2TuningConfig.isReportParseExceptions());
-    Assert.assertEquals(taskTuningConfig.getAwaitSegmentAvailabilityTimeoutMillis(), task2TuningConfig.getAwaitSegmentAvailabilityTimeoutMillis());
+    Assertions.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
+    Assertions.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getNumShards](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11721)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getNumShards](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11711)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getNumShards](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11715)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":10, \"numShards\":-1}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getNumShards](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11716)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":10, \"numShards\":-1}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getMaxRowsPerSegment](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11717)



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -247,35 +252,35 @@
     Thread.sleep(100); // Just want to run the clock a bit to make sure the task id doesn't change
     final IndexTask task2 = (IndexTask) jsonMapper.readValue(json, Task.class);
 
-    Assert.assertEquals("foo", task.getDataSource());
+    Assertions.assertEquals("foo", task.getDataSource());
 
-    Assert.assertEquals(task.getId(), task2.getId());
-    Assert.assertEquals(task.getGroupId(), task2.getGroupId());
-    Assert.assertEquals(task.getDataSource(), task2.getDataSource());
+    Assertions.assertEquals(task.getId(), task2.getId());
+    Assertions.assertEquals(task.getGroupId(), task2.getGroupId());
+    Assertions.assertEquals(task.getDataSource(), task2.getDataSource());
 
     IndexTask.IndexIOConfig taskIoConfig = task.getIngestionSchema().getIOConfig();
     IndexTask.IndexIOConfig task2IoConfig = task2.getIngestionSchema().getIOConfig();
 
-    Assert.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
-    Assert.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
+    Assertions.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
+    Assertions.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
 
     IndexTask.IndexTuningConfig taskTuningConfig = task.getIngestionSchema().getTuningConfig();
     IndexTask.IndexTuningConfig task2TuningConfig = task2.getIngestionSchema().getTuningConfig();
 
-    Assert.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
-    Assert.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
-    Assert.assertEquals(
+    Assertions.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
+    Assertions.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
+    Assertions.assertEquals(
         taskTuningConfig.getIntermediatePersistPeriod(),
         task2TuningConfig.getIntermediatePersistPeriod()
     );
-    Assert.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
-    Assert.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(taskTuningConfig.isReportParseExceptions(), task2TuningConfig.isReportParseExceptions());
-    Assert.assertEquals(taskTuningConfig.getAwaitSegmentAvailabilityTimeoutMillis(), task2TuningConfig.getAwaitSegmentAvailabilityTimeoutMillis());
+    Assertions.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
+    Assertions.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());

Review Comment:
   ## CodeQL / Deprecated method or constructor invocation
   
   Invoking [IndexTuningConfig.getNumShards](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11722)



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on code in PR #19920:
URL: https://github.com/apache/druid/pull/19920#discussion_r3739918265


##########
indexing-service/src/test/java/org/apache/druid/indexing/common/tasklogs/FileTaskLogsTest.java:
##########
@@ -78,7 +69,7 @@ public void testSimple() throws Exception
   public void testSimpleReport() throws Exception
   {
     final ObjectMapper mapper = TestHelper.makeJsonMapper();
-    final File tmpDir = temporaryFolder.newFolder();
+    final File tmpDir = FileUtils.createTempDir();
     final File logDir = new File(tmpDir, "druid/logs");
     final File reportFile = new File(tmpDir, "report.json");
 

Review Comment:
   Test reply path



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 merged PR #19920:
URL: https://github.com/apache/druid/pull/19920


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #19920:
URL: https://github.com/apache/druid/pull/19920#discussion_r3737514646


##########
indexing-service/src/test/java/org/apache/druid/indexing/compact/OverlordCompactionSchedulerTest.java:
##########
@@ -311,15 +311,15 @@ public void test_enableSupervisors_triggersStart()
     // Becoming leader does not trigger start since scheduler is disabled
     scheduler.becomeLeader();
     runScheduledJob();
-    Assert.assertFalse(scheduler.isRunning());
+    Assertions.assertFalse(scheduler.isRunning());
 
     // Enable the schduler to trigger start

Review Comment:
   Typo in comment: "schduler" 	 "scheduler".



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/tasklogs/FileTaskLogsTest.java:
##########
@@ -66,7 +57,7 @@ public void testSimple() throws Exception
       for (Map.Entry<Long, String> entry : expected.entrySet()) {
         final byte[] bytes = ByteStreams.toByteArray(taskLogs.streamTaskLog("foo", entry.getKey()).get());
         final String string = StringUtils.fromUtf8(bytes);
-        Assert.assertEquals(StringUtils.format("Read with offset %,d", entry.getKey()), string, entry.getValue());
+        Assertions.assertEquals(string, entry.getValue(), StringUtils.format("Read with offset %,d", entry.getKey()));

Review Comment:
   `Assertions.assertEquals` uses the signature `assertEquals(expected, actual, message)`. Here the actual and expected values are swapped, which makes failures harder to interpret (expected/actual will be reversed in the assertion output).



##########
indexing-service/src/test/java/org/apache/druid/indexing/input/DruidSegmentReaderTest.java:
##########
@@ -1022,7 +1017,7 @@ private void persistSegment(List<InputRow> rows) throws IOException
                     .rows(rows)
                     .buildIncrementalIndex();
 
-    segmentDirectory = temporaryFolder.newFolder();
+    segmentDirectory = FileUtils.createTempDir();

Review Comment:
   `FileUtils.createTempDir()` does not automatically clean up (it just calls `Files.createTempDirectory`), so `segmentDirectory` will be left behind after each test run unless it is explicitly deleted (previously `TemporaryFolder` handled cleanup). Consider adding an `@AfterEach` that deletes `segmentDirectory` (and ideally reusing a single temp directory for the reader temp dirs as well).



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/TaskToolboxTest.java:
##########
@@ -118,7 +114,7 @@ public void setUp() throws IOException
     EasyMock.replay(task, mockHandoffNotifierFactory, mockIndexMergerV9);
 
     TaskConfig taskConfig = new TaskConfigBuilder()
-        .setBaseDir(temporaryFolder.newFile().toString())
+        .setBaseDir(FileUtils.createTempDir().toString())
         .build();

Review Comment:
   `TaskConfigBuilder.setBaseDir(FileUtils.createTempDir().toString())` creates a fresh temp directory for every test method, but there is no corresponding cleanup. This can leak directories under `java.io.tmpdir` across test runs. Prefer using a JUnit 5 temp directory lifecycle (`@TempDir`) or deleting the created directory in an `@AfterEach`.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/tasklogs/FileTaskLogsTest.java:
##########
@@ -78,7 +69,7 @@ public void testSimple() throws Exception
   public void testSimpleReport() throws Exception
   {
     final ObjectMapper mapper = TestHelper.makeJsonMapper();
-    final File tmpDir = temporaryFolder.newFolder();
+    final File tmpDir = FileUtils.createTempDir();
     final File logDir = new File(tmpDir, "druid/logs");
     final File reportFile = new File(tmpDir, "report.json");
 

Review Comment:
   This test creates a temp directory via `FileUtils.createTempDir()` but never deletes it. Unlike `TemporaryFolder`, `FileUtils.createTempDir()` does not clean up automatically, so repeated test runs can leak directories under `java.io.tmpdir`.
   
   This issue also appears on line 94 of the same file.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/AbstractTaskTest.java:
##########
@@ -56,15 +54,19 @@ public class AbstractTaskTest
 {
   private ObjectMapper objectMapper;
 
-  @Rule
-  public TemporaryFolder temporaryFolder = new TemporaryFolder();
-
-  @Before
+  @BeforeEach
   public void setup()
   {
     objectMapper = new TestUtils().getTestObjectMapper();
   }
 
+  private static File createTempReportFile() throws Exception
+  {
+    final File reportsFile = new File(org.apache.druid.java.util.common.FileUtils.createTempDir(), "report.json");
+    FileUtils.write(reportsFile, "", StandardCharsets.UTF_8);
+    return reportsFile;

Review Comment:
   `createTempReportFile()` creates a new temp directory and file but never deletes it. Since `FileUtils.createTempDir()` does not auto-cleanup, repeated runs can leave many `report.json` temp dirs behind. Consider using `@TempDir` or deleting the parent directory after the test completes.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on code in PR #19920:
URL: https://github.com/apache/druid/pull/19920#discussion_r3739918265


##########
indexing-service/src/test/java/org/apache/druid/indexing/common/tasklogs/FileTaskLogsTest.java:
##########
@@ -78,7 +69,7 @@ public void testSimple() throws Exception
   public void testSimpleReport() throws Exception
   {
     final ObjectMapper mapper = TestHelper.makeJsonMapper();
-    final File tmpDir = temporaryFolder.newFolder();
+    final File tmpDir = FileUtils.createTempDir();
     final File logDir = new File(tmpDir, "druid/logs");
     final File reportFile = new File(tmpDir, "report.json");
 

Review Comment:
   Test reply path



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on code in PR #19920:
URL: https://github.com/apache/druid/pull/19920#discussion_r3739910693


##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/AbstractTaskTest.java:
##########
@@ -56,15 +54,19 @@ public class AbstractTaskTest
 {
   private ObjectMapper objectMapper;
 
-  @Rule
-  public TemporaryFolder temporaryFolder = new TemporaryFolder();
-
-  @Before
+  @BeforeEach
   public void setup()
   {
     objectMapper = new TestUtils().getTestObjectMapper();
   }
 
+  private static File createTempReportFile() throws Exception
+  {
+    final File reportsFile = new File(org.apache.druid.java.util.common.FileUtils.createTempDir(), "report.json");
+    FileUtils.write(reportsFile, "", StandardCharsets.UTF_8);
+    return reportsFile;

Review Comment:
   Reused a test-owned base directory and delete it in @AfterEach instead of creating an untracked base directory for each test.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/input/DruidSegmentReaderTest.java:
##########
@@ -1022,7 +1017,7 @@ private void persistSegment(List<InputRow> rows) throws IOException
                     .rows(rows)
                     .buildIncrementalIndex();
 
-    segmentDirectory = temporaryFolder.newFolder();
+    segmentDirectory = FileUtils.createTempDir();

Review Comment:
   Added per-test cleanup for segmentDirectory with an @AfterEach method so the persisted segment is removed after each test.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/AbstractTaskTest.java:
##########
@@ -56,15 +54,19 @@ public class AbstractTaskTest
 {
   private ObjectMapper objectMapper;
 
-  @Rule
-  public TemporaryFolder temporaryFolder = new TemporaryFolder();
-
-  @Before
+  @BeforeEach
   public void setup()
   {
     objectMapper = new TestUtils().getTestObjectMapper();
   }
 
+  private static File createTempReportFile() throws Exception
+  {
+    final File reportsFile = new File(org.apache.druid.java.util.common.FileUtils.createTempDir(), "report.json");
+    FileUtils.write(reportsFile, "", StandardCharsets.UTF_8);
+    return reportsFile;

Review Comment:
   Reused a test-owned base directory and delete it in @AfterEach instead of creating an untracked base directory for each test.



##########
indexing-service/src/test/java/org/apache/druid/indexing/input/DruidSegmentReaderTest.java:
##########
@@ -1022,7 +1017,7 @@ private void persistSegment(List<InputRow> rows) throws IOException
                     .rows(rows)
                     .buildIncrementalIndex();
 
-    segmentDirectory = temporaryFolder.newFolder();
+    segmentDirectory = FileUtils.createTempDir();

Review Comment:
   Added per-test cleanup for segmentDirectory with an @AfterEach method so the persisted segment is removed after each test.



##########
indexing-service/src/test/java/org/apache/druid/indexing/input/DruidSegmentReaderTest.java:
##########
@@ -1022,7 +1017,7 @@ private void persistSegment(List<InputRow> rows) throws IOException
                     .rows(rows)
                     .buildIncrementalIndex();
 
-    segmentDirectory = temporaryFolder.newFolder();
+    segmentDirectory = FileUtils.createTempDir();

Review Comment:
   Added per-test cleanup for segmentDirectory with an @AfterEach method so the persisted segment is removed after each test.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/AbstractTaskTest.java:
##########
@@ -56,15 +54,19 @@ public class AbstractTaskTest
 {
   private ObjectMapper objectMapper;
 
-  @Rule
-  public TemporaryFolder temporaryFolder = new TemporaryFolder();
-
-  @Before
+  @BeforeEach
   public void setup()
   {
     objectMapper = new TestUtils().getTestObjectMapper();
   }
 
+  private static File createTempReportFile() throws Exception
+  {
+    final File reportsFile = new File(org.apache.druid.java.util.common.FileUtils.createTempDir(), "report.json");
+    FileUtils.write(reportsFile, "", StandardCharsets.UTF_8);
+    return reportsFile;

Review Comment:
   Reused a test-owned base directory and delete it in @AfterEach instead of creating an untracked base directory for each test.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on code in PR #19920:
URL: https://github.com/apache/druid/pull/19920#discussion_r3739911607


##########
indexing-service/src/test/java/org/apache/druid/indexing/common/TaskToolboxTest.java:
##########
@@ -118,7 +114,7 @@ public void setUp() throws IOException
     EasyMock.replay(task, mockHandoffNotifierFactory, mockIndexMergerV9);
 
     TaskConfig taskConfig = new TaskConfigBuilder()
-        .setBaseDir(temporaryFolder.newFile().toString())
+        .setBaseDir(FileUtils.createTempDir().toString())
         .build();

Review Comment:
   Correction: in TaskToolboxTest, the test-owned baseDir is reused and deleted in @AfterEach; no segmentDirectory change is involved.



##########
indexing-service/src/test/java/org/apache/druid/indexing/compact/OverlordCompactionSchedulerTest.java:
##########
@@ -311,15 +311,15 @@ public void test_enableSupervisors_triggersStart()
     // Becoming leader does not trigger start since scheduler is disabled
     scheduler.becomeLeader();
     runScheduledJob();
-    Assert.assertFalse(scheduler.isRunning());
+    Assertions.assertFalse(scheduler.isRunning());
 
     // Enable the schduler to trigger start

Review Comment:
   Fixed the comment typo from schduler to scheduler.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getNumShards() call with a helper that reads HashedPartitionsSpec.getNumShards() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getNumShards() call with a helper that reads HashedPartitionsSpec.getNumShards() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getNumShards() call with a helper that reads HashedPartitionsSpec.getNumShards() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getNumShards() call with a helper that reads HashedPartitionsSpec.getNumShards() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -247,35 +252,35 @@
     Thread.sleep(100); // Just want to run the clock a bit to make sure the task id doesn't change
     final IndexTask task2 = (IndexTask) jsonMapper.readValue(json, Task.class);
 
-    Assert.assertEquals("foo", task.getDataSource());
+    Assertions.assertEquals("foo", task.getDataSource());
 
-    Assert.assertEquals(task.getId(), task2.getId());
-    Assert.assertEquals(task.getGroupId(), task2.getGroupId());
-    Assert.assertEquals(task.getDataSource(), task2.getDataSource());
+    Assertions.assertEquals(task.getId(), task2.getId());
+    Assertions.assertEquals(task.getGroupId(), task2.getGroupId());
+    Assertions.assertEquals(task.getDataSource(), task2.getDataSource());
 
     IndexTask.IndexIOConfig taskIoConfig = task.getIngestionSchema().getIOConfig();
     IndexTask.IndexIOConfig task2IoConfig = task2.getIngestionSchema().getIOConfig();
 
-    Assert.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
-    Assert.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
+    Assertions.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
+    Assertions.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
 
     IndexTask.IndexTuningConfig taskTuningConfig = task.getIngestionSchema().getTuningConfig();
     IndexTask.IndexTuningConfig task2TuningConfig = task2.getIngestionSchema().getTuningConfig();
 
-    Assert.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
-    Assert.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
-    Assert.assertEquals(
+    Assertions.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
+    Assertions.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
+    Assertions.assertEquals(
         taskTuningConfig.getIntermediatePersistPeriod(),
         task2TuningConfig.getIntermediatePersistPeriod()
     );
-    Assert.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
-    Assert.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(taskTuningConfig.isReportParseExceptions(), task2TuningConfig.isReportParseExceptions());
-    Assert.assertEquals(taskTuningConfig.getAwaitSegmentAvailabilityTimeoutMillis(), task2TuningConfig.getAwaitSegmentAvailabilityTimeoutMillis());
+    Assertions.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
+    Assertions.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -247,35 +252,35 @@
     Thread.sleep(100); // Just want to run the clock a bit to make sure the task id doesn't change
     final IndexTask task2 = (IndexTask) jsonMapper.readValue(json, Task.class);
 
-    Assert.assertEquals("foo", task.getDataSource());
+    Assertions.assertEquals("foo", task.getDataSource());
 
-    Assert.assertEquals(task.getId(), task2.getId());
-    Assert.assertEquals(task.getGroupId(), task2.getGroupId());
-    Assert.assertEquals(task.getDataSource(), task2.getDataSource());
+    Assertions.assertEquals(task.getId(), task2.getId());
+    Assertions.assertEquals(task.getGroupId(), task2.getGroupId());
+    Assertions.assertEquals(task.getDataSource(), task2.getDataSource());
 
     IndexTask.IndexIOConfig taskIoConfig = task.getIngestionSchema().getIOConfig();
     IndexTask.IndexIOConfig task2IoConfig = task2.getIngestionSchema().getIOConfig();
 
-    Assert.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
-    Assert.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
+    Assertions.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
+    Assertions.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
 
     IndexTask.IndexTuningConfig taskTuningConfig = task.getIngestionSchema().getTuningConfig();
     IndexTask.IndexTuningConfig task2TuningConfig = task2.getIngestionSchema().getTuningConfig();
 
-    Assert.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
-    Assert.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
-    Assert.assertEquals(
+    Assertions.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
+    Assertions.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
+    Assertions.assertEquals(
         taskTuningConfig.getIntermediatePersistPeriod(),
         task2TuningConfig.getIntermediatePersistPeriod()
     );
-    Assert.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
-    Assert.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(taskTuningConfig.isReportParseExceptions(), task2TuningConfig.isReportParseExceptions());
-    Assert.assertEquals(taskTuningConfig.getAwaitSegmentAvailabilityTimeoutMillis(), task2TuningConfig.getAwaitSegmentAvailabilityTimeoutMillis());
+    Assertions.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
+    Assertions.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":10, \"numShards\":-1}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getNumShards() call with a helper that reads HashedPartitionsSpec.getNumShards() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":10, \"numShards\":-1}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":10, \"numShards\":-1}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":-1, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertNotNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(PartitionsSpec.DEFAULT_MAX_ROWS_PER_SEGMENT, tuningConfig.getMaxRowsPerSegment().intValue());
+    Assertions.assertNull(tuningConfig.getNumShards());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getNumShards() call with a helper that reads HashedPartitionsSpec.getNumShards() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":10, \"numShards\":-1}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":-1, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertNotNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(PartitionsSpec.DEFAULT_MAX_ROWS_PER_SEGMENT, tuningConfig.getMaxRowsPerSegment().intValue());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertNotNull(tuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -247,35 +252,35 @@
     Thread.sleep(100); // Just want to run the clock a bit to make sure the task id doesn't change
     final IndexTask task2 = (IndexTask) jsonMapper.readValue(json, Task.class);
 
-    Assert.assertEquals("foo", task.getDataSource());
+    Assertions.assertEquals("foo", task.getDataSource());
 
-    Assert.assertEquals(task.getId(), task2.getId());
-    Assert.assertEquals(task.getGroupId(), task2.getGroupId());
-    Assert.assertEquals(task.getDataSource(), task2.getDataSource());
+    Assertions.assertEquals(task.getId(), task2.getId());
+    Assertions.assertEquals(task.getGroupId(), task2.getGroupId());
+    Assertions.assertEquals(task.getDataSource(), task2.getDataSource());
 
     IndexTask.IndexIOConfig taskIoConfig = task.getIngestionSchema().getIOConfig();
     IndexTask.IndexIOConfig task2IoConfig = task2.getIngestionSchema().getIOConfig();
 
-    Assert.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
-    Assert.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
+    Assertions.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
+    Assertions.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
 
     IndexTask.IndexTuningConfig taskTuningConfig = task.getIngestionSchema().getTuningConfig();
     IndexTask.IndexTuningConfig task2TuningConfig = task2.getIngestionSchema().getTuningConfig();
 
-    Assert.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
-    Assert.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
-    Assert.assertEquals(
+    Assertions.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
+    Assertions.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
+    Assertions.assertEquals(
         taskTuningConfig.getIntermediatePersistPeriod(),
         task2TuningConfig.getIntermediatePersistPeriod()
     );
-    Assert.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
-    Assert.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(taskTuningConfig.isReportParseExceptions(), task2TuningConfig.isReportParseExceptions());
-    Assert.assertEquals(taskTuningConfig.getAwaitSegmentAvailabilityTimeoutMillis(), task2TuningConfig.getAwaitSegmentAvailabilityTimeoutMillis());
+    Assertions.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
+    Assertions.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getNumShards() call with a helper that reads HashedPartitionsSpec.getNumShards() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -104,67 +98,69 @@
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\"}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"maxRowsPerSegment\":10}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
-    Assert.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":10, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(10, (int) tuningConfig.getNumShards());
+    Assertions.assertNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(10, (int) tuningConfig.getNumShards());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":10, \"numShards\":-1}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertEquals(10, (int) tuningConfig.getMaxRowsPerSegment());
 
     tuningConfig = jsonMapper.readValue(
         "{\"type\":\"index\", \"targetPartitionSize\":-1, \"numShards\":-1, \"forceGuaranteedRollup\": true}",
         IndexTask.IndexTuningConfig.class
     );
 
-    Assert.assertNull(tuningConfig.getNumShards());
-    Assert.assertNotNull(tuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(PartitionsSpec.DEFAULT_MAX_ROWS_PER_SEGMENT, tuningConfig.getMaxRowsPerSegment().intValue());
+    Assertions.assertNull(tuningConfig.getNumShards());
+    Assertions.assertNotNull(tuningConfig.getMaxRowsPerSegment());
+    Assertions.assertEquals(PartitionsSpec.DEFAULT_MAX_ROWS_PER_SEGMENT, tuningConfig.getMaxRowsPerSegment().intValue());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getMaxRowsPerSegment() call with a helper that reads PartitionsSpec.getMaxRowsPerSegment() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/TaskSerdeTest.java:
##########
@@ -247,35 +252,35 @@
     Thread.sleep(100); // Just want to run the clock a bit to make sure the task id doesn't change
     final IndexTask task2 = (IndexTask) jsonMapper.readValue(json, Task.class);
 
-    Assert.assertEquals("foo", task.getDataSource());
+    Assertions.assertEquals("foo", task.getDataSource());
 
-    Assert.assertEquals(task.getId(), task2.getId());
-    Assert.assertEquals(task.getGroupId(), task2.getGroupId());
-    Assert.assertEquals(task.getDataSource(), task2.getDataSource());
+    Assertions.assertEquals(task.getId(), task2.getId());
+    Assertions.assertEquals(task.getGroupId(), task2.getGroupId());
+    Assertions.assertEquals(task.getDataSource(), task2.getDataSource());
 
     IndexTask.IndexIOConfig taskIoConfig = task.getIngestionSchema().getIOConfig();
     IndexTask.IndexIOConfig task2IoConfig = task2.getIngestionSchema().getIOConfig();
 
-    Assert.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
-    Assert.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
-    Assert.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
+    Assertions.assertTrue(taskIoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertTrue(task2IoConfig.getInputSource() instanceof LocalInputSource);
+    Assertions.assertEquals(taskIoConfig.isAppendToExisting(), task2IoConfig.isAppendToExisting());
+    Assertions.assertEquals(taskIoConfig.isDropExisting(), task2IoConfig.isDropExisting());
 
     IndexTask.IndexTuningConfig taskTuningConfig = task.getIngestionSchema().getTuningConfig();
     IndexTask.IndexTuningConfig task2TuningConfig = task2.getIngestionSchema().getTuningConfig();
 
-    Assert.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
-    Assert.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
-    Assert.assertEquals(
+    Assertions.assertEquals(taskTuningConfig.getBasePersistDirectory(), task2TuningConfig.getBasePersistDirectory());
+    Assertions.assertEquals(taskTuningConfig.getIndexSpec(), task2TuningConfig.getIndexSpec());
+    Assertions.assertEquals(
         taskTuningConfig.getIntermediatePersistPeriod(),
         task2TuningConfig.getIntermediatePersistPeriod()
     );
-    Assert.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
-    Assert.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());
-    Assert.assertEquals(taskTuningConfig.getMaxRowsPerSegment(), task2TuningConfig.getMaxRowsPerSegment());
-    Assert.assertEquals(taskTuningConfig.isReportParseExceptions(), task2TuningConfig.isReportParseExceptions());
-    Assert.assertEquals(taskTuningConfig.getAwaitSegmentAvailabilityTimeoutMillis(), task2TuningConfig.getAwaitSegmentAvailabilityTimeoutMillis());
+    Assertions.assertEquals(taskTuningConfig.getMaxPendingPersists(), task2TuningConfig.getMaxPendingPersists());
+    Assertions.assertEquals(taskTuningConfig.getMaxRowsInMemory(), task2TuningConfig.getMaxRowsInMemory());
+    Assertions.assertEquals(taskTuningConfig.getNumShards(), task2TuningConfig.getNumShards());

Review Comment:
   Replaced the deprecated IndexTuningConfig.getNumShards() call with a helper that reads HashedPartitionsSpec.getNumShards() directly. Legacy JSON deserialization remains unchanged.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/tasklogs/FileTaskLogsTest.java:
##########
@@ -78,7 +69,7 @@ public void testSimple() throws Exception
   public void testSimpleReport() throws Exception
   {
     final ObjectMapper mapper = TestHelper.makeJsonMapper();
-    final File tmpDir = temporaryFolder.newFolder();
+    final File tmpDir = FileUtils.createTempDir();
     final File logDir = new File(tmpDir, "druid/logs");
     final File reportFile = new File(tmpDir, "report.json");
 

Review Comment:
   Fixed in commit 9b263726e0: the test now deletes the FileUtils.createTempDir() tree in a finally block, including the read-only-directory case after restoring writability. The focused FileTaskLogsTest passes.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on code in PR #19920:
URL: https://github.com/apache/druid/pull/19920#discussion_r3739909083


##########
indexing-service/src/test/java/org/apache/druid/indexing/common/tasklogs/FileTaskLogsTest.java:
##########
@@ -66,7 +57,7 @@ public void testSimple() throws Exception
       for (Map.Entry<Long, String> entry : expected.entrySet()) {
         final byte[] bytes = ByteStreams.toByteArray(taskLogs.streamTaskLog("foo", entry.getKey()).get());
         final String string = StringUtils.fromUtf8(bytes);
-        Assert.assertEquals(StringUtils.format("Read with offset %,d", entry.getKey()), string, entry.getValue());
+        Assertions.assertEquals(string, entry.getValue(), StringUtils.format("Read with offset %,d", entry.getKey()));

Review Comment:
   Fixed the assertion argument order so the expected value is first and the actual value is second.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #19920:
URL: https://github.com/apache/druid/pull/19920#discussion_r3740039833


##########
indexing-service/src/test/java/org/apache/druid/indexing/common/tasklogs/FileTaskLogsTest.java:
##########
@@ -121,50 +109,57 @@
   @Test
   public void testPushTaskLogDirCreationFails() throws Exception
   {
-    final File tmpDir = temporaryFolder.newFolder();
-    final File logDir = new File(tmpDir, "druid/logs");
-    final File logFile = new File(tmpDir, "log");
-    Files.asCharSink(logFile, StandardCharsets.UTF_8).write("blah");
+    final File tmpDir = temporaryFolder;
+    try {
+      final File logDir = new File(tmpDir, "druid/logs");
+      final File logFile = new File(tmpDir, "log");
+      Files.asCharSink(logFile, StandardCharsets.UTF_8).write("blah");
 
-    if (!tmpDir.setWritable(false)) {
-      throw new RuntimeException("failed to make tmp dir read-only");
-    }
+      if (!tmpDir.setWritable(false)) {
+        throw new RuntimeException("failed to make tmp dir read-only");
+      }
 
-    final TaskLogs taskLogs = new FileTaskLogs(new FileTaskLogsConfig(logDir));
+      final TaskLogs taskLogs = new FileTaskLogs(new FileTaskLogsConfig(logDir));
 
-    expectedException.expect(IOException.class);
-    expectedException.expectMessage("Cannot create directory");
-    taskLogs.pushTaskLog("foo", logFile);
+      final IOException exception = Assertions.assertThrows(
+          IOException.class,
+          () -> taskLogs.pushTaskLog("foo", logFile)
+      );
+      Assertions.assertTrue(exception.getMessage().contains("Cannot create directory"));
+    }
+    finally {
+      tmpDir.setWritable(true);

Review Comment:
   ## CodeQL / Ignored error status of call
   
   Method testPushTaskLogDirCreationFails ignores exceptional return value of File.setWritable.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/11744)



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] test(indexing-service): migrate common support tests to JUnit 5 (druid)

Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on code in PR #19920:
URL: https://github.com/apache/druid/pull/19920#discussion_r3739919515


##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/AbstractTaskTest.java:
##########
@@ -56,15 +54,19 @@ public class AbstractTaskTest
 {
   private ObjectMapper objectMapper;
 
-  @Rule
-  public TemporaryFolder temporaryFolder = new TemporaryFolder();
-
-  @Before
+  @BeforeEach
   public void setup()
   {
     objectMapper = new TestUtils().getTestObjectMapper();
   }
 
+  private static File createTempReportFile() throws Exception
+  {
+    final File reportsFile = new File(org.apache.druid.java.util.common.FileUtils.createTempDir(), "report.json");
+    FileUtils.write(reportsFile, "", StandardCharsets.UTF_8);
+    return reportsFile;

Review Comment:
   Correction to the earlier reply: this thread is AbstractTaskTest. The local edit now uses a test-owned tempReportDir and deletes it in @AfterEach, so createTempReportFile no longer leaks its parent directory.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org