kfaraz commented on code in PR #19709:
URL: https://github.com/apache/druid/pull/19709#discussion_r3619392976


##########
indexing-service/src/test/java/org/apache/druid/indexing/overlord/ForkingTaskRunnerTest.java:
##########
@@ -79,6 +79,46 @@ public class ForkingTaskRunnerTest
   @Rule
   public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
+  @Test
+  public void testGetJavaCommandPrefersRunJavaScriptWhenPresent() throws 
IOException
+  {
+    final File workingDir = temporaryFolder.newFolder();
+    final File binDir = new File(workingDir, "bin");
+    Assert.assertTrue(binDir.mkdirs());
+    Assert.assertTrue(new File(binDir, "run-java").createNewFile());
+
+    Assert.assertEquals(
+        "bin/run-java",
+        ForkingTaskRunner.getJavaCommand(new 
ForkingTaskRunnerConfig().getJavaCommand(), workingDir)
+    );
+  }
+
+  @Test
+  public void testGetJavaCommandFallsBackToJavaWhenScriptAbsent() throws 
IOException
+  {
+    final File workingDir = temporaryFolder.newFolder();
+
+    Assert.assertEquals(
+        "java",
+        ForkingTaskRunner.getJavaCommand(new 
ForkingTaskRunnerConfig().getJavaCommand(), workingDir)
+    );
+  }
+
+  @Test
+  public void testGetJavaCommandRespectsExplicitOverride() throws IOException
+  {
+    final File workingDir = temporaryFolder.newFolder();
+    final File binDir = new File(workingDir, "bin");
+    Assert.assertTrue(binDir.mkdirs());

Review Comment:
   to avoid use of forbidden API
   ```suggestion
       Assert.assertTrue(FileUtils(binDir.mkdirp()));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to