fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vorbur...@apache.org
Subject [fineract] branch develop updated: FINERACT-821 Added and enforced ParameterName checkstyle
Date Wed, 15 Jul 2020 21:33:45 GMT
This is an automated email from the ASF dual-hosted git repository.

vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 737d1f1  FINERACT-821 Added and enforced ParameterName checkstyle
737d1f1 is described below

commit 737d1f191184c5ce4ccda5df6b3a1bd188c82ada
Author: Manthan Surkar <manthan.surkar@gmail.com>
AuthorDate: Mon Jul 13 04:04:51 2020 +0530

    FINERACT-821 Added and enforced ParameterName checkstyle
---
 fineract-provider/config/checkstyle/checkstyle.xml | 11 ++++----
 .../integrationtests/FixedDepositTest.java         |  6 ++--
 .../integrationtests/RecurringDepositTest.java     |  6 ++--
 .../common/loans/LoanApplicationTestBuilder.java   |  6 ++--
 .../common/savings/SavingsAccountHelper.java       | 32 +++++++++++-----------
 .../savings/SavingsApplicationTestBuilder.java     |  6 ++--
 6 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/fineract-provider/config/checkstyle/checkstyle.xml b/fineract-provider/config/checkstyle/checkstyle.xml
index 3f29e71..3c5f03c 100644
--- a/fineract-provider/config/checkstyle/checkstyle.xml
+++ b/fineract-provider/config/checkstyle/checkstyle.xml
@@ -46,6 +46,11 @@
 
 
     <module name="TreeWalker">
+    <module name="ParameterName">
+            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$|[a-z]"/>
+            <message key="name.invalidPattern"
+             value="Parameter name ''{0}'' must match pattern ''{1}''."/>
+    </module>
     <module name="SeparatorWrap">
             <property name="tokens" value="DOT"/>
             <property name="option" value="nl"/>
@@ -221,11 +226,7 @@
             <message key="name.invalidPattern"
              value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
-        <module name="ParameterName">
-            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
-            <message key="name.invalidPattern"
-             value="Parameter name ''{0}'' must match pattern ''{1}''."/>
-        </module>
+
         <module name="LocalVariableName">
             <property name="tokens" value="VARIABLE_DEF"/>
             <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java
index 70ee319..583f95a 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java
@@ -2661,16 +2661,16 @@ public class FixedDepositTest {
         return financialAccount;
     }
 
-    private Account createLiabilityFinancialAccountTransferType(final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID)
{
+    private Account createLiabilityFinancialAccountTransferType(final Integer liabilityTransferFinancialActivityId)
{
         /***
          * Create and verify financial account transfer type is created
          */
         final Account liabilityAccountForMapping = this.accountHelper.createLiabilityAccount();
         Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
-                LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping.getAccountID(),
this.responseSpec,
+                liabilityTransferFinancialActivityId, liabilityAccountForMapping.getAccountID(),
this.responseSpec,
                 CommonConstants.RESPONSE_RESOURCE_ID);
         Assertions.assertNotNull(financialActivityAccountId);
-        assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID,
+        assertFinancialActivityAccountCreation(financialActivityAccountId, liabilityTransferFinancialActivityId,
                 liabilityAccountForMapping);
         return liabilityAccountForMapping;
     }
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java
index b6b4181..3f579ea 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java
@@ -3114,16 +3114,16 @@ public class RecurringDepositTest {
         return financialAccount;
     }
 
-    private Account createLiabilityFinancialAccountTransferType(final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID)
{
+    private Account createLiabilityFinancialAccountTransferType(final Integer liabilityTransferFinancialActivityId)
{
         /***
          * Create and verify financial account transfer type is created
          */
         final Account liabilityAccountForMapping = this.accountHelper.createLiabilityAccount();
         Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
-                LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping.getAccountID(),
this.responseSpec,
+                liabilityTransferFinancialActivityId, liabilityAccountForMapping.getAccountID(),
this.responseSpec,
                 CommonConstants.RESPONSE_RESOURCE_ID);
         Assertions.assertNotNull(financialActivityAccountId);
-        assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID,
+        assertFinancialActivityAccountCreation(financialActivityAccountId, liabilityTransferFinancialActivityId,
                 liabilityAccountForMapping);
         return liabilityAccountForMapping;
     }
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java
index 9e81182..72e4c43 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java
@@ -98,14 +98,14 @@ public class LoanApplicationTestBuilder {
         return build(map, loanProductId, savingsID);
     }
 
