fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [3/5] incubator-fineract git commit: Integration tests for Savings Dormancy Tracking feature
Date Tue, 10 May 2016 12:27:33 GMT
Integration tests for Savings Dormancy Tracking feature


Project: http://git-wip-us.apache.org/repos/asf/incubator-fineract/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-fineract/commit/a4aee1a3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-fineract/tree/a4aee1a3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-fineract/diff/a4aee1a3

Branch: refs/heads/develop
Commit: a4aee1a3c0add338b6a873ab7e87f25ca23f0f78
Parents: f3f6f4b
Author: Adi Narayana Raju <adi.raju@confluxtechnologies.com>
Authored: Tue May 10 17:51:09 2016 +0530
Committer: Adi Narayana Raju <adi.raju@confluxtechnologies.com>
Committed: Tue May 10 17:51:09 2016 +0530

----------------------------------------------------------------------
 .../ClientSavingsIntegrationTest.java           | 160 ++++++++++++++++++-
 .../common/charges/ChargesHelper.java           |   9 ++
 .../savings/SavingsApplicationTestBuilder.java  |  11 ++
 .../common/savings/SavingsProductHelper.java    |  20 +++
 .../common/savings/SavingsStatusChecker.java    |  33 +++-
 5 files changed, 228 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/a4aee1a3/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java
index 48a186b..ef8a19f 100755
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java
@@ -34,6 +34,7 @@ import java.util.Locale;
 
 import org.apache.fineract.integrationtests.common.ClientHelper;
 import org.apache.fineract.integrationtests.common.CommonConstants;
+import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
 import org.apache.fineract.integrationtests.common.TaxComponentHelper;
 import org.apache.fineract.integrationtests.common.TaxGroupHelper;
 import org.apache.fineract.integrationtests.common.Utils;
@@ -42,6 +43,8 @@ import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
 import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
 import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
 import org.joda.time.LocalDate;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -806,7 +809,7 @@ public class ClientSavingsIntegrationTest {
         final String percentage = "10";
         final Integer taxGroupId = createTaxGroup(percentage);
         final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
MINIMUM_OPENING_BALANCE,
-                minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance,
allowOverdraft, String.valueOf(taxGroupId));
+                minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance,
allowOverdraft, String.valueOf(taxGroupId), false);
         Assert.assertNotNull(savingsProductID);
 
         final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
@@ -854,7 +857,7 @@ public class ClientSavingsIntegrationTest {
         final String percentage = "10";
         final Integer taxGroupId = createTaxGroup(percentage);
         final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
MINIMUM_OPENING_BALANCE,
-                minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance,
allowOverdraft, String.valueOf(taxGroupId));
+                minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance,
allowOverdraft, String.valueOf(taxGroupId), false);
         Assert.assertNotNull(savingsProductID);
 
         final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
@@ -890,6 +893,152 @@ public class ClientSavingsIntegrationTest {
         Assert.assertEquals(expected, actual, 1);
 
     }
