@Test void commit() throws SQLException { Connection connection = Mockito.mock(Connection.class); Mockito.when(connection.getAutoCommit()) .thenReturn(false); JdbcUtil.commit(connection); Mockito.verify(connection) .commit(); }
public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } }
JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } }
JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } private  JdbcUtil(); }
JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } private  JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietly(Connection connection); static void logSQLException(SQLException exception); static void commit(Connection connection); static void rollback(Connection connection); }
JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } private  JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietly(Connection connection); static void logSQLException(SQLException exception); static void commit(Connection connection); static void rollback(Connection connection);  }