Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Oct 5, 2023
1 parent 3278b08 commit 934bb09
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<Object> callback =
new JDBCExecutorCallback<Object>(TypedSPILoader.getService(DatabaseType.class, "MySQL"), resourceMetaData, mock(SelectStatement.class), true) {
Expand All @@ -86,7 +87,7 @@ protected Optional<Object> 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<Object> callback =
new JDBCExecutorCallback<Object>(TypedSPILoader.getService(DatabaseType.class, "MySQL"), resourceMetaData, mock(SelectStatement.class), true) {
Expand Down

0 comments on commit 934bb09

Please sign in to comment.