in src/main/java/org/apache/fineract/cn/dev/ServiceRunner.java [507:526]
private void createChartOfAccounts(final UserWithPassword userWithPassword) throws IOException, InterruptedException {
final Authentication authentication;
try (final AutoGuest ignored = new AutoGuest()) {
authentication = identityManager.api().login(userWithPassword.getIdentifier(), userWithPassword.getPassword());
}
try (final AutoUserContext ignored = new AutoUserContext(userWithPassword.getIdentifier(), authentication.getAccessToken())) {
final LedgerImporter ledgerImporter = new LedgerImporter(ledgerManager.api(), logger);
final URL ledgersUrl = ServiceRunner.class.getResource("/standardChartOfAccounts/ledgers.csv");
ledgerImporter.importCSV(ledgersUrl);
Assert.assertTrue(this.eventRecorder.wait(POST_LEDGER, LOAN_INCOME_LEDGER));
final AccountImporter accountImporter = new AccountImporter(ledgerManager.api(), logger);
final URL accountsUrl = ServiceRunner.class.getResource("/standardChartOfAccounts/accounts.csv");
accountImporter.importCSV(accountsUrl);
Assert.assertTrue(this.eventRecorder.wait(POST_ACCOUNT, "9330"));
identityManager.api().logout();
}
}