CallableStatement cs = mock(CallableStatement.class);
when(con.prepareCall("{call foo_bar(?, ?)}", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY)).thenReturn(cs);
when(ds.getConnection()).thenReturn(con);
when(ds.getConnection()).thenReturn(con);
con.commit();
PlatformTransactionManager tm = new DataSourceTransactionManager(ds);
TransactionTemplate tt = new TransactionTemplate(tm);
final StoredProcedureItemReader<String> reader = new StoredProcedureItemReader<String>();
reader.setDataSource(ds);
reader.setProcedureName("foo_bar");
reader.setParameters(new SqlParameter[] {