Skip to content

Commit 1f81475

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 09a255a commit 1f81475

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
@@ -115,7 +115,7 @@ class CryptoStreamUtilsSuite extends SparkFunSuite {
115115
bytes.toByteArray()
116116
}.collect()(0)
117117

118-
assert(content != encrypted)
118+
assert(!content.getBytes(UTF_8).sameElements(encrypted))
119119

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

0 commit comments

Comments
 (0)