Skip to content

Commit 67641a8

Browse files
committed
[SPARK-51033][CORE][TESTS] Fix CryptoStreamUtilsSuite to use sameElements for array comparison
### What changes were proposed in this pull request? This PR aims to fix `CryptoStreamUtilsSuite` to use `sameElements` for array comparison. ### Why are the changes needed? Since the existing assertion is invalid due to `String != Array[Byte]` comparison, it causes a compilation error from Scala 2.13.16. https://github.com/apache/spark/blob/6bbfa2dad8c70b94ca52eb7cddde5ec68efbe0b1/core/src/test/scala/org/apache/spark/security/CryptoStreamUtilsSuite.scala#L115 - #49478 ### Does this PR introduce _any_ user-facing change? No, this is a test-only fix. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49727 from dongjoon-hyun/SPARK-51033. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 5cce6e9) Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 2004df7 commit 67641a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/test/scala/org/apache/spark/security/CryptoStreamUtilsSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class CryptoStreamUtilsSuite extends SparkFunSuite {
112112
bytes.toByteArray()
113113
}.collect()(0)
114114

115-
assert(content != encrypted)
115+
assert(!content.getBytes(UTF_8).sameElements(encrypted))
116116

117117
val in = CryptoStreamUtils.createCryptoInputStream(new ByteArrayInputStream(encrypted),
118118
sc.conf, SparkEnv.get.securityManager.getIOEncryptionKey().get)

0 commit comments

Comments
 (0)