JdbcBatchingDataCaptureService extends JdbcIteratingDataCaptureServiceImpl { protected static long rowsUpdated(int[] rc) throws SQLException { List<Integer> result = Arrays.asList(ArrayUtils.toObject(rc)); if (result.contains(Statement.EXECUTE_FAILED)) { throw new SQLException("Batch Execution Failed."); } return result.stream().filter(e -> !(e == Statement.SUCCESS_NO_INFO)).mapToLong(i -> i).sum(); } JdbcBatchingDataCaptureService();  JdbcBatchingDataCaptureService(String statement); Integer getBatchWindow(); void setBatchWindow(Integer i); static final int DEFAULT_BATCH_WINDOW; }
@Test public void testRowsUpdated() throws Exception { try { int[] results = {1, Statement.EXECUTE_FAILED, 2}; JdbcBatchingDataCaptureService.rowsUpdated(results); fail(); } catch (SQLException expected) { } int[] results = {1, Statement.SUCCESS_NO_INFO, 2}; assertEquals(3L, JdbcBatchingDataCaptureService.rowsUpdated(results)); }