use of org.mifos.accounts.business.AccountNotesEntity in project head by mifos.
the class SavingsCloseTest method whenClosingAccountShouldSetStatusAsClosed.
@Test
public void whenClosingAccountShouldSetStatusAsClosed() {
Money remainingBalance = TestUtils.createMoney("100");
savingsAccount = new SavingsAccountBuilder().active().withSavingsProduct(savingsProduct).withCustomer(client).withBalanceOf(remainingBalance).build();
AccountPaymentEntity payment = new AccountPaymentEntityBuilder().with(savingsAccount).with(remainingBalance).build();
AccountNotesEntity notes = new AccountNotesEntityBuilder().build();
CustomerBO customer = new ClientBuilder().buildForUnitTests();
PersonnelBO loggedInUser = new PersonnelBuilder().build();
// exercise test
savingsAccount.closeAccount(payment, notes, customer, loggedInUser);
// verification
assertTrue(savingsAccount.getAccountState().isInState(AccountState.SAVINGS_CLOSED));
}
use of org.mifos.accounts.business.AccountNotesEntity in project head by mifos.
the class SavingsBOIntegrationTest method testGetRecentAccountNotes.
@Test
public void testGetRecentAccountNotes() throws Exception {
savings = getSavingsAccountForCenter();
addNotes("note1");
addNotes("note2");
addNotes("note3");
addNotes("note4");
addNotes("note5");
StaticHibernateUtil.flushAndClearSession();
savings = savingsDao.findById(savings.getAccountId());
List<AccountNotesEntity> notes = savings.getRecentAccountNotes();
Assert.assertEquals("Size of recent notes is 3", 3, notes.size());
for (AccountNotesEntity accountNotesEntity : notes) {
Assert.assertEquals("Last note added is note5", "note5", accountNotesEntity.getComment());
break;
}
}
Aggregations