+    
+    @Test
+    public void testSavingsAccount_DormancyTracking() {
+        this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
+
+        final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
+        Assert.assertNotNull(clientID);
+        final String minBalanceForInterestCalculation = null;
+        final String minRequiredBalance = null;
+        final String enforceMinRequiredBalance = "false";
+        final boolean allowOverdraft = false;
+        final String percentage = "10";
+        final Integer taxGroupId = createTaxGroup(percentage);
+        final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
MINIMUM_OPENING_BALANCE,
+                minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance,
allowOverdraft, String.valueOf(taxGroupId), true);
+        Assert.assertNotNull(savingsProductID);
+        
+        final Integer savingsChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
+                ChargesHelper.getSavingsNoActivityFeeJSON());
+        Assert.assertNotNull(savingsChargeId);
+
+        ArrayList<Integer> savingsList = new ArrayList<>();
+
+        for(int i=0; i< 5; i++){
+            final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
+            Assert.assertNotNull(savingsProductID);
+
+            HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID,
savingsProductID, savingsId,
+                    ACCOUNT_TYPE_INDIVIDUAL);
+            Assert.assertTrue(modifications.containsKey("submittedOnDate"));
+
+            this.savingsAccountHelper.addChargesForSavings(savingsId, savingsChargeId);
+
+            HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId);
+            SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
+
+            savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
+            SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
+
+            savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
+            SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
+            savingsList.add(savingsId);
+        }
+
+        final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
+        Assert.assertNotNull(savingsProductID);
+
+        HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID,
savingsProductID, savingsId,
+                ACCOUNT_TYPE_INDIVIDUAL);
+        Assert.assertTrue(modifications.containsKey("submittedOnDate"));
+
+        HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId);
+        SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
+
+        savingsList.add(savingsId);
+
+        final DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMMM yyyy");
+        LocalDate transactionDate = new LocalDate();
+        for(int i=0; i< 4; i++){
+        	String TRANSACTION_DATE = formatter.print(transactionDate);
+            Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsList.get(i),
DEPOSIT_AMOUNT,
+                    TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
+        	transactionDate = transactionDate.minusDays(30);
+        }
+        
+        SchedulerJobHelper jobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
+        try {
+			jobHelper.executeJob("Update Savings Dormant Accounts");
+		} catch (InterruptedException e) {
+			e.printStackTrace();
+		}
+        
+        //VERIFY WITHIN PROVIDED RANGE DOESN'T INACTIVATE
+        savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(0));
+        SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
+        savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(0));
+        SavingsStatusChecker.verifySavingsSubStatusNone(savingsStatusHashMap);
+        HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsList.get(0));
+        Float balance = 3000f;
+        Float chargeAmt = 0f;
+        balance -= chargeAmt;
+        assertEquals("Verifying account Balance", balance, summary.get("accountBalance"));
+
+
+        //VERIFY INACTIVE
+        savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(1));
+        SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
+        savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(1));
+        SavingsStatusChecker.verifySavingsSubStatusInactive(savingsStatusHashMap);
+        summary = this.savingsAccountHelper.getSavingsSummary(savingsList.get(1));
+        balance = 3000f;
+        chargeAmt = 100f;
+        balance -= chargeAmt;
+        assertEquals("Verifying account Balance", balance, summary.get("accountBalance"));
+
+    	String TRANSACTION_DATE = formatter.print(new LocalDate());
+        Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsList.get(1),
DEPOSIT_AMOUNT,
+                TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
+        savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(1));
+        SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
+        savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(1));
+        SavingsStatusChecker.verifySavingsSubStatusNone(savingsStatusHashMap);
+
+        //VERIFY DORMANT
+        savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(2));
+        SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
+        savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(2));
+        SavingsStatusChecker.verifySavingsSubStatusDormant(savingsStatusHashMap);
+        summary = this.savingsAccountHelper.getSavingsSummary(savingsList.get(2));
+        balance = 3000f;
+        chargeAmt = 100f;
+        balance -= chargeAmt;
+        assertEquals("Verifying account Balance", balance, summary.get("accountBalance"));
+        
+        TRANSACTION_DATE = formatter.print(new LocalDate());
+        depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsList.get(2),
DEPOSIT_AMOUNT,
+                TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
+        savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(2));
+        SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
+        savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(2));
+        SavingsStatusChecker.verifySavingsSubStatusNone(savingsStatusHashMap);
+        
+        //VERIFY ESCHEAT DUE TO OLD TRANSACTION
+        savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(3));
+        SavingsStatusChecker.verifySavingsAccountIsClosed(savingsStatusHashMap);
+        savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(3));
+        SavingsStatusChecker.verifySavingsSubStatusEscheat(savingsStatusHashMap);
+        summary = this.savingsAccountHelper.getSavingsSummary(savingsList.get(3));
+        assertEquals("Verifying account Balance", 2900f, summary.get("accountBalance"));
+        
+        //VERIFY ESCHEAT DUE NO TRANSACTION FROM ACTIVATION
+        savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(4));
+        SavingsStatusChecker.verifySavingsAccountIsClosed(savingsStatusHashMap);
+        savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(4));
+        SavingsStatusChecker.verifySavingsSubStatusEscheat(savingsStatusHashMap);
+        summary = this.savingsAccountHelper.getSavingsSummary(savingsList.get(4));
+        assertEquals("Verifying account Balance", 900f, summary.get("accountBalance"));
+        
+        //VERIFY NON ACTIVE ACCOUNTS ARE NOT AFFECTED
+        savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(5));
+        SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
+        savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec,
this.responseSpec, savingsList.get(5));
+        SavingsStatusChecker.verifySavingsSubStatusNone(savingsStatusHashMap);
+        
+
+    }
 
     
     private HashMap activateSavingsAccount(final Integer savingsId, final String activationDate)
{
@@ -902,18 +1051,21 @@ public class ClientSavingsIntegrationTest {
             String enforceMinRequiredBalance, final boolean allowOverdraft) {
         final String taxGroupId = null;
         return createSavingsProduct(requestSpec, responseSpec, minOpenningBalance, minBalanceForInterestCalculation,
minRequiredBalance,
-                enforceMinRequiredBalance, allowOverdraft, taxGroupId);
+                enforceMinRequiredBalance, allowOverdraft, taxGroupId, false);
     }
     
     private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification
