From 934bb09e64fcfa64d9fea3daf694ba7353b605de Mon Sep 17 00:00:00 2001 From: zhangliang Date: Thu, 5 Oct 2023 16:04:04 +0800 Subject: [PATCH] Fix test cases --- .../sql/execute/engine/jdbc/JDBCExecutorCallbackTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/infra/executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/jdbc/JDBCExecutorCallbackTest.java b/infra/executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/jdbc/JDBCExecutorCallbackTest.java index 8fef21523632a..1369779743e50 100644 --- a/infra/executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/jdbc/JDBCExecutorCallbackTest.java +++ b/infra/executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/jdbc/JDBCExecutorCallbackTest.java @@ -44,6 +44,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.RETURNS_DEEP_STUBS; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -65,7 +66,7 @@ void setUp() { @Test void assertExecuteFailedAndProtocolTypeDifferentWithDatabaseType() throws SQLException { Object saneResult = new Object(); - ResourceMetaData resourceMetaData = mock(ResourceMetaData.class); + ResourceMetaData resourceMetaData = mock(ResourceMetaData.class, RETURNS_DEEP_STUBS); when(resourceMetaData.getStorageUnits().get("ds").getStorageType()).thenReturn(TypedSPILoader.getService(DatabaseType.class, "PostgreSQL")); JDBCExecutorCallback callback = new JDBCExecutorCallback(TypedSPILoader.getService(DatabaseType.class, "MySQL"), resourceMetaData, mock(SelectStatement.class), true) { @@ -86,7 +87,7 @@ protected Optional getSaneResult(final SQLStatement sqlStatement, final @Test void assertExecuteSQLExceptionOccurredAndProtocolTypeSameAsDatabaseType() { - ResourceMetaData resourceMetaData = mock(ResourceMetaData.class); + ResourceMetaData resourceMetaData = mock(ResourceMetaData.class, RETURNS_DEEP_STUBS); when(resourceMetaData.getStorageUnits().get("ds").getStorageType()).thenReturn(TypedSPILoader.getService(DatabaseType.class, "PostgreSQL")); JDBCExecutorCallback callback = new JDBCExecutorCallback(TypedSPILoader.getService(DatabaseType.class, "MySQL"), resourceMetaData, mock(SelectStatement.class), true) {