### Question:
PageDataJdbcDaoImpl implements PageDataJdbcDao { @Override public void batchSave(Integer pageId, List<PageDataItem> allData) { jdbcTemplate.batchUpdate(SQL_INSERT_PAGE_DATA, new BatchPreparedStatementSetter() { @Override public int getBatchSize() { return allData.size(); } @Override public void setValues(PreparedStatement ps, int index) throws SQLException { PageDataItem each = allData.get(index); ps.setString(1, each.getId()); ps.setInt(2, pageId); ps.setString(3, each.getName()); ps.setString(4, each.getType()); ps.setString(5, each.getValue()); ps.setString(6, each.getParentId()); ps.setInt(7, index+1); } }); }  @Override void delete(Integer pageId); @Override void batchSave(Integer pageId, List<PageDataItem> allData);  }### Answer:
@Test public void batchSave() { Integer pageId = 1; List<PageDataItem> allData = new ArrayList<>(); PageDataItem item1 = new PageDataItem(); item1.setId("id"); item1.setName("name"); item1.setPageId(pageId); item1.setParentId("-1"); item1.setType("String"); allData.add(item1); pageDataJdbcDao.batchSave(pageId, allData); assertThat(countRowsInTable("PAGE_DATA")).isEqualTo(1); pageDataJdbcDao.delete(1); assertThat(countRowsInTable("PAGE_DATA")).isEqualTo(0); }