tibrewalpratik17 commented on code in PR #12960:
URL: https://github.com/apache/pinot/pull/12960#discussion_r1605561893


##########
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/test/java/org/apache/pinot/plugin/minion/tasks/MinionTaskUtilsTest.java:
##########
@@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.plugin.minion.tasks;
+
+import java.net.URI;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.pinot.core.common.MinionConstants;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableTaskConfig;
+import org.apache.pinot.spi.config.table.TableType;
+import org.apache.pinot.spi.filesystem.LocalPinotFS;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.utils.builder.TableConfigBuilder;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+
+public class MinionTaskUtilsTest {
+
+  @Test
+  public void testGetInputPinotFS() throws Exception {
+    Map<String, String> taskConfigs = new HashMap<>();
+    taskConfigs.put("input.fs.className", 
"org.apache.pinot.spi.filesystem.LocalPinotFS");
+    URI fileURI = new URI("file:///path/to/file");
+
+    PinotFS pinotFS = MinionTaskUtils.getInputPinotFS(taskConfigs, fileURI);
+
+    assertTrue(pinotFS instanceof LocalPinotFS);
+  }
+
+  @Test
+  public void testGetOutputPinotFS() throws Exception {
+    Map<String, String> taskConfigs = new HashMap<>();
+    taskConfigs.put("output.fs.className", 
"org.apache.pinot.spi.filesystem.LocalPinotFS");
+    URI fileURI = new URI("file:///path/to/file");
+
+    PinotFS pinotFS = MinionTaskUtils.getOutputPinotFS(taskConfigs, fileURI);
+
+    assertTrue(pinotFS instanceof LocalPinotFS);
+  }
+
+  @Test
+  public void testIsLocalOutputDir() {
+    assertTrue(MinionTaskUtils.isLocalOutputDir("file"));
+    assertFalse(MinionTaskUtils.isLocalOutputDir("hdfs"));
+  }
+
+  @Test
+  public void testGetLocalPinotFs() {
+    assertTrue(MinionTaskUtils.getLocalPinotFs() instanceof LocalPinotFS);
+  }
+
+  @Test
+  public void testNormalizeDirectoryURI() {
+    assertEquals("file:///path/to/dir/", 
MinionTaskUtils.normalizeDirectoryURI("file:///path/to/dir"));
+    assertEquals("file:///path/to/dir/", 
MinionTaskUtils.normalizeDirectoryURI("file:///path/to/dir/"));
+  }
+
+  @Test
+  public void testExtractMinionAllowDownloadFromServer() {

Review Comment:
   yeah i was adding this file so ended up adding few more UTs. 😅 



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