use of org.springframework.samples.mvc31.crudcontroller.Account in project spring-mvc-31-demo by rstoyanchev.
the class AccountControllerTests method testSaveFail.
@Test
public void testSaveFail() {
Account account = new Account();
BindingResult result = new BeanPropertyBindingResult(account, "account");
AccountManager mgr = createMock(AccountManager.class);
mgr.saveOrUpdate(account);
replay(mgr);
AccountController contrlr = new AccountController(mgr);
String view = contrlr.save(account, result);
assertEquals("redirect:accounts", view);
verify(mgr);
}
Aggregations