@Test
  public void testGetAllClosedAccounts() throws Exception {
    createInitialObjects();
    MeetingBO meetingIntCalc =
        TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
    MeetingBO meetingIntPost =
        TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());

    Date startDate = new Date(System.currentTimeMillis());
    savingsOffering =
        TestObjectFactory.createSavingsProduct(
            "SavingPrd1",
            ApplicableTo.GROUPS,
            new Date(System.currentTimeMillis()),
            PrdStatus.SAVINGS_ACTIVE,
            300.0,
            RecommendedAmountUnit.PER_INDIVIDUAL,
            1.2,
            200.0,
            200.0,
            SavingsType.VOLUNTARY,
            InterestCalcType.MINIMUM_BALANCE,
            meetingIntCalc,
            meetingIntPost);
    savings =
        TestObjectFactory.createSavingsAccount(
            "432434", center, AccountState.SAVINGS_CLOSED.getValue(), startDate, savingsOffering);
    List<SavingsBO> savingsAccounts = service.getAllClosedAccounts(center.getCustomerId());
    Assert.assertEquals(1, savingsAccounts.size());
  }
  private SavingsBO createSavingsAccount(SavingsType savingsType) throws Exception {
    Date startDate = new Date(System.currentTimeMillis());

    MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
    MeetingBO meetingIntCalc =
        TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
    MeetingBO meetingIntPost =
        TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
    SavingsOfferingBO savingsOffering =
        TestObjectFactory.createSavingsProduct(
            "SavingPrd1",
            ApplicableTo.GROUPS,
            startDate,
            PrdStatus.SAVINGS_ACTIVE,
            300.0,
            RecommendedAmountUnit.PER_INDIVIDUAL,
            1.2,
            200.0,
            200.0,
            savingsType,
            InterestCalcType.MINIMUM_BALANCE,
            meetingIntCalc,
            meetingIntPost);
    center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
    group =
        TestObjectFactory.createWeeklyFeeGroupUnderCenter(
            "Group", CustomerStatus.GROUP_ACTIVE, center);
    client1 = TestObjectFactory.createClient("Client", CustomerStatus.CLIENT_ACTIVE, group);
    return TestObjectFactory.createSavingsAccount(
        "43245434", client1, (short) 16, startDate, savingsOffering);
  }
 private void createInitialObjects() {
   MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
   center = TestObjectFactory.createWeeklyFeeCenter("Center_Active_test", meeting);
   group =
       TestObjectFactory.createWeeklyFeeGroupUnderCenter(
           "Group_Active_test", CustomerStatus.GROUP_ACTIVE, center);
 }
 private SavingsOfferingBO createSavingsOfferingBO() {
   MeetingBO meetingIntCalc =
       TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
   MeetingBO meetingIntPost =
       TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
   return TestObjectFactory.createSavingsProduct(
       "Savings Product",
       "SAVP",
       ApplicableTo.CLIENTS,
       new Date(System.currentTimeMillis()),
       PrdStatus.SAVINGS_ACTIVE,
       300.0,
       RecommendedAmountUnit.PER_INDIVIDUAL,
       1.2,
       200.0,
       200.0,
       SavingsType.VOLUNTARY,
       InterestCalcType.MINIMUM_BALANCE,
       meetingIntCalc,
       meetingIntPost);
 }
 private AccountBO getLoanAccount(AccountState state, Date startDate, int disbursalType) {
   MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
   center =
       TestObjectFactory.createWeeklyFeeCenter(
           this.getClass().getSimpleName() + " Center", meeting);
   group =
       TestObjectFactory.createWeeklyFeeGroupUnderCenter(
           this.getClass().getSimpleName() + " Group", CustomerStatus.GROUP_ACTIVE, center);
   LoanOfferingBO loanOffering =
       TestObjectFactory.createLoanOffering(
           this.getClass().getSimpleName() + " LOAN", "L", startDate, meeting);
   return TestObjectFactory.createLoanAccountWithDisbursement(
       "99999999999", group, state, startDate, loanOffering, disbursalType);
 }
 private void createInitialObjectsForSavings() throws Exception {
   MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
   center = TestObjectFactory.createWeeklyFeeCenter("Center_Active_test", meeting);
   group =
       TestObjectFactory.createWeeklyFeeGroupUnderCenter(
           "Group_Active_test", CustomerStatus.GROUP_ACTIVE, center);
   SavingsTestHelper helper = new SavingsTestHelper();
   savingsOffering = helper.createSavingsOffering("prd1", "cdfg");
   savings =
       helper.createSavingsAccount(
           "000100000000017",
           savingsOffering,
           group,
           AccountStates.SAVINGS_ACC_APPROVED,
           userContext);
 }
 private void createParentCustomer() {
   meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
   center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
 }