This is an automated email from the ASF dual-hosted git repository.
chengzhang 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 c2e63306bcd Fix encrypt e2e test case exception caused by
EncryptRule#getLogicColumnByCipherColumn (#28709)
c2e63306bcd is described below
commit c2e63306bcdaa129644e441e8dae8b2e03e6076e
Author: Zhengqiang Duan <[email protected]>
AuthorDate: Tue Oct 10 19:33:47 2023 +0800
Fix encrypt e2e test case exception caused by
EncryptRule#getLogicColumnByCipherColumn (#28709)
---
.../main/java/org/apache/shardingsphere/encrypt/rule/EncryptTable.java | 2 +-
.../java/org/apache/shardingsphere/encrypt/rule/EncryptTableTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptTable.java
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptTable.java
index 84e804ca88c..3aca7bb2326 100644
---
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptTable.java
+++
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptTable.java
@@ -134,7 +134,7 @@ public final class EncryptTable {
public String getLogicColumnByCipherColumn(final String cipherColumnName) {
for (Entry<String, EncryptColumn> entry : columns.entrySet()) {
if
(entry.getValue().getCipher().getName().equalsIgnoreCase(cipherColumnName)) {
- return entry.getKey();
+ return entry.getValue().getName();
}
}
throw new EncryptLogicColumnNotFoundException(cipherColumnName);
diff --git
a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptTableTest.java
b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptTableTest.java
index b12f434351b..8442ec305ef 100644
---
a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptTableTest.java
+++
b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptTableTest.java
@@ -80,7 +80,7 @@ class EncryptTableTest {
@Test
void assertGetLogicColumnByCipherColumn() {
-
assertNotNull(encryptTable.getLogicColumnByCipherColumn("cipherColumn"));
+ assertThat(encryptTable.getLogicColumnByCipherColumn("cipherColumn"),
is("logicColumn"));
}
@Test