in component-test/src/main/java/org/apache/fineract/cn/accounting/TestAccount.java [69:87]
public void shouldNotCreateAccountAlreadyExists() throws Exception {
final Ledger ledger = LedgerGenerator.createRandomLedger();
this.testSubject.createLedger(ledger);
this.eventRecorder.wait(EventConstants.POST_LEDGER, ledger.getIdentifier());
final Account account = AccountGenerator.createRandomAccount(ledger.getIdentifier());
this.testSubject.createAccount(account);
this.eventRecorder.wait(EventConstants.POST_ACCOUNT, account.getIdentifier());
try {
this.testSubject.createAccount(account);
Assert.fail();
} catch (final AccountAlreadyExistsException ignored) {
}
}