JdbcProductDao extends JdbcDaoSupport implements ProductDao { @Override public void save(final Product product) { getJdbcTemplate().update("INSERT INTO PRODUCT (NAME,SIZE,PRICE) VALUES (?,?,?)", product.getName(), product.getSize(), product.getPrice()); } JdbcProductDao(final DataSource dataSource); @Override Product findById(final long id); @Override List<Product> findBySize(final String size); @Override void save(final Product product); @Override void saveAll(final Iterable<Product> products);  }
@Test public void save_should_insertTheProduct() { final BigDecimal price = aPrice(1200); final String name = "some name"; final String size = "M"; final Product product = aProduct(name, price, size); productDao.save(product); final Table expected = aTable(ProductTable.class).with( aRow(0).f(NAME, name).f(PRICE, "12.00").f(SIZE, size) ); daleq.assertTableInDatabase(expected, ID); }