Skip to content

Commit 115fae5

Browse files
committed
increase test code coverage
1 parent b45b28c commit 115fae5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

kyuubi-common/src/test/scala/org/apache/kyuubi/service/authentication/JdbcAuthenticationProviderImplSuite.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,15 @@ class JdbcAuthenticationProviderImplSuite extends KyuubiFunSuite {
122122
_conf.unset(AUTHENTICATION_JDBC_URL)
123123
val e10 = intercept[IllegalArgumentException] { new JdbcAuthenticationProviderImpl(_conf) }
124124
assert(e10.getMessage.contains("JDBC url is not configured"))
125+
126+
_conf = conf.clone
127+
_conf.set(AUTHENTICATION_JDBC_QUERY, "SELECT 1 FROM user_auth")
128+
new JdbcAuthenticationProviderImpl(_conf)
129+
130+
_conf.set(AUTHENTICATION_JDBC_QUERY, "SELECT 1 FROM user_auth WHERE passwd=${password}")
131+
new JdbcAuthenticationProviderImpl(_conf)
132+
133+
_conf.set(AUTHENTICATION_JDBC_QUERY, "SELECT 1 FROM user_auth WHERE username=${user}")
134+
new JdbcAuthenticationProviderImpl(_conf)
125135
}
126136
}

kyuubi-common/src/test/scala/org/apache/kyuubi/util/JdbcUtilsSuite.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,5 @@ class JdbcUtilsSuite extends KyuubiFunSuite {
7878
JdbcUtils.redactPassword(None)
7979
}
8080

81-
8281
}
8382
}

0 commit comments

Comments
 (0)