Search in sources :

Example 1 with PayBillsContext2

use of org.qi4j.dci.moneytransfer.context.PayBillsContext2 in project qi4j-sdk by Qi4j.

the class TransferMoneyTest2 method payAllBills.

@Test
public void payAllBills() throws Exception {
    UnitOfWork uow = module.newUnitOfWork(newUsecase("Pay all bills from checking to creditors"));
    try {
        BalanceData source = uow.get(BalanceData.class, CHECKING_ACCOUNT_ID);
        PayBillsContext2 context = module.newObject(PayBillsContext2.class);
        context.bind(source).payBills();
    } finally {
        uow.discard();
    }
}
Also used : UnitOfWork(org.qi4j.api.unitofwork.UnitOfWork) BalanceData(org.qi4j.dci.moneytransfer.domain.data.BalanceData) PayBillsContext2(org.qi4j.dci.moneytransfer.context.PayBillsContext2) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 UnitOfWork (org.qi4j.api.unitofwork.UnitOfWork)1 PayBillsContext2 (org.qi4j.dci.moneytransfer.context.PayBillsContext2)1 BalanceData (org.qi4j.dci.moneytransfer.domain.data.BalanceData)1