Skip to content

Commit

Permalink
add mock for createStatement
Browse files Browse the repository at this point in the history
  • Loading branch information
Rwolfe-Nava committed Jun 11, 2024
1 parent f869186 commit d8454f4
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static void beforeAll() throws SQLException {
mockStatic(DriverManager.class)
.when(() -> DriverManager.getConnection(anyString(), anyString(), anyString())).thenReturn(dbConnection);
when(dbConnection.prepareStatement(anyString())).thenReturn(preparedStatement);
when(dbConnection.createStatement()).thenReturn(preparedStatement);
when(preparedStatement.executeQuery(anyString())).thenReturn(resultSet);
when(resultSet.next()).thenReturn(true).thenReturn(false);
when(resultSet.getInt(any())).thenReturn(TEST_TOTAL_RESULT_COUNT);
Expand Down

0 comments on commit d8454f4

Please sign in to comment.