@Test public void shouldThrowExceptionIfUpdatingInvalid() { ProductForm pf = new ProductForm(); expectedException.expect(DataException.class); pfRep.update(pf); }
public void update(ProductForm pf) { pf.isValid(); try { pfMapper.update(pf); } catch(DataIntegrityViolationException dive) { throw new DataException("error.incorrect.length", dive); } }
ProductFormRepository { public void update(ProductForm pf) { pf.isValid(); try { pfMapper.update(pf); } catch(DataIntegrityViolationException dive) { throw new DataException("error.incorrect.length", dive); } } }
ProductFormRepository { public void update(ProductForm pf) { pf.isValid(); try { pfMapper.update(pf); } catch(DataIntegrityViolationException dive) { throw new DataException("error.incorrect.length", dive); } } ProductFormRepository(ProductFormMapper productFormMapper); }
ProductFormRepository { public void update(ProductForm pf) { pf.isValid(); try { pfMapper.update(pf); } catch(DataIntegrityViolationException dive) { throw new DataException("error.incorrect.length", dive); } } ProductFormRepository(ProductFormMapper productFormMapper); ProductForm getByCode(String code); void insert(ProductForm pf); List<ProductForm> getAll(); void update(ProductForm pf); }
ProductFormRepository { public void update(ProductForm pf) { pf.isValid(); try { pfMapper.update(pf); } catch(DataIntegrityViolationException dive) { throw new DataException("error.incorrect.length", dive); } } ProductFormRepository(ProductFormMapper productFormMapper); ProductForm getByCode(String code); void insert(ProductForm pf); List<ProductForm> getAll(); void update(ProductForm pf);  }