FINERACT-821 Added and enforced ParameterName checkstyle

This commit is contained in:
Manthan Surkar
2020-07-15 23:33:37 +02:00
committed by Michael Vorburger ⛑️
parent 5506f68766
commit 737d1f1911
6 changed files with 34 additions and 33 deletions
@@ -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]*$"/>
@@ -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;
}
@@ -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;
}
@@ -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);
}
@@ -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");
}
}
@@ -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);