Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
turboFei committed Oct 24, 2021
1 parent ea7db79 commit 850d6b5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ package org.apache.kyuubi.service.authentication
import java.security.Security
import javax.security.auth.login.LoginException

import org.apache.thrift.transport.TSaslServerTransport

import org.apache.kyuubi.{KyuubiFunSuite, KyuubiSQLException}
import org.apache.kyuubi.config.KyuubiConf
import org.apache.kyuubi.service.authentication.PlainSASLServer.SaslPlainProvider
Expand Down Expand Up @@ -79,12 +81,10 @@ class KyuubiAuthenticationFactorySuite extends KyuubiFunSuite {
test("AuthType is NOSASL if only NOSASL is specified") {
val conf = KyuubiConf().set(KyuubiConf.AUTHENTICATION_METHOD, Seq("NOSASL"))
var factory = new KyuubiAuthenticationFactory(conf)
factory.getTTransportFactory
assert(!Security.getProviders.exists(_.isInstanceOf[SaslPlainProvider]))
!factory.getTTransportFactory.isInstanceOf[TSaslServerTransport.Factory]

conf.set(KyuubiConf.AUTHENTICATION_METHOD, Seq("NOSASL", "NONE"))
factory = new KyuubiAuthenticationFactory(conf)
factory.getTTransportFactory
assert(Security.getProviders.exists(_.isInstanceOf[SaslPlainProvider]))
factory.getTTransportFactory.isInstanceOf[TSaslServerTransport.Factory]
}
}

0 comments on commit 850d6b5

Please sign in to comment.