* Note: the name can not change. The other elements can.
* @throws Exception
*/
public void testCreateAndUpdateAndRemoveVendor() throws Exception {
log.warn("Creating a user");
Vendor vendor = new Vendor("abcdef", "vendor@m8n.be");
dao.saveVendor(vendor);
Integer id = vendor.getId();
vendor = dao.getVendor(id);
assertEquals(vendor.getName(), "abcdef");
assertEquals(vendor.getEmail(), "vendor@m8n.be");
log.warn("Vendor created: " + vendor);
vendor.setName("klmnop");
vendor.setEmail("vendor@elevenbits.org");
dao.saveVendor(vendor);
log.warn("Vendor updated");
vendor = dao.getVendor(id);
assertEquals(vendor.getName(), "abcdef"); // name can not change
assertEquals(vendor.getEmail(), "vendor@elevenbits.org");
log.warn("Vendor: " + vendor);
dao.removeVendor(vendor.getId());
log.warn("Vendor removed");
try {
vendor = dao.getVendor(vendor.getId());
fail("getVendor didn't throw DataAccessException");
} catch (DataAccessException d) {
log.warn("Needed to catch exception since the Vendor did not exist");
assertNotNull(d);
}