BackendConnection implements JDBCExecutionConnection { private void setFetchSize(final Statement statement) throws SQLException { DatabaseType databaseType = ProxyContext.getInstance().getSchemaContexts().getDatabaseType(); TypedSPIRegistry.getRegisteredService(StatementMemoryStrictlyFetchSizeSetter.class, databaseType.getName(), new Properties()).setFetchSize(statement); } BackendConnection(final TransactionType initialTransactionType); void setCurrentSchema(final String schemaName); @Override List<Connection> getConnections(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode); @Override Statement createStorageResource(final Connection connection, final ConnectionMode connectionMode, final StatementOption option); @Override PreparedStatement createStorageResource(final String sql, final List<Object> parameters, 
                                                   final Connection connection, final ConnectionMode connectionMode, final StatementOption option); boolean isSerialExecute(); int getConnectionSize(); void add(final Statement statement); void add(final ResultSet resultSet); synchronized Collection<SQLException> closeResultSets(); synchronized Collection<SQLException> closeStatements(); synchronized Collection<SQLException> closeConnections(final boolean forceRollback);  }
@Test public void assertSetFetchSizeAsExpected() throws InvocationTargetException, IllegalAccessException, NoSuchMethodException, SQLException { Statement statement = mock(Statement.class); Method setFetchSizeMethod = backendConnection.getClass().getDeclaredMethod("setFetchSize", Statement.class); setFetchSizeMethod.setAccessible(true); setFetchSizeMethod.invoke(backendConnection, statement); verify(statement, times(1)).setFetchSize(Integer.MIN_VALUE); }