in component-test/src/main/java/org/apache/fineract/cn/accounting/TestAccount.java [491:506]
public void shouldNotDeleteAccountStillOpen() throws Exception {
final Ledger randomLedger = LedgerGenerator.createRandomLedger();
this.testSubject.createLedger(randomLedger);
this.eventRecorder.wait(EventConstants.POST_LEDGER, randomLedger.getIdentifier());
final Account randomAccount = AccountGenerator.createRandomAccount(randomLedger.getIdentifier());
this.testSubject.createAccount(randomAccount);
this.eventRecorder.wait(EventConstants.POST_ACCOUNT, randomAccount.getIdentifier());
try {
this.testSubject.deleteAccount(randomAccount.getIdentifier());
Assert.fail();
} catch (final AccountReferenceException ex) {
// do nothing, expected
}
}