}
@Test public void
updatingAnExistingRecord() throws Exception {
persist(aProduct().named("Dalmatian"));
final Product original = persist(aProduct().withNumber("12345678").named("English Bulldog").describedAs("A muscular heavy dog"));
original.setName("Labrador Retriever");
original.setDescription("A fun type of dog");
transactor.perform(new UnitOfWork() {
public void execute() throws Exception {
int updated = Update.set(products, original).where("number = ?", "12345678").execute(connection);
assertThat("records updated", updated, is(1));
}
});
Product record = Select.from(products).where("name = ?", "Labrador Retriever").first(connection);
assertThat("updated record", record, samePropertyValuesAs(original));
}