Skip to content

Commit fffd139

Browse files
committed
Review fixes:
* Added comment for getKrb5LoginModuleName. * Used === operator in tests instead of equals.
1 parent a2c4397 commit fffd139

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSecurityHelper.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ private[kafka010] object KafkaSecurityHelper extends Logging {
4949
}
5050
}
5151

52+
/**
53+
* Krb5LoginModule package vary in different JVMs.
54+
* Please see Hadoop UserGroupInformation for further details.
55+
*/
5256
private def getKrb5LoginModuleName(): String = {
5357
if (System.getProperty("java.vendor").contains("IBM")) {
5458
"com.ibm.security.auth.module.Krb5LoginModule"

external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/TokenUtilSuite.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ class TokenUtilSuite extends SparkFunSuite with BeforeAndAfterEach {
5858
val adminClientProperties = TokenUtil.createAdminClientProperties(sparkConf)
5959

6060
assert(adminClientProperties.get(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG)
61-
.equals(bootStrapServers))
61+
=== bootStrapServers)
6262
assert(adminClientProperties.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)
63-
.equals(plainSecurityProtocol))
63+
=== plainSecurityProtocol)
6464
assert(!adminClientProperties.containsKey("ssl.truststore.location"))
6565
assert(!adminClientProperties.containsKey("ssl.truststore.password"))
6666
}
@@ -74,11 +74,11 @@ class TokenUtilSuite extends SparkFunSuite with BeforeAndAfterEach {
7474
val adminClientProperties = TokenUtil.createAdminClientProperties(sparkConf)
7575

7676
assert(adminClientProperties.get(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG)
77-
.equals(bootStrapServers))
77+
=== bootStrapServers)
7878
assert(adminClientProperties.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)
79-
.equals(sslSecurityProtocol))
80-
assert(adminClientProperties.get("ssl.truststore.location").equals(trustStoreLocation))
81-
assert(adminClientProperties.get("ssl.truststore.password").equals(trustStorePassword))
79+
=== sslSecurityProtocol)
80+
assert(adminClientProperties.get("ssl.truststore.location") === trustStoreLocation)
81+
assert(adminClientProperties.get("ssl.truststore.password") === trustStorePassword)
8282
}
8383

8484
test("createAdminClientProperties without keytab should not set dynamic jaas config") {
@@ -88,9 +88,9 @@ class TokenUtilSuite extends SparkFunSuite with BeforeAndAfterEach {
8888
val adminClientProperties = TokenUtil.createAdminClientProperties(sparkConf)
8989

9090
assert(adminClientProperties.get(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG)
91-
.equals(bootStrapServers))
91+
=== bootStrapServers)
9292
assert(adminClientProperties.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)
93-
.equals(sslSecurityProtocol))
93+
=== sslSecurityProtocol)
9494
assert(!adminClientProperties.containsKey(SaslConfigs.SASL_MECHANISM))
9595
assert(!adminClientProperties.containsKey(SaslConfigs.SASL_JAAS_CONFIG))
9696
}
@@ -105,9 +105,9 @@ class TokenUtilSuite extends SparkFunSuite with BeforeAndAfterEach {
105105
val adminClientProperties = TokenUtil.createAdminClientProperties(sparkConf)
106106

107107
assert(adminClientProperties.get(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG)
108-
.equals(bootStrapServers))
108+
=== bootStrapServers)
109109
assert(adminClientProperties.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)
110-
.equals(sslSecurityProtocol))
110+
=== sslSecurityProtocol)
111111
assert(adminClientProperties.containsKey(SaslConfigs.SASL_MECHANISM))
112112
assert(adminClientProperties.containsKey(SaslConfigs.SASL_JAAS_CONFIG))
113113
}

0 commit comments

Comments
 (0)