assertThat(getDomainObjectContainer().isPersistent(custJsDO), is(true));
}
@Test
public void whenValidateMethodThenCanVetoSave() {
final Customer newCustomer = getDomainObjectContainer().newTransientInstance(Customer.class);
// just to get into valid state
newCustomer.setCustomerNumber(123);
newCustomer.setLastName("Smith");
newCustomer.setMandatoryAssociation(countryGbrDO);
newCustomer.setMandatoryValue("foo");
newCustomer.setMaxLengthField("abc");
newCustomer.setRegExCaseInsensitiveField("ABCd");
newCustomer.setRegExCaseSensitiveField("abcd");
final Customer newCustomerWO = getWrapperFactory().wrap(newCustomer);
newCustomer.validate = "No shakes";
final WrapperObject newCustomerWrapper = asWrapperObject(newCustomerWO);
try {
assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(false));