This is an automated email from the ASF dual-hosted git repository.

panjuan 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 d4a413ea150 Fix test case for OpenGaussAuthenticator (#23829)
d4a413ea150 is described below

commit d4a413ea15074ad33fad75618155a506895a01a4
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jan 30 13:41:23 2023 +0800

    Fix test case for OpenGaussAuthenticator (#23829)
---
 .../authentication/fixture/OpenGaussAuthenticationAlgorithm.java    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/fixture/OpenGaussAuthenticationAlgorithm.java
 
b/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/fixture/OpenGaussAuthenticationAlgorithm.java
index 241208c2c11..3638a5a24a5 100644
--- 
a/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/fixture/OpenGaussAuthenticationAlgorithm.java
+++ 
b/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/fixture/OpenGaussAuthenticationAlgorithm.java
@@ -21,6 +21,7 @@ import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import lombok.SneakyThrows;
 import 
org.apache.shardingsphere.proxy.frontend.opengauss.authentication.OpenGaussAuthenticationHandler;
+import 
org.apache.shardingsphere.proxy.frontend.opengauss.authentication.authenticator.OpenGaussSCRAMSha256PasswordAuthenticator;
 import org.mockito.internal.configuration.plugins.Plugins;
 
 import java.nio.charset.StandardCharsets;
@@ -63,7 +64,8 @@ public final class OpenGaussAuthenticationAlgorithm {
     
     @SneakyThrows(ReflectiveOperationException.class)
     private static byte[] sha256(final byte[] str) {
-        return (byte[]) 
Plugins.getMemberAccessor().invoke(OpenGaussAuthenticationHandler.class.getDeclaredMethod("sha256",
 byte[].class), OpenGaussAuthenticationHandler.class, new Object[]{str});
+        return (byte[]) Plugins.getMemberAccessor().invoke(
+                
OpenGaussSCRAMSha256PasswordAuthenticator.class.getDeclaredMethod("sha256", 
byte[].class), OpenGaussAuthenticationHandler.class, new Object[]{str});
     }
     
     @SneakyThrows(ReflectiveOperationException.class)
@@ -75,7 +77,7 @@ public final class OpenGaussAuthenticationAlgorithm {
     @SneakyThrows(ReflectiveOperationException.class)
     private static byte[] xor(final byte[] value1, final byte[] value2) {
         return (byte[]) Plugins.getMemberAccessor().invoke(
-                OpenGaussAuthenticationHandler.class.getDeclaredMethod("xor", 
byte[].class, byte[].class), OpenGaussAuthenticationHandler.class, value1, 
value2);
+                
OpenGaussSCRAMSha256PasswordAuthenticator.class.getDeclaredMethod("xor", 
byte[].class, byte[].class), OpenGaussAuthenticationHandler.class, value1, 
value2);
     }
     
     private static void bytesToHex(final byte[] bytes, final byte[] hex, final 
int offset, final int length) {

Reply via email to