responseSpec,
             final String minOpenningBalance, String minBalanceForInterestCalculation, String
minRequiredBalance,
-            String enforceMinRequiredBalance, final boolean allowOverdraft, final String
taxGroupId) {
+            String enforceMinRequiredBalance, final boolean allowOverdraft, final String
taxGroupId, boolean withDormancy) {
         System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
         SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
         if (allowOverdraft) {
             final String overDraftLimit = "2000.0";
             savingsProductHelper = savingsProductHelper.withOverDraft(overDraftLimit);
         }
+        if(withDormancy){
+        	savingsProductHelper = savingsProductHelper.withDormancy();
+        }
 
         final String savingsProductJSON = savingsProductHelper
                 //

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/a4aee1a3/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/charges/ChargesHelper.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/charges/ChargesHelper.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/charges/ChargesHelper.java
index 6b17468..c8134a6 100755
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/charges/ChargesHelper.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/charges/ChargesHelper.java
@@ -48,6 +48,7 @@ public class ChargesHelper {
     private static final Integer CHARGE_OVERDUE_INSTALLMENT_FEE = 9;
     private static final Integer CHARGE_OVERDRAFT_FEE = 10;
     private static final Integer WEEKLY_FEE = 11;
+    private static final Integer CHARGE_SAVINGS_NO_ACTIVITY_FEE = 16;
     
     private static final Integer CHARGE_CLIENT_SPECIFIED_DUE_DATE = 1;
 
@@ -88,6 +89,14 @@ public class ChargesHelper {
         return chargesCreateJson;
     }
 
+    public static String getSavingsNoActivityFeeJSON() {
+        final HashMap<String, Object> map = populateDefaultsForSavings();
+        map.put("chargeTimeType", CHARGE_SAVINGS_NO_ACTIVITY_FEE);
+        String chargesCreateJson = new Gson().toJson(map);
+        System.out.println(chargesCreateJson);
+        return chargesCreateJson;
+    }
+
     public static String getSavingsWithdrawalFeeJSON() {
         final HashMap<String, Object> map = populateDefaultsForSavings();
         map.put("chargeTimeType", CHARGE_WITHDRAWAL_FEE);

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/a4aee1a3/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsApplicationTestBuilder.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsApplicationTestBuilder.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsApplicationTestBuilder.java
index fc02831..7fbceca 100755
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsApplicationTestBuilder.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsApplicationTestBuilder.java
@@ -27,6 +27,8 @@ public class SavingsApplicationTestBuilder {
     private static final String LOCALE = "en_GB";
 
     private String submittedOnDate = "";
+    
+    private HashMap<String, String> addParams = null;
 
     public String build(final String ID, final String savingsProductId, final String accountType)
{
 
@@ -40,6 +42,9 @@ public class SavingsApplicationTestBuilder {
         map.put("productId", savingsProductId);
         map.put("locale", LOCALE);
         map.put("submittedOnDate", this.submittedOnDate);
+        if(addParams!=null && addParams.size() > 0){
+        	map.putAll(addParams);
+        }
         String savingsApplicationJSON = new Gson().toJson(map);
         System.out.println(savingsApplicationJSON);
         return savingsApplicationJSON;
@@ -49,4 +54,10 @@ public class SavingsApplicationTestBuilder {
         this.submittedOnDate = savingsApplicationSubmittedDate;
         return this;
     }
+
+	public SavingsApplicationTestBuilder withParams(
+			HashMap<String, String> params) {
+		this.addParams = params;
+		return this;
+	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/a4aee1a3/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsProductHelper.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsProductHelper.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsProductHelper.java
index 0eca50b..929e49e 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsProductHelper.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsProductHelper.java
@@ -88,6 +88,10 @@ public class SavingsProductHelper {
     private String enforceMinRequiredBalance = "false";
     private Boolean withHoldTax = false;
     private String taxGroupId = null;
+    private boolean isDormancyTrackingActive = false;
+    private String daysToInactive = null;
+    private String daysToDormancy = null;
+    private String daysToEscheat = null;
 
     public String build() {
         final HashMap<String, String> map = new HashMap<>();
@@ -130,6 +134,13 @@ public class SavingsProductHelper {
         if (this.accountingRule.equals(CASH_BASED)) {
             map.putAll(getAccountMappingForCashBased());
         }
+        if(this.isDormancyTrackingActive){
+        	map.put("isDormancyTrackingActive", Boolean.toString(this.isDormancyTrackingActive));
+        	map.put("daysToInactive", this.daysToInactive);
+        	map.put("daysToDormancy", this.daysToDormancy);
+        	map.put("daysToEscheat", this.daysToEscheat);
+
+        }
         String savingsProductCreateJson = new Gson().toJson(map);
         System.out.println(savingsProductCreateJson);
         return savingsProductCreateJson;
@@ -263,4 +274,13 @@ public class SavingsProductHelper {
         assertEquals("ERROR IN CREATING THE Savings Product", generatedProductID, responseSavingsProductID);
     }
 
+	public SavingsProductHelper withDormancy() {
+	    this.isDormancyTrackingActive = true;
+	    this.daysToInactive = "30";
+	    this.daysToDormancy = "60";
+	    this.daysToEscheat = "90";
+
+		return this;
+	}
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/a4aee1a3/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsStatusChecker.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsStatusChecker.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsStatusChecker.java
index fe0b62e..3c6c387 100755
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsStatusChecker.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsStatusChecker.java
@@ -80,7 +80,38 @@ public class SavingsStatusChecker {
         return Utils.performServerGet(requestSpec, responseSpec, url, "status");
     }
 
-    private static boolean getStatus(final HashMap savingsStatusMap, final String nameOfSavingsStatusString)
{
+    public static HashMap getSubStatusOfSavings(final RequestSpecification requestSpec, final
ResponseSpecification responseSpec,
+            final Integer savingsID) {
+        final String url = SAVINGS_ACCOUNT_URL+"/" + savingsID + "?"+Utils.TENANT_IDENTIFIER;
+        return Utils.performServerGet(requestSpec, responseSpec, url, "subStatus");
+    }
+
+   private static boolean getStatus(final HashMap savingsStatusMap, final String nameOfSavingsStatusString)
{
         return (Boolean) savingsStatusMap.get(nameOfSavingsStatusString);
     }
+
+	public static void verifySavingsSubStatusInactive(HashMap savingsStatusHashMap) {
+        System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION
IS ACTIVE ------------------------------------");
+        assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap,
"inactive"));
+        System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n");
+	}
+	
+	public static void verifySavingsSubStatusDormant(HashMap savingsStatusHashMap) {
+        System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION
IS ACTIVE ------------------------------------");
+        assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap,
"dormant"));
+        System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n");
+	}
+	
+	public static void verifySavingsSubStatusEscheat(HashMap savingsStatusHashMap) {
+        System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION
IS ACTIVE ------------------------------------");
+        assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap,
"escheat"));
+        System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n");
+	}
+
+	public static void verifySavingsSubStatusNone(HashMap savingsStatusHashMap) {
+        System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION
IS ACTIVE ------------------------------------");
+        assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap,
"none"));
+        System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n");
+	}
+
 }
\ No newline at end of file


Mime
View raw message