package com.github.cstroe.spendhawk.mocks;

import com.github.cstroe.spendhawk.entity.Account;
import com.github.cstroe.spendhawk.entity.User;

import java.util.ArrayList;
import java.util.List;

public class BareAccountsMock {

    private User mockUser;
    private Account incomeAccount;
    private Account expenseAccount;
    private Account assetAccount;
    private Account myBankAccount;

    public BareAccountsMock() {
        Long accountIdSeq = 1l;

        mockUser = new User();
        mockUser.setId(13l);
        mockUser.setName("MockUser");

        incomeAccount = new Account();
        incomeAccount.setId(++accountIdSeq);
        incomeAccount.setName(User.DEFAULT_INCOME_ACCOUNT_NAME);
        incomeAccount.setParent(null);
        incomeAccount.setUser(mockUser);

        expenseAccount = new Account();
        expenseAccount.setId(++accountIdSeq);
        expenseAccount.setName(User.DEFAULT_EXPENSE_ACCOUNT_NAME);
        expenseAccount.setParent(null);
        expenseAccount.setUser(mockUser);

        assetAccount = new Account();
        assetAccount.setId(++accountIdSeq);
        assetAccount.setName(User.DEFAULT_ASSET_ACCOUNT_NAME);
        assetAccount.setParent(null);
        assetAccount.setUser(mockUser);

        myBankAccount = new Account();
        myBankAccount.setId(++accountIdSeq);
        myBankAccount.setName("My Bank Account");
        myBankAccount.setParent(assetAccount);
        myBankAccount.setUser(mockUser);

        List<Account> accounts = new ArrayList<>(4);
        accounts.add(incomeAccount);
        accounts.add(expenseAccount);
        accounts.add(assetAccount);
        accounts.add(myBankAccount);
        mockUser.setAccounts(accounts);
    }

    public User getMockUser() {
        return mockUser;
    }

    public Account getIncomeAccount() {
        return incomeAccount;
    }

    public Account getExpenseAccount() {
        return expenseAccount;
    }

    public Account getAssetAccount() {
        return assetAccount;
    }

    public Account getMyBankAccount() {
        return myBankAccount;
    }
}

@@ -165,16 +165,45 @@
 ayList;%0A
+import java.util.LinkedList;%0A
 import j
@@ -217,16 +217,16 @@
 l.List;%0A
-
 %0Apublic 
@@ -803,32 +803,88 @@
 tUser(mockUser);
+%0A        incomeAccount.setCashFlows(new LinkedList%3C%3E());
 %0A%0A        expens
@@ -1095,32 +1095,89 @@
 tUser(mockUser);
+%0A        expenseAccount.setCashFlows(new LinkedList%3C%3E());
 %0A%0A        assetA
@@ -1376,32 +1376,87 @@
 tUser(mockUser);
+%0A        assetAccount.setCashFlows(new LinkedList%3C%3E());
 %0A%0A        myBank
@@ -1614,32 +1614,32 @@
 (assetAccount);%0A
-
         myBankAc
@@ -1662,16 +1662,72 @@
 ckUser);
+%0A        myBankAccount.setCashFlows(new LinkedList%3C%3E());
 %0A%0A      

Create cashflow collections in BareAccountsMock.