This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new bee6ad41b78 Add more test cases on PasswordEncryption (#33422)
bee6ad41b78 is described below
commit bee6ad41b784f2726d47adb216c69bc4818b903a
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Oct 27 15:45:26 2024 +0800
Add more test cases on PasswordEncryption (#33422)
---
.../mysql/ingest/incremental/client/PasswordEncryptionTest.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git
a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/incremental/client/PasswordEncryptionTest.java
b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/incremental/client/PasswordEncryptionTest.java
index 54ad5babec3..ddeb65dcb51 100644
---
a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/incremental/client/PasswordEncryptionTest.java
+++
b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/incremental/client/PasswordEncryptionTest.java
@@ -62,6 +62,11 @@ class PasswordEncryptionTest {
assertDoesNotThrow(() ->
PasswordEncryption.encryptWithRSAPublicKey("123456", getRandomSeed(),
"RSA/ECB/OAEPWithSHA-1AndMGF1Padding", mockPublicKey()));
}
+ @Test
+ void assertEncryptRSAPublicKeyWithNullPassword() {
+ assertDoesNotThrow(() ->
PasswordEncryption.encryptWithRSAPublicKey(null, getRandomSeed(),
"RSA/ECB/OAEPWithSHA-1AndMGF1Padding", mockPublicKey()));
+ }
+
private String mockPublicKey() {
return "-----BEGIN PUBLIC KEY-----\n"
+
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1ealW/qDdArgzCMnE5Cz\n"