public void testShouldThrowAnExceptionIfCustomerCannotBeFound() { requestParams.put("fromCustomer", "a name that no one has"); try { view.process(requestParams); fail(); } catch (IllegalArgumentException e) { // expected } }
public void testShouldPutCustomersAccountInTemplateParameters() { bank.openAccount(new AccountApplicationBuilder(bank).customer(customer).build()); Set<Account> accounts = customer.getAccounts(); requestParams.put("fromCustomer", ben.toString()); requestParams.put("toCustomer", customer.getNickName().toString()); requestParams.put("toAccounts", accounts.toString()); Map<String, Object> templateParams = view.process(requestParams); assertEquals(accounts.toString(), templateParams.get("toAccounts").toString()); }
public void testShouldPutToCustomerNameInTemplateParameters() { requestParams.put("fromCustomer", ben.toString()); requestParams.put("toCustomer", isabella.toString()); Map<String, Object> templateParams = view.process(requestParams); assertEquals(isabellaName.toString(), templateParams.get("toCustomerName").toString()); }