BackendConnection implements JDBCExecutionConnection { @Override public Statement createStorageResource(final Connection connection, final ConnectionMode connectionMode, final StatementOption option) throws SQLException { Statement result = connection.createStatement(); if (ConnectionMode.MEMORY_STRICTLY == connectionMode) { setFetchSize(result); } return result; } 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 assertCreateStorageResourceCorrectlyWhenConnectionModeMemoryStrictly() throws SQLException { Connection connection = mock(Connection.class); Statement statement = mock(Statement.class); when(connection.createStatement()).thenReturn(statement); assertThat(backendConnection.createStorageResource(connection, ConnectionMode.MEMORY_STRICTLY, null), is(statement)); verify(connection, times(1)).createStatement(); }