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 7b2ac34  fix NPE issue (#12115)
7b2ac34 is described below

commit 7b2ac346817785e715b6f21b5e038cc232006a21
Author: 孙念君 Sun Nianjun <[email protected]>
AuthorDate: Tue Aug 31 10:03:51 2021 +0800

    fix NPE issue (#12115)
---
 .../command/query/binary/bind/PostgreSQLComBindExecutorTest.java     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutorTest.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutorTest.java
index 872ea97..341574c 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutorTest.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutorTest.java
@@ -54,9 +54,6 @@ public final class PostgreSQLComBindExecutorTest {
     private PostgreSQLConnectionContext connectionContext;
     
     @Mock
-    private PostgreSQLBinaryStatement binaryStatement;
-    
-    @Mock
     private PostgreSQLPortal portal;
     
     @Mock
@@ -66,7 +63,9 @@ public final class PostgreSQLComBindExecutorTest {
     private BackendConnection backendConnection;
     
     @Before
+    @SuppressWarnings("unchecked")
     public void setup() throws SQLException {
+        PostgreSQLBinaryStatementRegistry.getInstance().register(1);
         PostgreSQLBinaryStatementRegistry.getInstance().register(1, "2", "", 
new EmptyStatement(), Collections.emptyList());
         when(bindPacket.getStatementId()).thenReturn("1");
         when(bindPacket.getPortal()).thenReturn("C_1");

Reply via email to