Search in sources :

Example 1 with BankStatementBL

use of de.metas.banking.service.impl.BankStatementBL in project metasfresh-webui-api by metasfresh.

the class ReconcilePaymentsCommandTest method beforeEach.

@BeforeEach
public void beforeEach() {
    AdempiereTestHelper.get().init();
    final CurrencyRepository currencyRepository = new CurrencyRepository();
    final MoneyService moneyService = new MoneyService(currencyRepository);
    SpringContextHolder.registerJUnitBean(moneyService);
    final IBankStatementListenerService bankStatementListenerService = Services.get(IBankStatementListenerService.class);
    final ESRImportBL esrImportBL = new ESRImportBL(AttachmentEntryService.createInstanceForUnitTesting());
    bankStatementListenerService.addListener(new ESRBankStatementListener(esrImportBL));
    final IPaySelectionBL paySelectionBL = Services.get(IPaySelectionBL.class);
    bankStatementListenerService.addListener(new PaySelectionBankStatementListener(paySelectionBL));
    Services.registerService(IBankStatementBL.class, new BankStatementBL() {

        public void unpost(I_C_BankStatement bankStatement) {
            System.out.println("In JUnit test BankStatementBL.unpost() does nothing" + "\n\t bank statement: " + bankStatement + "\n\t called via " + Trace.toOneLineStackTraceString());
        }
    });
    bankStatmentPaymentBL = new BankStatementPaymentBL(moneyService);
    SpringContextHolder.registerJUnitBean(IBankStatementPaymentBL.class, bankStatmentPaymentBL);
    this.rowsRepo = new BankStatementLineAndPaymentsToReconcileRepository(currencyRepository);
    rowsRepo.setBpartnerLookup(new MockedBPartnerLookupDataSource());
    createMasterdata();
}
Also used : BankStatementPaymentBL(de.metas.banking.payment.impl.BankStatementPaymentBL) IBankStatementPaymentBL(de.metas.banking.payment.IBankStatementPaymentBL) IBankStatementListenerService(de.metas.banking.service.IBankStatementListenerService) I_C_BankStatement(org.compiere.model.I_C_BankStatement) MoneyService(de.metas.money.MoneyService) PaySelectionBankStatementListener(de.metas.banking.model.validator.PaySelectionBankStatementListener) CurrencyRepository(de.metas.currency.CurrencyRepository) BankStatementLineAndPaymentsToReconcileRepository(de.metas.ui.web.bankstatement_reconciliation.BankStatementLineAndPaymentsToReconcileRepository) BankStatementBL(de.metas.banking.service.impl.BankStatementBL) IBankStatementBL(de.metas.banking.service.IBankStatementBL) ESRImportBL(de.metas.payment.esr.api.impl.ESRImportBL) ESRBankStatementListener(de.metas.payment.esr.model.validator.ESRBankStatementListener) IPaySelectionBL(de.metas.banking.payment.IPaySelectionBL) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PaySelectionBankStatementListener (de.metas.banking.model.validator.PaySelectionBankStatementListener)1 IBankStatementPaymentBL (de.metas.banking.payment.IBankStatementPaymentBL)1 IPaySelectionBL (de.metas.banking.payment.IPaySelectionBL)1 BankStatementPaymentBL (de.metas.banking.payment.impl.BankStatementPaymentBL)1 IBankStatementBL (de.metas.banking.service.IBankStatementBL)1 IBankStatementListenerService (de.metas.banking.service.IBankStatementListenerService)1 BankStatementBL (de.metas.banking.service.impl.BankStatementBL)1 CurrencyRepository (de.metas.currency.CurrencyRepository)1 MoneyService (de.metas.money.MoneyService)1 ESRImportBL (de.metas.payment.esr.api.impl.ESRImportBL)1 ESRBankStatementListener (de.metas.payment.esr.model.validator.ESRBankStatementListener)1 BankStatementLineAndPaymentsToReconcileRepository (de.metas.ui.web.bankstatement_reconciliation.BankStatementLineAndPaymentsToReconcileRepository)1 I_C_BankStatement (org.compiere.model.I_C_BankStatement)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1