diff --git a/kyuubi-hive-beeline/pom.xml b/kyuubi-hive-beeline/pom.xml
index d5affdfdcc4..728b7691375 100644
--- a/kyuubi-hive-beeline/pom.xml
+++ b/kyuubi-hive-beeline/pom.xml
@@ -132,6 +132,12 @@
+
+
+ junit
+ junit
+ test
+
diff --git a/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiBeeLine.java b/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiBeeLine.java
index 2eec5bbfa1d..8ec04d36941 100644
--- a/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiBeeLine.java
+++ b/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiBeeLine.java
@@ -149,9 +149,9 @@ int initArgs(String[] args) {
if (!connSuccessful && !exit) {
try {
Method defaultBeelineConnectMethod =
- BeeLine.class.getDeclaredMethod("defaultBeelineConnect");
+ BeeLine.class.getDeclaredMethod("defaultBeelineConnect", CommandLine.class);
defaultBeelineConnectMethod.setAccessible(true);
- connSuccessful = (boolean) defaultBeelineConnectMethod.invoke(this);
+ connSuccessful = (boolean) defaultBeelineConnectMethod.invoke(this, cl);
} catch (Exception t) {
error(t.getMessage());
diff --git a/kyuubi-hive-beeline/src/test/java/org/apache/hive/beeline/KyuubiBeeLineTest.java b/kyuubi-hive-beeline/src/test/java/org/apache/hive/beeline/KyuubiBeeLineTest.java
new file mode 100644
index 00000000000..b144c95c61f
--- /dev/null
+++ b/kyuubi-hive-beeline/src/test/java/org/apache/hive/beeline/KyuubiBeeLineTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.hive.beeline;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class KyuubiBeeLineTest {
+ @Test
+ public void testKyuubiBeelineWithoutArgs() {
+ KyuubiBeeLine kyuubiBeeLine = new KyuubiBeeLine();
+ int result = kyuubiBeeLine.initArgs(new String[0]);
+ assertEquals(0, result);
+ }
+}