-    public String build(final String ID, final String loanProductId, final String savingsID)
{
+    public String build(final String id, final String loanProductId, final String savingsID)
{
 
         final HashMap<String, Object> map = new HashMap<>();
 
         if ("group".equals(this.loanType)) {
-            map.put("groupId", ID);
+            map.put("groupId", id);
         } else {
-            map.put("clientId", ID);
+            map.put("clientId", id);
         }
         return build(map, loanProductId, savingsID);
     }
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java
index 99567f6..0507f3e 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java
@@ -102,58 +102,58 @@ public class SavingsAccountHelper {
         return sdf.format(calendar.getTime());
     }
 
-    public Integer applyForSavingsApplication(final Integer ID, final Integer savingsProductID,
final String accountType) {
-        return applyForSavingsApplicationOnDate(ID, savingsProductID, accountType, CREATED_DATE);
+    public Integer applyForSavingsApplication(final Integer id, final Integer savingsProductID,
final String accountType) {
+        return applyForSavingsApplicationOnDate(id, savingsProductID, accountType, CREATED_DATE);
     }
 
-    public Integer applyForSavingsApplicationOnDate(final Integer ID, final Integer savingsProductID,
final String accountType,
+    public Integer applyForSavingsApplicationOnDate(final Integer id, final Integer savingsProductID,
final String accountType,
             final String submittedOnDate) {
-        return applyForSavingsApplicationOnDate(ID, savingsProductID, accountType, null,
false, submittedOnDate);
+        return applyForSavingsApplicationOnDate(id, savingsProductID, accountType, null,
false, submittedOnDate);
     }
 
-    public Integer applyForSavingsApplicationWithExternalId(final Integer ID, final Integer
savingsProductID, final String accountType,
+    public Integer applyForSavingsApplicationWithExternalId(final Integer id, final Integer
savingsProductID, final String accountType,
             String externalId, boolean withdrawalFeeForTransfers) {
-        return applyForSavingsApplicationOnDate(ID, savingsProductID, accountType, externalId,
withdrawalFeeForTransfers, CREATED_DATE);
+        return applyForSavingsApplicationOnDate(id, savingsProductID, accountType, externalId,
withdrawalFeeForTransfers, CREATED_DATE);
     }
 
-    public Integer applyForSavingsApplicationOnDate(final Integer ID, final Integer savingsProductID,
final String accountType,
+    public Integer applyForSavingsApplicationOnDate(final Integer id, final Integer savingsProductID,
final String accountType,
             String externalId, boolean withdrawalFeeForTransfers, final String submittedOnDate)
{
         LOG.info("--------------------------------APPLYING FOR SAVINGS APPLICATION--------------------------------");
         final String savingsApplicationJSON = new SavingsApplicationTestBuilder() //
                 .withExternalId(externalId) //
                 .withWithdrawalFeeForTransfers(withdrawalFeeForTransfers) //
                 .withSubmittedOnDate(submittedOnDate) //
-                .build(ID.toString(), savingsProductID.toString(), accountType);
+                .build(id.toString(), savingsProductID.toString(), accountType);
         return Utils.performServerPost(this.requestSpec, this.responseSpec, SAVINGS_ACCOUNT_URL
+ "?" + Utils.TENANT_IDENTIFIER,
                 savingsApplicationJSON, "savingsId");
     }
 
-    public Integer applyForSavingsApplicationWithDatatables(final Integer ID, final Integer
savingsProductID, final String accountType,
+    public Integer applyForSavingsApplicationWithDatatables(final Integer id, final Integer
savingsProductID, final String accountType,
             final String submittedOnDate, final String datatableName) {
         LOG.info("----------------------------APPLYING FOR SAVINGS APPLICATION WITH DATATABLES----------------------------");
         final String savingsApplicationJSON = new SavingsApplicationTestBuilder() //
                 .withSubmittedOnDate(submittedOnDate) //
                 .withDatatables(getTestDatatableAsJson(datatableName)) //
-                .build(ID.toString(), savingsProductID.toString(), accountType);
+                .build(id.toString(), savingsProductID.toString(), accountType);
         return Utils.performServerPost(this.requestSpec, this.responseSpec, SAVINGS_ACCOUNT_URL
+ "?" + Utils.TENANT_IDENTIFIER,
                 savingsApplicationJSON, "savingsId");
     }
 
-    public Object applyForSavingsApplicationWithFailure(final Integer ID, final Integer savingsProductID,
final String accountType,
+    public Object applyForSavingsApplicationWithFailure(final Integer id, final Integer savingsProductID,
final String accountType,
             final String submittedOnDate, final String responseAttribute) {
         LOG.info("----------------------------APPLYING FOR SAVINGS APPLICATION WITH ERROR----------------------------");
         final String savingsApplicationJSON = new SavingsApplicationTestBuilder() //
                 .withSubmittedOnDate(submittedOnDate) //
-                .build(ID.toString(), savingsProductID.toString(), accountType);
+                .build(id.toString(), savingsProductID.toString(), accountType);
         return Utils.performServerPost(this.requestSpec, this.responseSpec, SAVINGS_ACCOUNT_URL
+ "?" + Utils.TENANT_IDENTIFIER,
                 savingsApplicationJSON, responseAttribute);
     }
 
-    public HashMap updateSavingsAccount(final Integer ID, final Integer savingsProductID,
final Integer savingsId,
+    public HashMap updateSavingsAccount(final Integer id, final Integer savingsProductID,
final Integer savingsId,
             final String accountType) {
         final String savingsApplicationJSON = new SavingsApplicationTestBuilder() //
                 .withSubmittedOnDate(CREATED_DATE_PLUS_ONE) //
-                .build(ID.toString(), savingsProductID.toString(), accountType);
+                .build(id.toString(), savingsProductID.toString(), accountType);
 
         return Utils.performServerPut(this.requestSpec, this.responseSpec,
                 SAVINGS_ACCOUNT_URL + "/" + savingsId + "?" + Utils.TENANT_IDENTIFIER, savingsApplicationJSON,
@@ -591,13 +591,13 @@ public class SavingsAccountHelper {
     }
 
     private HashMap performSavingApplicationActions(final String postURLForSavingsTransaction,
final String jsonToBeSent,
-            final Boolean IS_BLOCK) {
+            final Boolean isBlock) {
         HashMap status = null;
         final HashMap response = Utils.performServerPost(this.requestSpec, this.responseSpec,
postURLForSavingsTransaction, jsonToBeSent,
                 CommonConstants.RESPONSE_CHANGES);
         if (response != null) {
             status = (HashMap) response.get("status");
-            if (IS_BLOCK != null && IS_BLOCK) {
+            if (isBlock != null && isBlock) {
                 status = (HashMap) response.get("subStatus");
             }
         }
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 0382f40..6666da9 100644
--- 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
@@ -43,14 +43,14 @@ public class SavingsApplicationTestBuilder {
     private List<Map<String, Object>> clientArray = null;
     private List<Map<String, Object>> savingsArray = null;
 
-    public String build(final String ID, final String savingsProductId, final String accountType)
{
+    public String build(final String id, final String savingsProductId, final String accountType)
{
 
         final HashMap<String, Object> map = new HashMap<>();
         map.put("dateFormat", "dd MMMM yyyy");
         if (accountType.equals("GROUP")) {
-            map.put("groupId", ID);
+            map.put("groupId", id);
         } else {
-            map.put("clientId", ID);
+            map.put("clientId", id);
         }
         map.put("productId", savingsProductId);
         map.put("locale", LOCALE);


Mime
View raw message