From 997e17facdcfb7d0cfa284aa4c552269a9fed804 Mon Sep 17 00:00:00 2001 From: thesmallstar Date: Sun, 15 Mar 2020 20:37:08 +0530 Subject: [PATCH] Removed Console output and added checkstyle module --- .../config/checkstyle/checkstyle.xml | 6 + .../AccountNumberPreferencesTest.java | 46 +-- .../integrationtests/AccountTransferTest.java | 9 +- .../AccountingScenarioIntegrationTest.java | 118 +++---- .../BatchRequestsIntegrationTest.java | 6 +- .../CenterIntegrationTest.java | 10 +- .../ClientLoanIntegrationTest.java | 312 +++++++++--------- .../ClientSavingsIntegrationTest.java | 45 ++- .../integrationtests/ClientStatusChecker.java | 24 +- .../ConcurrencyIntegrationTest.java | 18 +- .../DisbursalAndRepaymentScheduleTest.java | 25 +- .../ExternalServicesConfigurationTest.java | 8 +- .../integrationtests/FixedDepositTest.java | 82 +++-- ...SavingsInterestPostingIntegrationTest.java | 6 +- .../GroupLoanIntegrationTest.java | 12 +- .../GroupSavingsIntegrationTest.java | 6 +- .../fineract/integrationtests/GroupTest.java | 10 +- .../integrationtests/HookIntegrationTest.java | 12 +- .../LoanApplicationApprovalTest.java | 21 +- .../LoanApplicationUndoLastTrancheTest.java | 20 +- .../LoanDisbursalDateValidationTest.java | 12 +- ...oanDisbursementDetailsIntegrationTest.java | 41 ++- ...RepaymentRescheduleAtDisbursementTest.java | 12 +- .../LoanRescheduleRequestTest.java | 27 +- .../LoanReschedulingWithinCenterTest.java | 16 +- ...iveInterestAndWriteOffIntegrationTest.java | 20 +- .../integrationtests/NotificationApiTest.java | 6 +- .../PasswordPreferencesIntegrationTest.java | 6 +- .../RecurringDepositTest.java | 83 +++-- .../fineract/integrationtests/RolesTest.java | 28 +- .../integrationtests/SchedulerJobsTest.java | 6 +- .../SchedulerJobsTestResults.java | 16 +- .../SkipRepaymentOnMonthFirstTest.java | 17 +- .../UserAdministrationTest.java | 6 +- .../integrationtests/XBRLIntegrationTest.java | 6 +- .../integrationtests/common/BatchHelper.java | 6 +- .../common/CalendarHelper.java | 27 +- .../integrationtests/common/CenterDomain.java | 5 +- .../integrationtests/common/CenterHelper.java | 45 +-- .../integrationtests/common/ClientHelper.java | 90 ++--- .../common/CurrenciesHelper.java | 12 +- .../ExternalServicesConfigurationHelper.java | 10 +- .../common/GlobalConfigurationHelper.java | 27 +- .../integrationtests/common/GroupHelper.java | 57 ++-- .../common/HolidayHelper.java | 10 +- .../integrationtests/common/HookHelper.java | 18 +- .../integrationtests/common/ImageHelper.java | 14 +- .../common/NotificationHelper.java | 6 +- .../integrationtests/common/OfficeHelper.java | 8 +- .../common/PasswordPreferencesHelper.java | 9 +- .../common/PaymentTypeHelper.java | 16 +- .../common/ProvisioningIntegrationTest.java | 10 +- .../common/SchedulerJobHelper.java | 28 +- .../common/StandingInstructionsHelper.java | 12 +- .../integrationtests/common/SurveyHelper.java | 10 +- .../common/TaxComponentHelper.java | 8 +- .../common/TaxGroupHelper.java | 6 +- .../integrationtests/common/Utils.java | 4 +- .../common/WorkingDaysHelper.java | 13 +- .../common/charges/ChargesHelper.java | 52 +-- .../FixedDepositAccountHelper.java | 48 +-- .../FixedDepositAccountStatusChecker.java | 31 +- .../FixedDepositProductHelper.java | 14 +- .../loans/LoanApplicationTestBuilder.java | 6 +- .../common/loans/LoanTransactionHelper.java | 50 +-- .../common/organisation/CampaignsHelper.java | 24 +- .../common/organisation/CurrencyHelper.java | 8 +- .../EntityDatatableChecksHelper.java | 6 +- .../EntityDatatableChecksIntegrationTest.java | 12 +- .../common/organisation/StaffHelper.java | 10 +- .../RecurringDepositAccountHelper.java | 58 ++-- .../RecurringDepositAccountStatusChecker.java | 35 +- .../RecurringDepositProductHelper.java | 14 +- .../common/savings/AccountTransferHelper.java | 9 +- .../common/savings/SavingsAccountHelper.java | 76 ++--- .../SavingsApplicationTestBuilder.java | 6 +- .../common/savings/SavingsProductHelper.java | 8 +- .../common/savings/SavingsStatusChecker.java | 64 ++-- .../common/shares/ShareAccountHelper.java | 6 +- .../shares/ShareAccountIntegrationTests.java | 16 +- .../common/shares/ShareProductHelper.java | 6 +- .../AccountNumberPreferencesHelper.java | 22 +- .../common/system/DatatableHelper.java | 8 +- .../loanaccount/guarantor/GuarantorTest.java | 36 +- .../guarantor/GuarantorTestBuilder.java | 6 +- ...bleInstallmentsDecliningBalanceHelper.java | 14 +- .../VariableInstallmentsFlatHelper.java | 8 +- .../VariableInstallmentsIntegrationTest.java | 9 +- .../core/boot/ApplicationExitUtil.java | 5 +- .../org/apache/fineract/common/Utils.java | 7 +- .../mix/report/service/XBRLBuilderTest.java | 6 +- .../fineract/notification/Listener.java | 6 +- .../fineract/notification/SenderTest.java | 5 +- 93 files changed, 1174 insertions(+), 1066 deletions(-) diff --git a/fineract-provider/config/checkstyle/checkstyle.xml b/fineract-provider/config/checkstyle/checkstyle.xml index 84195dbfd92..00ec1de9c37 100644 --- a/fineract-provider/config/checkstyle/checkstyle.xml +++ b/fineract-provider/config/checkstyle/checkstyle.xml @@ -47,6 +47,7 @@ --> + @@ -59,6 +60,11 @@ + + + + + " + dateFormat.format(todaysDate.getTime())); + LOG.info("----timeeeeeeeeeeeeee------>" + dateFormat.format(todaysDate.getTime())); todaysDate.add(Calendar.DAY_OF_MONTH, -14); final String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime()); @@ -4109,12 +4111,12 @@ public void testLoanScheduleWithInterestRecalculation_WITH_ORIGINAL_REPAYMENT_BA verifyLoanRepaymentSchedule(loanSchedule, expectedvalues); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); @@ -4196,12 +4198,12 @@ private void testLoanScheduleWithInterestRecalculation_FOR_PRE_CLOSE_WITH_MORATO addRepaymentValues(expectedvalues, todaysDate, 1, false, "2517.29", "11.62", "0.0", "0.0"); verifyLoanRepaymentSchedule(loanSchedule, expectedvalues); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); @@ -4234,7 +4236,7 @@ private void addRepaymentValues(List> expectedvalues, Calend } else { values.put("dueDate", getDateAsArray(todaysDate, addPeriod * 7)); } - System.out.println("Updated date " + values.get("dueDate")); + LOG.info("Updated date " + values.get("dueDate")); values.put("principalDue", principalDue); values.put("interestDue", interestDue); values.put("feeChargesDue", feeChargesDue); @@ -4295,7 +4297,7 @@ private Integer createLoanProductWithInterestRecalculation(final String repaymen boolean isArrearsBasedOnOriginalSchedule, final Integer recalculationCompoundingFrequencyOnDayType, final Integer recalculationCompoundingFrequencyDayOfWeekType, final Integer recalculationRestFrequencyOnDayType, final Integer recalculationRestFrequencyDayOfWeekType) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); LoanProductTestBuilder builder = new LoanProductTestBuilder() .withPrincipal("10000000.00") .withNumberOfRepayments("24") @@ -4346,7 +4348,7 @@ private Integer applyForLoanApplicationForInterestRecalculation(final Integer cl private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, final Integer loanProductID, final String disbursementDate, final String repaymentStrategy, final List charges, final String graceOnInterestPayment, final String graceOnPrincipalPayment) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal("10000.00") // .withLoanTermFrequency("4") // @@ -4375,7 +4377,7 @@ private void verifyLoanRepaymentSchedule(final ArrayList loanSchedule, } private void verifyLoanRepaymentSchedule(final ArrayList loanSchedule, List> expectedvalues, int index) { - System.out.println("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); + LOG.info("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); for (Map values : expectedvalues) { assertEquals("Checking for Due Date for installment " + index, values.get("dueDate"), loanSchedule.get(index).get("dueDate")); validateNumberForEqualWithMsg("Checking for Principal Due for installment " + index, @@ -4439,12 +4441,12 @@ public void testLoanRefundByCashCashBasedAccounting() { HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(fourMonthsfromNow, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan(fourMonthsfromNow, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); @@ -4596,12 +4598,12 @@ public void testLoanRefundByCashAccrualBasedAccounting() { HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(fourMonthsfromNow, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan(fourMonthsfromNow, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); @@ -4767,12 +4769,12 @@ public void testLoanRefundByTransferCashBasedAccounting() { HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(fourMonthsfromNow, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan(fourMonthsfromNow, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); @@ -4905,7 +4907,7 @@ public void testLoanRefundByTransferCashBasedAccounting() { private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String minOpenningBalance) { - System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); SavingsProductHelper savingsProductHelper = new SavingsProductHelper(); final String savingsProductJSON = savingsProductHelper @@ -4935,23 +4937,23 @@ public void testLoanProductConfiguration() { .withRepaymentStrategy(LoanProductTestBuilder.DEFAULT_STRATEGY).withInterestTypeAsDecliningBalance() .withInterestCalculationPeriodTypeAsDays().withInArrearsTolerance("10").withMoratorium("2", "3") .withLoanProductConfiguration(loanProductConfigurationAsTrue).build(null)); - System.out.println("-----------------------LOAN PRODUCT CREATED WITH ATTRIBUTE CONFIGURATION AS TRUE--------------------------" + LOG.info("-----------------------LOAN PRODUCT CREATED WITH ATTRIBUTE CONFIGURATION AS TRUE--------------------------" + loanProductID); Integer loanID = applyForLoanApplicationWithProductConfigurationAsTrue(clientID, loanProductID, proposedAmount); - System.out.println("------------------------LOAN CREATED WITH ID------------------------------" + loanID); + LOG.info("------------------------LOAN CREATED WITH ID------------------------------" + loanID); loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder().withAmortizationTypeAsEqualInstallments() .withRepaymentTypeAsMonth().withRepaymentAfterEvery("1").withRepaymentStrategy(LoanProductTestBuilder.DEFAULT_STRATEGY) .withInterestTypeAsDecliningBalance().withInterestCalculationPeriodTypeAsDays().withInArrearsTolerance("10") .withMoratorium("2", "3").withLoanProductConfiguration(loanProductConfigurationAsFalse).build(null)); - System.out.println("-------------------LOAN PRODUCT CREATED WITH ATTRIBUTE CONFIGURATION AS FALSE----------------------" + LOG.info("-------------------LOAN PRODUCT CREATED WITH ATTRIBUTE CONFIGURATION AS FALSE----------------------" + loanProductID); /* * Try to override attribute values in loan account when attribute * configurations are set to false at product level */ loanID = applyForLoanApplicationWithProductConfigurationAsFalse(clientID, loanProductID, proposedAmount); - System.out.println("--------------------------LOAN CREATED WITH ID-------------------------" + loanID); + LOG.info("--------------------------LOAN CREATED WITH ID-------------------------" + loanID); this.validateIfValuesAreNotOverridden(loanID, loanProductID); } @@ -4981,20 +4983,20 @@ public void testLoanForeclosure() { HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("----------------------------------- APPROVE LOAN -----------------------------------------"); + LOG.info("----------------------------------- APPROVE LOAN -----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out.println("----------------------------------- DISBURSE LOAN ----------------------------------------"); + LOG.info("----------------------------------- DISBURSE LOAN ----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID, "10,000.00"); - System.out.println("DISBURSE " + loanStatusHashMap); + LOG.info("DISBURSE " + loanStatusHashMap); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - System.out.println("---------------------------------- Make repayment 1 --------------------------------------"); + LOG.info("---------------------------------- Make repayment 1 --------------------------------------"); this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("2676.24"), loanID); - System.out.println("---------------------------------- FORECLOSE LOAN ----------------------------------------"); + LOG.info("---------------------------------- FORECLOSE LOAN ----------------------------------------"); this.loanTransactionHelper.forecloseLoan("08 November 2011", loanID); // retrieving the loan status @@ -5036,7 +5038,7 @@ private JsonObject createLoanProductConfigurationDetail(JsonObject loanProductCo private Integer applyForLoanApplicationWithProductConfigurationAsTrue(final Integer clientID, final Integer loanProductID, String principal) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) // .withRepaymentEveryAfter("1") // @@ -5054,7 +5056,7 @@ private Integer applyForLoanApplicationWithProductConfigurationAsTrue(final Inte private Integer applyForLoanApplicationWithProductConfigurationAsFalse(final Integer clientID, final Integer loanProductID, String principal) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) 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 b3557c66685..f87cbfd1086 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 @@ -55,6 +55,8 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Client Savings Integration Test for checking Savings Application. @@ -62,6 +64,7 @@ @SuppressWarnings({ "rawtypes"}) public class ClientSavingsIntegrationTest { + private final static Logger LOG = LoggerFactory.getLogger(ClientSavingsIntegrationTest.class); public static final String DEPOSIT_AMOUNT = "2000"; public static final String WITHDRAW_AMOUNT = "1000"; public static final String WITHDRAW_AMOUNT_ADJUSTED = "500"; @@ -968,8 +971,7 @@ public void testSavingsAccountPostInterestOnLastDayWithOverdraft() { decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out - .println("-----Post Interest As on Successfully Worked----------"); + LOG.info("-----Post Interest As on Successfully Worked----------"); transactionDate.set(Calendar.DAY_OF_MONTH, 3); TRANSACTION_DATE = dateFormat.format(transactionDate.getTime()); @@ -1005,8 +1007,7 @@ public void testSavingsAccountPostInterestOnLastDayWithOverdraft() { decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out - .println("-----Post Interest As on Successfully Worked-------"); + LOG.info("-----Post Interest As on Successfully Worked-------"); //DateFormat transactionFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US); Calendar transactionCalendarDateFormat = Calendar.getInstance(); @@ -1045,8 +1046,7 @@ public void testSavingsAccountPostInterestOnLastDayWithOverdraft() { decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out - .println("-----Post Interest As on Successfully Worked----------"); + LOG.info("-----Post Interest As on Successfully Worked----------"); } DateFormat lastTransactionDateFormat = new SimpleDateFormat( "dd MMMM yyyy", Locale.US); @@ -1089,8 +1089,7 @@ public void testSavingsAccountPostInterestOnLastDayWithOverdraft() { decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out - .println("-----Post Interest As on Successfully Worked----------"); + LOG.info("-----Post Interest As on Successfully Worked----------"); } transactionDate.set(Calendar.DAY_OF_MONTH, 1); @@ -1126,8 +1125,7 @@ public void testSavingsAccountPostInterestOnLastDayWithOverdraft() { decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out - .println("-----Post Interest As on Successfully Worked----------"); + LOG.info("-----Post Interest As on Successfully Worked----------"); } @@ -1311,8 +1309,7 @@ public void testSavingsAccountPostInterestOnLastDayWithdrawalWithOverdraft() { decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out - .println("-----Post Interest As on Successfully Worked----------"); + LOG.info("-----Post Interest As on Successfully Worked----------"); transactionDate.set(Calendar.DAY_OF_MONTH, 3); TRANSACTION_DATE = dateFormat.format(transactionDate.getTime()); @@ -1348,8 +1345,7 @@ public void testSavingsAccountPostInterestOnLastDayWithdrawalWithOverdraft() { decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out - .println("-----Post Interest As on Successfully Worked-------"); + LOG.info("-----Post Interest As on Successfully Worked-------"); //DateFormat transactionFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US); Calendar transactionCalendarDateFormat = Calendar.getInstance(); @@ -1388,8 +1384,7 @@ public void testSavingsAccountPostInterestOnLastDayWithdrawalWithOverdraft() { decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out - .println("-----Post Interest As on Successfully Worked----------"); + LOG.info("-----Post Interest As on Successfully Worked----------"); } DateFormat lastTransactionDateFormat = new SimpleDateFormat( "dd MMMM yyyy", Locale.US); @@ -1432,8 +1427,7 @@ public void testSavingsAccountPostInterestOnLastDayWithdrawalWithOverdraft() { decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out - .println("-----Post Interest As on Successfully Worked----------"); + LOG.info("-----Post Interest As on Successfully Worked----------"); } transactionDate.set(Calendar.DAY_OF_MONTH, 1); @@ -1469,8 +1463,7 @@ public void testSavingsAccountPostInterestOnLastDayWithdrawalWithOverdraft() { decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out - .println("-----Post Interest As on Successfully Worked----------"); + LOG.info("-----Post Interest As on Successfully Worked----------"); } @SuppressWarnings("unchecked") @@ -1617,7 +1610,7 @@ public void testSavingsAccountPostInterestWithOverdraft() { interestPosted = new Float(decimalFormat.format(interestPosted)); //actualInterestPosted = new Float(decimalFormat.format(accountDetailsPostInterestPosted)); assertEquals("Verifying interest posted", interestPosted, accountDetailsPostInterestPosted); - System.out.println("------Post Interest As On After doing a post interest Successfully worked--------"); + LOG.info("------Post Interest As On After doing a post interest Successfully worked--------"); todaysDate = Calendar.getInstance(); final String CLOSEDON_DATE = dateFormat.format(todaysDate.getTime()); @@ -1704,7 +1697,7 @@ public void testPostInterestAsOnSavingsAccountWithOverdraft() { final String POSTED_TRANSACTION_DATE = dateFormat.format(postedDate.getTime()); Calendar postedLastDate = Calendar.getInstance(); int countOfDate=postedDate.getActualMaximum(Calendar.DAY_OF_MONTH); - System.out.println("count Of Date---> "+countOfDate); + LOG.info("count Of Date---> "+countOfDate); postedLastDate.set(Calendar.DAY_OF_MONTH,countOfDate); final String POSTED_LAST_TRANSACTION_DATE = dateFormat.format(postedLastDate.getTime()); @@ -1784,7 +1777,7 @@ public void testPostInterestAsOnSavingsAccountWithOverdraft() { interestPosted = new Float(decimalFormat.format(interestPosted)); actualInterestPosted = new Float(decimalFormat.format(actualInterestPosted)); assertEquals("Verifying interest posted", interestPosted, actualInterestPosted); - System.out.println("------Post Interest As On Successful Worked--------"); + LOG.info("------Post Interest As On Successful Worked--------"); this.savingsAccountHelper.postInterestAsOnSavings(savingsId, POSTED_LAST_TRANSACTION_DATE); HashMap accountLastDetails = this.savingsAccountHelper.getSavingsDetails(savingsId); @@ -1804,7 +1797,7 @@ public void testPostInterestAsOnSavingsAccountWithOverdraft() { interestLastPosted = new Float(decimalLastFormat.format(interestLastPosted)); actualInterestPosted = new Float(decimalFormat.format(actualInterestPosted)); assertEquals("Verifying interest posted", interestLastPosted, actualInterestPosted); - System.out.println("------Post Interest As On Successful Worked--------"); + LOG.info("------Post Interest As On Successful Worked--------"); } @@ -2071,7 +2064,7 @@ private Integer createSavingsProduct(final RequestSpecification requestSpec, fin private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String minOpenningBalance, String minBalanceForInterestCalculation, String minRequiredBalance, String enforceMinRequiredBalance, final boolean allowOverdraft, final String taxGroupId, boolean withDormancy) { - System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); SavingsProductHelper savingsProductHelper = new SavingsProductHelper(); if (allowOverdraft) { final String overDraftLimit = "2000.0"; @@ -2105,7 +2098,7 @@ private Integer createTaxGroup(final String percentage){ /* * private void verifySavingsInterest(final Object savingsInterest) { - * System.out.println( + * LOG.info( * "--------------------VERIFYING THE BALANCE, INTEREST --------------------------" * ); * diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientStatusChecker.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientStatusChecker.java index 12863bbdf50..afcfd7d08bb 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientStatusChecker.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientStatusChecker.java @@ -21,41 +21,43 @@ import static org.junit.Assert.assertEquals; import java.util.HashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ClientStatusChecker { - + private final static Logger LOG = LoggerFactory.getLogger(ClientStatusChecker.class); public static void verifyClientIsActive(final HashMap clientStatusHashMap) { assertEquals((int) clientStatusHashMap.get("id"), 300); } public static void verifyClientClosed(final HashMap clientStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING CLIENT IS CLOSED ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING CLIENT IS CLOSED ------------------------------------"); assertEquals((int) clientStatusHashMap.get("id"), 600); - System.out.println("Client Status:" + clientStatusHashMap + "\n"); + LOG.info("Client Status:" + clientStatusHashMap + "\n"); } public static void verifyClientPending(final HashMap clientStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING CLIENT IS PENDING ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING CLIENT IS PENDING ------------------------------------"); assertEquals((int) clientStatusHashMap.get("id"), 100); - System.out.println("Client Status:" + clientStatusHashMap + "\n"); + LOG.info("Client Status:" + clientStatusHashMap + "\n"); } public static void verifyClientRejected(final HashMap clientStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING CLIENT IS REJECTED ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING CLIENT IS REJECTED ------------------------------------"); assertEquals((int) clientStatusHashMap.get("id"), 700); - System.out.println("Client Status:" + clientStatusHashMap + "\n"); + LOG.info("Client Status:" + clientStatusHashMap + "\n"); } public static void verifyClientActiavted(final HashMap clientStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING CLIENT IS ACTIVATED ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING CLIENT IS ACTIVATED ------------------------------------"); assertEquals((int) clientStatusHashMap.get("id"), 300); - System.out.println("Client Status:" + clientStatusHashMap + "\n"); + LOG.info("Client Status:" + clientStatusHashMap + "\n"); } public static void verifyClientWithdrawn(final HashMap clientStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING CLIENT IS WITHDRAWN ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING CLIENT IS WITHDRAWN ------------------------------------"); assertEquals((int) clientStatusHashMap.get("id"), 800); - System.out.println("Client Status:" + clientStatusHashMap + "\n"); + LOG.info("Client Status:" + clientStatusHashMap + "\n"); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ConcurrencyIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ConcurrencyIntegrationTest.java index 9fdccaa804f..2ac8dc6f869 100755 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ConcurrencyIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ConcurrencyIntegrationTest.java @@ -37,9 +37,11 @@ import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ConcurrencyIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(ConcurrencyIntegrationTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private LoanTransactionHelper loanTransactionHelper; @@ -73,7 +75,7 @@ public void verifyConcurrentLoanRepayments() { date.set(2011, 9, 20); Float repaymentAmount = 100.0f; for (int i = 0; i < 10; i++) { - System.out.println("Starting concurrent transaction number " + i); + LOG.info("Starting concurrent transaction number " + i); date.add(Calendar.DAY_OF_MONTH, 1); repaymentAmount = repaymentAmount + 100; Runnable worker = new LoanRepaymentExecutor(loanTransactionHelper, loanID, repaymentAmount, date); @@ -85,12 +87,12 @@ public void verifyConcurrentLoanRepayments() { while (!executor.isTerminated()) { } - System.out.println("\nFinished all threads"); + LOG.info("\nFinished all threads"); } private Integer createLoanProduct(final boolean multiDisburseLoan, final String accountingRule, final Account... accounts) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); LoanProductTestBuilder builder = new LoanProductTestBuilder() // .withPrincipal("12,000.00") // .withNumberOfRepayments("4") // @@ -111,7 +113,7 @@ private Integer createLoanProduct(final boolean multiDisburseLoan, final String } private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID, String principal) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) // .withLoanTermFrequency("4") // @@ -150,12 +152,12 @@ public void run() { try { this.loanTransactionHelper.makeRepayment(repaymentDate, repaymentAmount, loanId); } catch (Exception e) { - System.out.println("Found an exception" + e.getMessage()); - System.out.println("Details of failed concurrent transaction (date, amount, loanId) are " + repaymentDate + "," + LOG.info("Found an exception" + e.getMessage()); + LOG.info("Details of failed concurrent transaction (date, amount, loanId) are " + repaymentDate + "," + repaymentAmount + "," + loanId); throw (e); } - System.out.println("Details of passed concurrent transaction, details (date, amount, loanId) are " + repaymentDate + "," + LOG.info("Details of passed concurrent transaction, details (date, amount, loanId) are " + repaymentDate + "," + repaymentAmount + "," + loanId); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/DisbursalAndRepaymentScheduleTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/DisbursalAndRepaymentScheduleTest.java index 9322561fd9b..b7c2e9fde2f 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/DisbursalAndRepaymentScheduleTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/DisbursalAndRepaymentScheduleTest.java @@ -44,6 +44,8 @@ import org.junit.Before; import org.junit.Ignore; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Tests loan schedule change based on group meeting changes and loan @@ -52,7 +54,7 @@ @SuppressWarnings({ "rawtypes" }) @Ignore public class DisbursalAndRepaymentScheduleTest { - + private final static Logger LOG = LoggerFactory.getLogger(DisbursalAndRepaymentScheduleTest.class); private ResponseSpecification responseSpec; private ResponseSpecification responseSpecForStatusCode403; private ResponseSpecification generalResponseSpec; @@ -78,7 +80,7 @@ public void setup() { @Test public void testRescheduleJLGLoanSynk() { - System.out.println("---------------------------------STARTING RESCHEDULE JLG LOAN TEST ------------------------------------------"); + LOG.info("---------------------------------STARTING RESCHEDULE JLG LOAN TEST ------------------------------------------"); Calendar meetingCalendar = Calendar.getInstance(); meetingCalendar.setFirstDayOfWeek(Calendar.MONDAY); @@ -127,7 +129,7 @@ public void testRescheduleJLGLoanSynk() { this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanRescheduleRequestHelper = new LoanRescheduleRequestHelper(this.requestSpec, this.responseSpec); - System.out.println("---------------------------------CREATING ENTITIES AND JLG LOAN ------------------------------------------"); + LOG.info("---------------------------------CREATING ENTITIES AND JLG LOAN ------------------------------------------"); // create all required entities this.createRequiredEntitiesForJLGLoanSync(groupMeetingDate); @@ -157,7 +159,7 @@ public void testRescheduleJLGLoanSynk() { loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - System.out.println("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------"); + LOG.info("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------"); CalendarHelper.updateMeetingCalendarForGroup(this.requestSpec, this.responseSpec, this.groupId, this.groupCalendarId.toString(), groupMeetingNewStartDate, "2", "2", "2"); // New meeting dates // will be the tuesday @@ -175,7 +177,7 @@ public void testRescheduleJLGLoanSynk() { (Integer) dueDateLoanSchedule.get(2)); assertEquals("AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY", 3, dueDateCalendar.get(Calendar.DAY_OF_WEEK)); - System.out.println("---------------------------------CREATING LOAN RESCHEDULE REQUEST------------------------------------------"); + LOG.info("---------------------------------CREATING LOAN RESCHEDULE REQUEST------------------------------------------"); String requestJSON = new LoanRescheduleRequestTestBuilder().updateGraceOnInterest("2").updateGraceOnPrincipal("2") .updateNewInterestRate(rescheduleInterestRate).updateRescheduleFromDate(rescheduleDate) @@ -191,9 +193,9 @@ public void testRescheduleJLGLoanSynk() { assertEquals("AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY, EVEN AFTER LOAN RESCHEDULE REQUEST WAS SENT", 3, dueDateCalendar.get(Calendar.DAY_OF_WEEK)); - System.out.println("Successfully created loan reschedule request (ID: " + this.loanRescheduleRequestId + ")"); + LOG.info("Successfully created loan reschedule request (ID: " + this.loanRescheduleRequestId + ")"); - System.out.println("-----------------------------APPROVING LOAN RESCHEDULE REQUEST--------------------------"); + LOG.info("-----------------------------APPROVING LOAN RESCHEDULE REQUEST--------------------------"); requestJSON = new LoanRescheduleRequestTestBuilder().updateSubmittedOnDate(rescheduleSubmittedDate) .getApproveLoanRescheduleRequestJSON(); @@ -209,7 +211,7 @@ public void testRescheduleJLGLoanSynk() { (Integer) dueDateLoanSchedule.get(2)); assertEquals("AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY, EVEN AFTER RESCHEDULE", 3, dueDateCalendar.get(Calendar.DAY_OF_WEEK)); - System.out.println("Successfully changed group meeting date (CAELNDAR ID: " + this.groupCalendarId + LOG.info("Successfully changed group meeting date (CAELNDAR ID: " + this.groupCalendarId + ") and rescheduled loan (RESCHEDULE ID: " + this.loanRescheduleRequestId + ")"); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpecForStatusCode403); @@ -217,8 +219,7 @@ public void testRescheduleJLGLoanSynk() { @Test public void testChangeGroupMeetingMaturedOnDate() { - System.out - .println("---------------------------------STARTING GROUP LOAN MEETING CHANGE DATE EXPECTED MATURED CHANGE------------------------------------------"); + LOG.info("---------------------------------STARTING GROUP LOAN MEETING CHANGE DATE EXPECTED MATURED CHANGE------------------------------------------"); Calendar meetingCalendar = Calendar.getInstance(); meetingCalendar.setFirstDayOfWeek(Calendar.MONDAY); @@ -262,7 +263,7 @@ public void testChangeGroupMeetingMaturedOnDate() { this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanRescheduleRequestHelper = new LoanRescheduleRequestHelper(this.requestSpec, this.responseSpec); - System.out.println("---------------------------------CREATING ENTITIES AND JLG LOAN ------------------------------------------"); + LOG.info("---------------------------------CREATING ENTITIES AND JLG LOAN ------------------------------------------"); // create all required entities this.createRequiredEntitiesForJLGLoanSync(groupMeetingDate); @@ -292,7 +293,7 @@ public void testChangeGroupMeetingMaturedOnDate() { loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - System.out.println("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------"); + LOG.info("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------"); CalendarHelper.updateMeetingCalendarForGroup(this.requestSpec, this.responseSpec, this.groupId, this.groupCalendarId.toString(), groupMeetingNewStartDate, "2", "2", "2"); // New meeting dates // will be the tuesday diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ExternalServicesConfigurationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ExternalServicesConfigurationTest.java index 6dec6115305..efbd6508575 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ExternalServicesConfigurationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ExternalServicesConfigurationTest.java @@ -30,10 +30,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked", "static-access" }) public class ExternalServicesConfigurationTest { - + private final static Logger LOG = LoggerFactory.getLogger(ExternalServicesConfigurationTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private ExternalServicesConfigurationHelper externalServicesConfigurationHelper; @@ -67,7 +69,7 @@ public void testExternalServicesConfiguration() { value = "testnull"; } String newValue = "test"; - System.out.println(name + ":" + value); + LOG.info(name + ":" + value); HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec, responseSpec, "S3", name, newValue); Assert.assertNotNull(arrayListValue.get("value")); @@ -95,7 +97,7 @@ public void testExternalServicesConfiguration() { value = "testnull"; } String newValue = "test"; - System.out.println(name + ":" + value); + LOG.info(name + ":" + value); HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec, responseSpec, "SMTP", name, newValue); Assert.assertNotNull(arrayListValue.get("value")); 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 dd37deffc50..193ba94f4f6 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 @@ -61,10 +61,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "unused", "unchecked", "rawtypes", "static-access" }) public class FixedDepositTest { - + private final static Logger LOG = LoggerFactory.getLogger(FixedDepositTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private FixedDepositProductHelper fixedDepositProductHelper; @@ -1228,7 +1230,6 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_365_Da Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); @@ -1240,7 +1241,6 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_365_Da decimalFormat.applyPattern("."); principal = new Float(decimalFormat.format(principal)); maturityAmount = new Float(decimalFormat.format(maturityAmount)); - System.out.println(principal); Assert.assertEquals("Verifying Maturity amount for Fixed Deposit Account", principal, maturityAmount); } @@ -1302,7 +1302,6 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_360_Da Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); @@ -1313,7 +1312,6 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_360_Da decimalFormat.applyPattern("."); principal = new Float(decimalFormat.format(principal)); maturityAmount = new Float(decimalFormat.format(maturityAmount)); - System.out.println(principal); Assert.assertEquals("Verifying Maturity amount for Fixed Deposit Account", principal, maturityAmount); } @@ -1380,7 +1378,7 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_365() { interestRate -= preClosurePenalInterestRate; double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; todaysDate.add(Calendar.MONTH, -1); @@ -1391,12 +1389,12 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_365() { Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth; todaysDate.add(Calendar.DATE, daysInMonth); - System.out.println(monthDayFormat.format(todaysDate.getTime())); + LOG.info(monthDayFormat.format(todaysDate.getTime())); interestPerMonth = (float) (interestPerDay * principal * currentDate); - System.out.println("IPM = " + interestPerMonth); + LOG.info("IPM = " + interestPerMonth); principal += interestPerMonth; - System.out.println("principal = " + principal); + LOG.info("principal = " + principal); HashMap fixedDepositPrematureData = this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE); @@ -1488,7 +1486,7 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_360() { interestRate -= preClosurePenalInterestRate; double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; todaysDate.add(Calendar.MONTH, -1); @@ -1499,12 +1497,12 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_360() { Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth; todaysDate.add(Calendar.DATE, daysInMonth); - System.out.println(monthDayFormat.format(todaysDate.getTime())); + LOG.info(monthDayFormat.format(todaysDate.getTime())); interestPerMonth = (float) (interestPerDay * principal * currentDate); - System.out.println("IPM = " + interestPerMonth); + LOG.info("IPM = " + interestPerMonth); principal += interestPerMonth; - System.out.println("principal = " + principal); + LOG.info("principal = " + principal); HashMap fixedDepositPrematureData = this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE); @@ -1601,7 +1599,7 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W interestRate -= preClosurePenalInterestRate; double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; todaysDate.add(Calendar.MONTH, -1); @@ -1612,12 +1610,12 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth; todaysDate.add(Calendar.DATE, daysInMonth); - System.out.println(monthDayFormat.format(todaysDate.getTime())); + LOG.info(monthDayFormat.format(todaysDate.getTime())); interestPerMonth = (float) (interestPerDay * principal * currentDate); - System.out.println("IPM = " + interestPerMonth); + LOG.info("IPM = " + interestPerMonth); principal += interestPerMonth; - System.out.println("principal = " + principal); + LOG.info("principal = " + principal); HashMap fixedDepositPrematureData = this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE); @@ -1717,7 +1715,7 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W interestRate -= preClosurePenalInterestRate; double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; todaysDate.add(Calendar.MONTH, -1); @@ -1728,12 +1726,12 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth; todaysDate.add(Calendar.DATE, daysInMonth); - System.out.println(monthDayFormat.format(todaysDate.getTime())); + LOG.info(monthDayFormat.format(todaysDate.getTime())); interestPerMonth = (float) (interestPerDay * principal * currentDate); - System.out.println("IPM = " + interestPerMonth); + LOG.info("IPM = " + interestPerMonth); principal += interestPerMonth; - System.out.println("principal = " + principal); + LOG.info("principal = " + principal); HashMap fixedDepositPrematureData = this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE); @@ -1816,7 +1814,6 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_365_Days Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); @@ -1828,7 +1825,6 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_365_Days decimalFormat.applyPattern("."); principal = new Float(decimalFormat.format(principal)); maturityAmount = new Float(decimalFormat.format(maturityAmount)); - System.out.println(principal); Assert.assertEquals("Verifying Maturity amount for Fixed Deposit Account", principal, maturityAmount); } @@ -1857,7 +1853,7 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_360_Days final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - System.out.println("Submitted Date:" + SUBMITTED_ON_DATE); + LOG.info("Submitted Date:" + SUBMITTED_ON_DATE); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Assert.assertNotNull(clientId); @@ -1893,7 +1889,6 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_360_Days Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); @@ -1903,7 +1898,6 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_360_Days principal = new BigDecimal(principal).setScale(0, BigDecimal.ROUND_FLOOR).floatValue(); maturityAmount = new BigDecimal(maturityAmount).setScale(0, BigDecimal.ROUND_FLOOR).floatValue(); - System.out.println(principal); Assert.assertEquals("Verifying Maturity amount for Fixed Deposit Account", principal, maturityAmount); } @@ -1929,7 +1923,7 @@ public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_365_Day Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -1975,7 +1969,7 @@ public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_365_Day Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, @@ -2013,7 +2007,7 @@ public void testMaturityAmountDailyCompoundingAndAnnuallyPostingWith_360_Days() Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2059,7 +2053,7 @@ public void testMaturityAmountDailyCompoundingAndAnnuallyPostingWith_360_Days() Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, @@ -2098,7 +2092,7 @@ public void testFixedDepositWithBi_AnnualCompoundingAndPosting_365_Days() { Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2141,7 +2135,7 @@ public void testFixedDepositWithBi_AnnualCompoundingAndPosting_365_Days() { Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, @@ -2180,7 +2174,7 @@ public void testFixedDepositWithBi_AnnualCompoundingAndPosting_360_Days() { Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2223,7 +2217,7 @@ public void testFixedDepositWithBi_AnnualCompoundingAndPosting_360_Days() { Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, @@ -2262,7 +2256,7 @@ public void testFixedDepositWithQuarterlyCompoundingAndQuarterlyPosting_365_Days Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2305,7 +2299,7 @@ public void testFixedDepositWithQuarterlyCompoundingAndQuarterlyPosting_365_Days Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, @@ -2343,7 +2337,7 @@ public void testFixedDepositWithQuarterlyCompoundingAndQuarterlyPosting_360_Days Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2386,7 +2380,7 @@ public void testFixedDepositWithQuarterlyCompoundingAndQuarterlyPosting_360_Days Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, @@ -2404,7 +2398,7 @@ public void testFixedDepositWithQuarterlyCompoundingAndQuarterlyPosting_360_Days private Integer createFixedDepositProduct(final String validFrom, final String validTo, final String accountingRule, Account... accounts) { - System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------"); FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec); if (accountingRule.equals(CASH_BASED)) { fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsCashBased(accounts); @@ -2419,7 +2413,7 @@ private Integer createFixedDepositProduct(final String validFrom, final String v private Integer createFixedDepositProductWithWithHoldTax(final String validFrom, final String validTo, final String taxGroupId, final String accountingRule, Account... accounts) { - System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------"); FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec); if (accountingRule.equals(CASH_BASED)) { fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsCashBased(accounts); @@ -2434,7 +2428,7 @@ private Integer createFixedDepositProductWithWithHoldTax(final String validFrom, private Integer createFixedDepositProduct(final String validFrom, final String validTo, final String accountingRule, final String chartToBePicked, Account... accounts) { - System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------"); FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec); if (accountingRule.equals(CASH_BASED)) { fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsCashBased(accounts); @@ -2465,7 +2459,7 @@ private Integer createFixedDepositProduct(final String validFrom, final String v private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String submittedOnDate, final String penalInterestType) { - System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------"); + LOG.info("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------"); final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) // .withSubmittedOnDate(submittedOnDate).build(clientID, productID, penalInterestType); return this.fixedDepositAccountHelper @@ -2474,7 +2468,7 @@ private Integer applyForFixedDepositApplication(final String clientID, final Str private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String submittedOnDate, final String penalInterestType, final String depositAmount, final String depositPeriod) { - System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------"); + LOG.info("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------"); final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) // .withSubmittedOnDate(submittedOnDate).withDepositPeriod(depositPeriod).withDepositAmount(depositAmount) @@ -2485,7 +2479,7 @@ private Integer applyForFixedDepositApplication(final String clientID, final Str private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String minOpenningBalance, final String accountingRule, Account... accounts) { - System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); SavingsProductHelper savingsProductHelper = new SavingsProductHelper(); if (accountingRule.equals(CASH_BASED)) { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FlexibleSavingsInterestPostingIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FlexibleSavingsInterestPostingIntegrationTest.java index 52baadc1444..f19440a3e84 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FlexibleSavingsInterestPostingIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FlexibleSavingsInterestPostingIntegrationTest.java @@ -39,10 +39,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unused", "unchecked" }) public class FlexibleSavingsInterestPostingIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(FlexibleSavingsInterestPostingIntegrationTest.class); public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL"; private ResponseSpecification responseSpec; @@ -84,7 +86,7 @@ public void testSavingsInterestPostingAtPeriodEnd() { ArrayList> transactions = (ArrayList>) accountDetails.get("transactions"); HashMap interestPostingTransaction = transactions.get(transactions.size() - 2); for (Entry entry : interestPostingTransaction.entrySet()) - System.out.println(entry.getKey() + "-" + entry.getValue().toString()); + LOG.info(entry.getKey() + "-" + entry.getValue().toString()); // 1st Dec 13 to 31st March 14 - 365 days, daily compounding using daily // balance // 33.7016 obtained from formula in excel provided by Subramanya diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupLoanIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupLoanIntegrationTest.java index 7dcd9915457..92e67bdeeee 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupLoanIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupLoanIntegrationTest.java @@ -36,13 +36,15 @@ import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Group Loan Integration Test for checking Loan Application Repayment Schedule. */ @SuppressWarnings({ "rawtypes", "unchecked" }) public class GroupLoanIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(GroupLoanIntegrationTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private LoanTransactionHelper loanTransactionHelper; @@ -72,7 +74,7 @@ public void checkGroupLoanCreateAndDisburseFlow() { } private Integer createLoanProduct() { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); final String loanProductJSON = new LoanProductTestBuilder() // .withPrincipal("12,000.00") // .withNumberOfRepayments("4") // @@ -87,7 +89,7 @@ private Integer createLoanProduct() { } private Integer applyForLoanApplication(final Integer groupID, final Integer loanProductID) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal("12,000.00") // .withLoanTermFrequency("4") // @@ -102,12 +104,12 @@ private Integer applyForLoanApplication(final Integer groupID, final Integer loa .withExpectedDisbursementDate("20 September 2011") // .withSubmittedOnDate("20 September 2011") // .withLoanType("group").build(groupID.toString(), loanProductID.toString(), null); - System.out.println(loanApplicationJSON); + LOG.info(loanApplicationJSON); return this.loanTransactionHelper.getLoanId(loanApplicationJSON); } private void verifyLoanRepaymentSchedule(final ArrayList loanSchedule) { - System.out.println("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); + LOG.info("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2011, 10, 20)), loanSchedule.get(1).get("dueDate")); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupSavingsIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupSavingsIntegrationTest.java index d8d3aeb09d2..d3629f98459 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupSavingsIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupSavingsIntegrationTest.java @@ -45,13 +45,15 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Group Savings Integration Test for checking Savings Application. */ @SuppressWarnings({ "rawtypes", "unused" }) public class GroupSavingsIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(GroupSavingsIntegrationTest.class); public static final String DEPOSIT_AMOUNT = "2000"; public static final String WITHDRAW_AMOUNT = "1000"; public static final String WITHDRAW_AMOUNT_ADJUSTED = "500"; @@ -536,7 +538,7 @@ public void testSavingsAccountCharges() { public static Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String minOpenningBalance, final String minBalanceForInterestCalculation, final String minRequiredBalance, final String enforceMinRequiredBalance) { - System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); SavingsProductHelper savingsProductHelper = new SavingsProductHelper(); final String savingsProductJSON = savingsProductHelper // .withInterestCompoundingPeriodTypeAsDaily() // diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupTest.java index 6284b2641df..95ed35955c0 100755 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupTest.java @@ -37,13 +37,15 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Group Test for checking Group: Creation, Activation, Client Association, * Updating & Deletion */ public class GroupTest { - + private final static Logger LOG = LoggerFactory.getLogger(GroupTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private LoanTransactionHelper loanTransactionHelper; @@ -107,11 +109,11 @@ public void assignStaffToGroup() { // create staff Integer createStaffId1 = StaffHelper.createStaff(this.requestSpec, this.responseSpec); - System.out.println("--------------creating first staff with id-------------" + createStaffId1); + LOG.info("--------------creating first staff with id-------------" + createStaffId1); Assert.assertNotNull(createStaffId1); Integer createStaffId2 = StaffHelper.createStaff(this.requestSpec, this.responseSpec); - System.out.println("--------------creating second staff with id-------------" + createStaffId2); + LOG.info("--------------creating second staff with id-------------" + createStaffId2); Assert.assertNotNull(createStaffId2); // assign staff "createStaffId1" to group @@ -155,7 +157,7 @@ private Integer createLoanProduct() { } private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID, String principal) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) // .withLoanTermFrequency("4") // diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java index 035d40ebb46..0c75a4ac324 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java @@ -36,9 +36,11 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HookIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(HookIntegrationTest.class); private RequestSpecification requestSpec; private ResponseSpecification responseSpec; @@ -77,7 +79,7 @@ public void shouldSendOfficeCreationNotification() { final Integer notificationOfficeId = JsonPath.with(json).get("officeId"); Assert.assertEquals("Equality check for created officeId and hook received payload officeId", createdOfficeID, notificationOfficeId); - System.out.println("Notification Office Id - " + notificationOfficeId); + LOG.info("Notification Office Id - " + notificationOfficeId); i = 6; } catch (Exception e) { TimeUnit.SECONDS.sleep(3); @@ -102,13 +104,13 @@ public void createUpdateAndDeleteHook(){ Long hookId = this.hookHelper.createHook(payloadURL).longValue(); Assert.assertNotNull(hookId); this.hookHelper.verifyHookCreatedOnServer(hookId); - System.out.println("---------------------SUCCESSFULLY CREATED AND VERIFIED HOOK-------------------------"+hookId); + LOG.info("---------------------SUCCESSFULLY CREATED AND VERIFIED HOOK-------------------------"+hookId); this.hookHelper.updateHook(updateURL, hookId); this.hookHelper.verifyUpdateHook(updateURL, hookId); - System.out.println("---------------------SUCCESSFULLY UPDATED AND VERIFIED HOOK-------------------------"+hookId); + LOG.info("---------------------SUCCESSFULLY UPDATED AND VERIFIED HOOK-------------------------"+hookId); this.hookHelper.deleteHook(hookId); this.hookHelper.verifyDeleteHook(hookId); - System.out.println("---------------------SUCCESSFULLY DELETED AND VERIFIED HOOK-------------------------"+hookId); + LOG.info("---------------------SUCCESSFULLY DELETED AND VERIFIED HOOK-------------------------"+hookId); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationApprovalTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationApprovalTest.java index 3678f25fba0..f17185333b9 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationApprovalTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationApprovalTest.java @@ -37,10 +37,12 @@ import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings("rawtypes") public class LoanApplicationApprovalTest { - + private final static Logger LOG = LoggerFactory.getLogger(LoanApplicationApprovalTest.class); private ResponseSpecification responseSpec; private ResponseSpecification responseSpecForStatusCode403; private ResponseSpecification responseSpecForStatusCode400; @@ -128,13 +130,13 @@ public void loanApplicationApprovalAndValidationForMultiDisburseLoans() { createTranches.add(createTrancheDetail("23 March 2014", "4000")); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014"); - System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + LOG.info("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + clientID); final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder() .withInterestTypeAsDecliningBalance().withTranches(true).withInterestCalculationPeriodTypeAsRepaymentPeriod(true) .build(null)); - System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------" + LOG.info("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------" + loanProductID); this.trancheLoansApprovedAmountLesserThanProposedAmount(clientID, loanProductID, createTranches); @@ -153,19 +155,18 @@ private void trancheLoansApprovedAmountLesserThanProposedAmount(Integer clientID approveTranches.add(createTrancheDetail("23 March 2014", "1000")); final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, proposedAmount, createTranches); - System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------" + LOG.info("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------" + loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount, loanID, approveTranches); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out - .println("-----------------------------------MULTI DISBURSAL LOAN APPROVED SUCCESSFULLY---------------------------------------"); + LOG.info("-----------------------------------MULTI DISBURSAL LOAN APPROVED SUCCESSFULLY---------------------------------------"); } @@ -200,13 +201,13 @@ private void trancheLoansApprovalValidation(Integer clientID, Integer loanProduc approveTranche4.add(createTrancheDetail("24 March 2014", "100")); final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, proposedAmount, createTranches); - System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------" + LOG.info("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------" + loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpecForStatusCode400); /* Tranches with same expected disbursement date */ @@ -256,7 +257,7 @@ private Integer applyForLoanApplication(final Integer clientID, final Integer lo public Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal, List tranches) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationUndoLastTrancheTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationUndoLastTrancheTest.java index b366e1fb9c8..b3fbed65a15 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationUndoLastTrancheTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationUndoLastTrancheTest.java @@ -35,10 +35,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings("rawtypes") public class LoanApplicationUndoLastTrancheTest { - + private final static Logger LOG = LoggerFactory.getLogger(LoanApplicationUndoLastTrancheTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private LoanTransactionHelper loanTransactionHelper; @@ -65,14 +67,14 @@ public void LoanApplicationUndoLastTranche() { // CREATE CLIENT final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014"); - System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + LOG.info("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + clientID); // CREATE LOAN MULTIDISBURSAL PRODUCT final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder() .withInterestTypeAsDecliningBalance().withTranches(true).withInterestCalculationPeriodTypeAsRepaymentPeriod(true) .build(null)); - System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------" + LOG.info("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------" + loanProductID); // CREATE TRANCHES @@ -87,14 +89,14 @@ public void LoanApplicationUndoLastTranche() { // APPLY FOR LOAN WITH TRANCHES final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, proposedAmount, createTranches); - System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------" + LOG.info("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------" + loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); // VALIDATE THE LOAN STATUS LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount, loanID, approveTranches); @@ -109,11 +111,11 @@ public void LoanApplicationUndoLastTranche() { // VALIDATE THE LOAN IS ACTIVE STATUS LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - System.out.println("-------------Make repayment 1-----------"); + LOG.info("-------------Make repayment 1-----------"); this.loanTransactionHelper.makeRepayment("01 April 2014", Float.valueOf("420"), loanID); - System.out.println("-------------Make repayment 2-----------"); + LOG.info("-------------Make repayment 2-----------"); this.loanTransactionHelper.makeRepayment("01 May 2014", Float.valueOf("412"), loanID); - System.out.println("-------------Make repayment 3-----------"); + LOG.info("-------------Make repayment 3-----------"); this.loanTransactionHelper.makeRepayment("01 June 2014", Float.valueOf("204"), loanID); // DISBURSE A SECOND TRANCHE this.loanTransactionHelper.disburseLoan("23 June 2014", loanID); @@ -129,7 +131,7 @@ private void validateDisbursedAmount(Float disbursedAmount) { public Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal, List tranches) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursalDateValidationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursalDateValidationTest.java index 300149e4c3d..758dd8ea45a 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursalDateValidationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursalDateValidationTest.java @@ -35,10 +35,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings("rawtypes") public class LoanDisbursalDateValidationTest { - + private final static Logger LOG = LoggerFactory.getLogger(LoanDisbursalDateValidationTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private LoanTransactionHelper loanTransactionHelper; @@ -63,25 +65,25 @@ public void LoanApplicationValidateDisbursalDate() { // CREATE CLIENT final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014"); - System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + LOG.info("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + clientID); // CREATE LOAN PRODUCT final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder() .withSyncExpectedWithDisbursementDate(true).build(null)); - System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------" + LOG.info("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------" + loanProductID); // APPLY FOR LOAN final Integer loanID = applyForLoanApplication(clientID, loanProductID, proposedAmount); - System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------" + LOG.info("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------" + loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); // VALIDATE THE LOAN STATUS LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(approveDate, loanID); // VALIDATE THE LOAN IS APPROVED diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java index 78fd2d2c05e..7bde1e3bfcc 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java @@ -39,10 +39,12 @@ import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked" }) public class LoanDisbursementDetailsIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(LoanDisbursementDetailsIntegrationTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private LoanTransactionHelper loanTransactionHelper; @@ -73,20 +75,19 @@ public void createAndValidateMultiDisburseLoansBasedOnEmi() { createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 Sep 2015", "5000")); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014"); - System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + LOG.info("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + clientID); final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder() .withInterestTypeAsDecliningBalance().withMoratorium("", "").withAmortizationTypeAsEqualInstallments().withTranches(true) .withInterestCalculationPeriodTypeAsRepaymentPeriod(true).build(null)); - System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------" + LOG.info("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------" + loanProductID); final Integer loanIDWithEmi = applyForLoanApplicationWithEmiAmount(clientID, loanProductID, proposedAmount, createTranches, installmentAmount); - System.out - .println("-----------------------------------LOAN CREATED WITH EMI LOANID-------------------------------------------------" + LOG.info("-----------------------------------LOAN CREATED WITH EMI LOANID-------------------------------------------------" + loanIDWithEmi); HashMap repaymentScheduleWithEmi = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, @@ -100,13 +101,12 @@ public void createAndValidateMultiDisburseLoansBasedOnEmi() { HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanIDWithEmi); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount("01 June 2015", "01 June 2015", "10000", loanIDWithEmi, createTranches); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out - .println("-----------------------------------MULTI DISBURSAL LOAN WITH EMI APPROVED SUCCESSFULLY---------------------------------------"); + LOG.info("-----------------------------------MULTI DISBURSAL LOAN WITH EMI APPROVED SUCCESSFULLY---------------------------------------"); final Integer loanIDWithoutEmi = applyForLoanApplicationWithEmiAmount(clientID, loanProductID, proposedAmount, createTranches, withoutInstallmentAmount); @@ -117,8 +117,7 @@ public void createAndValidateMultiDisburseLoansBasedOnEmi() { ArrayList periods1 = (ArrayList) repaymentScheduleWithEmi.get("periods"); assertEquals(periods1.size(), 15); - System.out - .println("-----------------------------------LOAN CREATED WITHOUT EMI LOANID-------------------------------------------------" + LOG.info("-----------------------------------LOAN CREATED WITHOUT EMI LOANID-------------------------------------------------" + loanIDWithoutEmi); /* To be uncommented once issue MIFOSX-2006 is closed. */ @@ -127,13 +126,12 @@ public void createAndValidateMultiDisburseLoansBasedOnEmi() { HashMap loanStatusMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanIDWithoutEmi); LoanStatusChecker.verifyLoanIsPending(loanStatusMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount("01 June 2015", "01 June 2015", "10000", loanIDWithoutEmi, createTranches); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out - .println("-----------------------------------MULTI DISBURSAL LOAN WITHOUT EMI APPROVED SUCCESSFULLY---------------------------------------"); + LOG.info("-----------------------------------MULTI DISBURSAL LOAN WITHOUT EMI APPROVED SUCCESSFULLY---------------------------------------"); } @@ -209,7 +207,7 @@ private void assertRepaymentScheduleValuesWithEMI(HashMap period, LoanDisburseme assertEquals(period.get("dueDate").toString(), expectedRepaymentSchedule.getDueDate()); assertEquals(period.get("principalLoanBalanceOutstanding"), expectedRepaymentSchedule.getPrincipalLoanBalanceOutstanding()); - System.out.println(period.get("totalOriginalDueForPeriod").toString()); + LOG.info(period.get("totalOriginalDueForPeriod").toString()); assertEquals(new Float(period.get("totalOriginalDueForPeriod").toString()), expectedRepaymentSchedule .getTotalOriginalDueForPeriod().floatValue(), 0.0f); @@ -342,7 +340,7 @@ private void assertRepaymentScheduleValuesWithEMI(HashMap period, LoanDisburseme private Integer applyForLoanApplicationWithEmiAmount(final Integer clientID, final Integer loanProductID, final String proposedAmount, List tranches, final String installmentAmount) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(proposedAmount) @@ -373,29 +371,28 @@ public void createApproveAndValidateMultiDisburseLoan() { createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 March 2014", "1000")); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014"); - System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + LOG.info("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + clientID); final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder() .withInterestTypeAsDecliningBalance().withTranches(true).withInterestCalculationPeriodTypeAsRepaymentPeriod(true) .build(null)); - System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------" + LOG.info("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------" + loanProductID); this.loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, proposedAmount, createTranches); - System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------" + LOG.info("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------" + loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount, loanID, createTranches); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out - .println("-----------------------------------MULTI DISBURSAL LOAN APPROVED SUCCESSFULLY---------------------------------------"); + LOG.info("-----------------------------------MULTI DISBURSAL LOAN APPROVED SUCCESSFULLY---------------------------------------"); ArrayList disbursementDetails = (ArrayList) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, this.loanID, "disbursementDetails"); this.disbursementId = (Integer) disbursementDetails.get(0).get("id"); @@ -474,7 +471,7 @@ private String formatExpectedDisbursementDate(String expectedDisbursementDate) { private Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal, List tranches) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanRepaymentRescheduleAtDisbursementTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanRepaymentRescheduleAtDisbursementTest.java index c689faa95c9..ed206d89ffa 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanRepaymentRescheduleAtDisbursementTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanRepaymentRescheduleAtDisbursementTest.java @@ -40,10 +40,12 @@ import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings("rawtypes") public class LoanRepaymentRescheduleAtDisbursementTest { - + private final static Logger LOG = LoggerFactory.getLogger(LoanRepaymentRescheduleAtDisbursementTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private LoanTransactionHelper loanTransactionHelper; @@ -73,7 +75,7 @@ public void testLoanRepaymentRescheduleAtDisbursement(){ // CREATE CLIENT final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014"); - System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + LOG.info("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------" + clientID); // CREATE LOAN MULTIDISBURSAL PRODUCT WITH INTEREST RECALCULATION @@ -102,7 +104,7 @@ public void testLoanRepaymentRescheduleAtDisbursement(){ // VALIDATE THE LOAN STATUS LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount, loanID, approveTranches); @@ -167,7 +169,7 @@ private Integer createLoanProductWithInterestRecalculation(final String repaymen boolean isArrearsBasedOnOriginalSchedule, final Integer recalculationCompoundingFrequencyOnDayType, final Integer recalculationCompoundingFrequencyDayOfWeekType, final Integer recalculationRestFrequencyOnDayType, final Integer recalculationRestFrequencyDayOfWeekType) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); LoanProductTestBuilder builder = new LoanProductTestBuilder() .withPrincipal("10000.00") .withNumberOfRepayments("12") @@ -207,7 +209,7 @@ private Integer applyForLoanApplicationForInterestRecalculation(final Integer cl private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, final Integer loanProductID, final String disbursementDate, final String repaymentStrategy, final List charges, final String graceOnInterestPayment, final String graceOnPrincipalPayment, List tranches) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal("10000.00") // .withLoanTermFrequency("24") // diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanRescheduleRequestTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanRescheduleRequestTest.java index f150da37ab5..5e43b864bfd 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanRescheduleRequestTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanRescheduleRequestTest.java @@ -36,12 +36,15 @@ import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Test the creation, approval and rejection of a loan reschedule request **/ @SuppressWarnings({ "rawtypes" }) public class LoanRescheduleRequestTest { + private final static Logger LOG = LoggerFactory.getLogger(LoanRescheduleRequestTest.class); private ResponseSpecification responseSpec; private ResponseSpecification generalResponseSpec; private RequestSpecification requestSpec; @@ -93,7 +96,7 @@ private void createClientEntity() { * create a new loan product **/ private void createLoanProductEntity() { - System.out.println("---------------------------------CREATING LOAN PRODUCT------------------------------------------"); + LOG.info("---------------------------------CREATING LOAN PRODUCT------------------------------------------"); final String loanProductJSON = new LoanProductTestBuilder() .withPrincipal(loanPrincipalAmount) @@ -103,14 +106,14 @@ private void createLoanProductEntity() { .build(null); this.loanProductId = this.loanTransactionHelper.getLoanProductId(loanProductJSON); - System.out.println("Successfully created loan product (ID: " + this.loanProductId + ")"); + LOG.info("Successfully created loan product (ID: " + this.loanProductId + ")"); } /** * submit a new loan application, approve and disburse the loan **/ private void createLoanEntity() { - System.out.println("---------------------------------NEW LOAN APPLICATION------------------------------------------"); + LOG.info("---------------------------------NEW LOAN APPLICATION------------------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() .withPrincipal(loanPrincipalAmount) @@ -131,7 +134,7 @@ private void createLoanEntity() { this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON); - System.out.println("Sucessfully created loan (ID: " + this.loanId + ")"); + LOG.info("Sucessfully created loan (ID: " + this.loanId + ")"); this.approveLoanApplication(); this.disburseLoan(); @@ -144,7 +147,7 @@ private void approveLoanApplication() { if(this.loanId != null) { this.loanTransactionHelper.approveLoan(this.dateString, this.loanId); - System.out.println("Successfully approved loan (ID: " + this.loanId + ")"); + LOG.info("Successfully approved loan (ID: " + this.loanId + ")"); } } @@ -155,7 +158,7 @@ private void disburseLoan() { if(this.loanId != null) { this.loanTransactionHelper.disburseLoan(this.dateString, this.loanId); - System.out.println("Successfully disbursed loan (ID: " + this.loanId + ")"); + LOG.info("Successfully disbursed loan (ID: " + this.loanId + ")"); } } @@ -163,14 +166,14 @@ private void disburseLoan() { * create new loan reschedule request **/ private void createLoanRescheduleRequest() { - System.out.println("---------------------------------CREATING LOAN RESCHEDULE REQUEST------------------------------------------"); + LOG.info("---------------------------------CREATING LOAN RESCHEDULE REQUEST------------------------------------------"); final String requestJSON = new LoanRescheduleRequestTestBuilder().build(this.loanId.toString()); this.loanRescheduleRequestId = this.loanRescheduleRequestHelper.createLoanRescheduleRequest(requestJSON); this.loanRescheduleRequestHelper.verifyCreationOfLoanRescheduleRequest(this.loanRescheduleRequestId); - System.out.println("Successfully created loan reschedule request (ID: " + this.loanRescheduleRequestId + ")"); + LOG.info("Successfully created loan reschedule request (ID: " + this.loanRescheduleRequestId + ")"); } @Test @@ -182,7 +185,7 @@ public void testCreateLoanRescheduleRequest() { public void testRejectLoanRescheduleRequest() { this.createLoanRescheduleRequest(); - System.out.println("-----------------------------REJECTING LOAN RESCHEDULE REQUEST--------------------------"); + LOG.info("-----------------------------REJECTING LOAN RESCHEDULE REQUEST--------------------------"); final String requestJSON = new LoanRescheduleRequestTestBuilder().getRejectLoanRescheduleRequestJSON(); this.loanRescheduleRequestHelper.rejectLoanRescheduleRequest(this.loanRescheduleRequestId, requestJSON); @@ -190,14 +193,14 @@ public void testRejectLoanRescheduleRequest() { final HashMap response = (HashMap) this.loanRescheduleRequestHelper.getLoanRescheduleRequest(loanRescheduleRequestId, "statusEnum"); assertTrue((Boolean)response.get("rejected")); - System.out.println("Successfully rejected loan reschedule request (ID: " + this.loanRescheduleRequestId + ")"); + LOG.info("Successfully rejected loan reschedule request (ID: " + this.loanRescheduleRequestId + ")"); } @Test public void testApproveLoanRescheduleRequest() { this.createLoanRescheduleRequest(); - System.out.println("-----------------------------APPROVING LOAN RESCHEDULE REQUEST--------------------------"); + LOG.info("-----------------------------APPROVING LOAN RESCHEDULE REQUEST--------------------------"); final String requestJSON = new LoanRescheduleRequestTestBuilder().getApproveLoanRescheduleRequestJSON(); this.loanRescheduleRequestHelper.approveLoanRescheduleRequest(this.loanRescheduleRequestId, requestJSON); @@ -212,6 +215,6 @@ public void testApproveLoanRescheduleRequest() { assertEquals("NUMBER OF REPAYMENTS SHOULD BE 16, NOT 12", "12", numberOfRepayments.toString()); assertEquals("TOTAL EXPECTED REPAYMENT MUST BE EQUAL TO 118000.0", "118000.0", totalExpectedRepayment.toString()); - System.out.println("Successfully approved loan reschedule request (ID: " + this.loanRescheduleRequestId + ")"); + LOG.info("Successfully approved loan reschedule request (ID: " + this.loanRescheduleRequestId + ")"); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanReschedulingWithinCenterTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanReschedulingWithinCenterTest.java index ce0d7def028..46e52c697f7 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanReschedulingWithinCenterTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanReschedulingWithinCenterTest.java @@ -52,9 +52,11 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class LoanReschedulingWithinCenterTest { - + private final static Logger LOG = LoggerFactory.getLogger(LoanReschedulingWithinCenterTest.class); private RequestSpecification requestSpec; private ResponseSpecification responseSpec; private LoanTransactionHelper loanTransactionHelper; @@ -133,7 +135,7 @@ public void testCenterReschedulingLoansWithInterestRecalculationEnabled() { loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanId); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - System.out.println("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------"); + LOG.info("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------"); Calendar todaysdate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); todaysdate.add(Calendar.DAY_OF_MONTH, 14); String oldMeetingDate = dateFormat.format(todaysdate.getTime()); @@ -181,7 +183,7 @@ private Integer createCalendarMeeting(Integer centerId) { Integer calendarId = CalendarHelper.createMeetingForGroup(this.requestSpec, this.responseSpec, centerId, startDate, frequency, interval, repeatsOnDay.toString()); - System.out.println("calendarId " + calendarId); + LOG.info("calendarId " + calendarId); return calendarId; } @@ -253,7 +255,7 @@ public void testCenterReschedulingMultiTrancheLoansWithInterestRecalculationEnab // VALIDATE THE LOAN STATUS LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount, loanID, approveTranches); @@ -265,7 +267,7 @@ public void testCenterReschedulingMultiTrancheLoansWithInterestRecalculationEnab this.loanTransactionHelper.disburseLoan(disbursementDate, loanID); loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); - System.out.println("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------"); + LOG.info("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------"); Calendar todaysdate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); todaysdate.add(Calendar.DAY_OF_MONTH, 14); String oldMeetingDate = dateFormat.format(todaysdate.getTime()); @@ -312,7 +314,7 @@ private Integer createLoanProductWithInterestRecalculation(final String repaymen final Integer recalculationCompoundingFrequencyOnDayType, final Integer recalculationCompoundingFrequencyDayOfWeekType, final Integer recalculationRestFrequencyOnDayType, final Integer recalculationRestFrequencyDayOfWeekType) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); LoanProductTestBuilder builder = new LoanProductTestBuilder() .withPrincipal("10000.00") .withNumberOfRepayments("12") @@ -359,7 +361,7 @@ private Integer applyForLoanApplicationForInterestRecalculation(final Integer cl final Integer loanProductID, final String disbursementDate, final String restStartDate, final String compoundingStartDate, final String repaymentStrategy, final List charges, final String graceOnInterestPayment, final String graceOnPrincipalPayment, List tranches) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal("10000.00") // .withLoanTermFrequency("24") // diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanWithWaiveInterestAndWriteOffIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanWithWaiveInterestAndWriteOffIntegrationTest.java index 06f5f04ccf5..7040b702c53 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanWithWaiveInterestAndWriteOffIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanWithWaiveInterestAndWriteOffIntegrationTest.java @@ -33,6 +33,8 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Client Loan Integration Test for checking Loan Disbursement with Waive @@ -40,7 +42,7 @@ */ @SuppressWarnings({ "rawtypes" }) public class LoanWithWaiveInterestAndWriteOffIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(LoanWithWaiveInterestAndWriteOffIntegrationTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; @@ -74,7 +76,7 @@ public void checkClientLoanCreateAndDisburseFlow() { HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan("28 September 2010", loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); @@ -83,14 +85,14 @@ public void checkClientLoanCreateAndDisburseFlow() { loanStatusHashMap = this.loanTransactionHelper.undoApproval(loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------RE-APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------RE-APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan("1 October 2010", loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); // DISBURSE loanStatusHashMap = this.loanTransactionHelper.disburseLoan(this.DISBURSEMENT_DATE, loanID); - System.out.println("DISBURSE " + loanStatusHashMap); + LOG.info("DISBURSE " + loanStatusHashMap); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); // PERFORM REPAYMENTS AND CHECK LOAN STATUS @@ -103,7 +105,7 @@ public void checkClientLoanCreateAndDisburseFlow() { // DIBURSE AGAIN loanStatusHashMap = this.loanTransactionHelper.disburseLoan(this.DISBURSEMENT_DATE, loanID); - System.out.println("DISBURSE " + loanStatusHashMap); + LOG.info("DISBURSE " + loanStatusHashMap); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); // MAKE REPAYMENTS @@ -142,14 +144,14 @@ public void checkClientLoan_WRITTEN_OFF() { HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan("28 September 2010", loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); // DISBURSE loanStatusHashMap = this.loanTransactionHelper.disburseLoan(this.DISBURSEMENT_DATE, loanID); - System.out.println("DISBURSE " + loanStatusHashMap); + LOG.info("DISBURSE " + loanStatusHashMap); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); // MAKE REPAYMENTS @@ -179,7 +181,7 @@ public void checkClientLoan_WRITTEN_OFF() { } private Integer createLoanProduct() { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(this.LP_PRINCIPAL).withRepaymentTypeAsMonth() .withRepaymentAfterEvery(this.LP_REPAYMENT_PERIOD).withNumberOfRepayments(this.LP_REPAYMENTS).withRepaymentTypeAsMonth() .withinterestRatePerPeriod(this.LP_INTEREST_RATE).withInterestRateFrequencyTypeAsMonths() @@ -189,7 +191,7 @@ private Integer createLoanProduct() { } private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder().withPrincipal(this.PRINCIPAL) .withLoanTermFrequency(this.LOAN_TERM_FREQUENCY).withLoanTermFrequencyAsMonths() .withNumberOfRepayments(this.NUMBER_OF_REPAYMENTS).withRepaymentEveryAfter(this.REPAYMENT_PERIOD) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/NotificationApiTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/NotificationApiTest.java index 3a49f5e7255..76c4b9a26d4 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/NotificationApiTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/NotificationApiTest.java @@ -29,9 +29,11 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class NotificationApiTest { - + private final static Logger LOG = LoggerFactory.getLogger(NotificationApiTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; @@ -48,7 +50,7 @@ public void setUp() { public void testNotificationRetrieval() { HashMap response = (HashMap) NotificationHelper.getNotifications(this.requestSpec, this.responseSpec, ""); - System.out.println("Response : " + response.toString()); + LOG.info("Response : " + response.toString()); Assert.assertNotNull(response); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/PasswordPreferencesIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/PasswordPreferencesIntegrationTest.java index 980d2c7c9ee..93773244b54 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/PasswordPreferencesIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/PasswordPreferencesIntegrationTest.java @@ -32,10 +32,12 @@ import org.apache.fineract.integrationtests.common.Utils; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked" }) public class PasswordPreferencesIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(PasswordPreferencesIntegrationTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private ResponseSpecification generalResponseSpec; @@ -60,7 +62,7 @@ public void updatePasswordPreferences() { private void validateIfThePasswordIsUpdated(String validationPolicyId){ Integer id = PasswordPreferencesHelper.getActivePasswordPreference(requestSpec, responseSpec); assertEquals(validationPolicyId, id.toString()); - System.out.println("---------------------------------PASSWORD PREFERENCE VALIDATED SUCCESSFULLY-----------------------------------------"); + LOG.info("---------------------------------PASSWORD PREFERENCE VALIDATED SUCCESSFULLY-----------------------------------------"); } 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 b88f20b9504..494db47f1ff 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 @@ -61,10 +61,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "unused", "rawtypes", "unchecked", "static-access" }) public class RecurringDepositTest { - + private final static Logger LOG = LoggerFactory.getLogger(RecurringDepositTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private RecurringDepositProductHelper recurringDepositProductHelper; @@ -1417,7 +1419,6 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_365_Da Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); @@ -1429,7 +1430,6 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_365_Da decimalFormat.applyPattern("."); principal = new Float(decimalFormat.format(principal)); maturityAmount = new Float(decimalFormat.format(maturityAmount)); - System.out.println(principal); Assert.assertEquals("Verifying Maturity amount for Recurring Deposit Account", principal, maturityAmount); } @@ -1502,7 +1502,6 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_360_Da Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); @@ -1514,7 +1513,6 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_360_Da decimalFormat.applyPattern("."); principal = new Float(decimalFormat.format(principal)); maturityAmount = new Float(decimalFormat.format(maturityAmount)); - System.out.println(principal); Assert.assertEquals("Verifying Maturity amount for Recurring Deposit Account", principal, maturityAmount); } @@ -1585,7 +1583,7 @@ public void testPostInterestForRecurringDeposit() { Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); @@ -1598,7 +1596,6 @@ public void testPostInterestForRecurringDeposit() { principal += interestToBePosted; Float expectedBalanceAfter = new Float(decimalFormat.format(principal)); - System.out.println(expectedBalanceAfter); Integer transactionIdForPostInterest = this.recurringDepositAccountHelper .postInterestForRecurringDeposit(recurringDepositAccountId); @@ -1693,7 +1690,7 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_365_Day interestRate -= preClosurePenalInterestRate; double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Calendar calendar = Calendar.getInstance(); @@ -1704,7 +1701,7 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_365_Day Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth + depositAmount; calendar.add(Calendar.DATE, daysInMonth); - System.out.println(monthDayFormat.format(calendar.getTime())); + LOG.info(monthDayFormat.format(calendar.getTime())); EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(calendar.getTime()); Integer transactionIdForDeposit = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, @@ -1713,9 +1710,9 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_365_Day currentDate = currentDate - 1; interestPerMonth = (float) (interestPerDay * principal * currentDate); - System.out.println("IPM = " + interestPerMonth); + LOG.info("IPM = " + interestPerMonth); principal += interestPerMonth; - System.out.println("principal = " + principal); + LOG.info("principal = " + principal); HashMap recurringDepositPrematureData = this.recurringDepositAccountHelper.calculatePrematureAmountForRecurringDeposit( recurringDepositAccountId, CLOSED_ON_DATE); @@ -1825,7 +1822,7 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_360_Day interestRate -= preClosurePenalInterestRate; double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Calendar calendar = Calendar.getInstance(); @@ -1836,7 +1833,7 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_360_Day Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth + depositAmount; calendar.add(Calendar.DATE, daysInMonth); - System.out.println(monthDayFormat.format(calendar.getTime())); + LOG.info(monthDayFormat.format(calendar.getTime())); EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(calendar.getTime()); Integer transactionIdForDeposit = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, @@ -1845,9 +1842,9 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_360_Day currentDate = currentDate - 1; interestPerMonth = (float) (interestPerDay * principal * currentDate); - System.out.println("IPM = " + interestPerMonth); + LOG.info("IPM = " + interestPerMonth); principal += interestPerMonth; - System.out.println("principal = " + principal); + LOG.info("principal = " + principal); HashMap recurringDepositPrematureData = this.recurringDepositAccountHelper.calculatePrematureAmountForRecurringDeposit( recurringDepositAccountId, CLOSED_ON_DATE); @@ -1964,7 +1961,7 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W interestRate -= preClosurePenalInterestRate; double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Calendar calendar = Calendar.getInstance(); @@ -1976,7 +1973,7 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth + depositAmount; calendar.add(Calendar.DATE, daysInMonth); - System.out.println(monthDayFormat.format(calendar.getTime())); + LOG.info(monthDayFormat.format(calendar.getTime())); EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(calendar.getTime()); Integer transactionIdForDeposit = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, @@ -1985,9 +1982,9 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W currentDate = currentDate - 1; interestPerMonth = (float) (interestPerDay * principal * currentDate); - System.out.println("IPM = " + interestPerMonth); + LOG.info("IPM = " + interestPerMonth); principal += interestPerMonth; - System.out.println("principal = " + principal); + LOG.info("principal = " + principal); HashMap recurringDepositPrematureData = this.recurringDepositAccountHelper.calculatePrematureAmountForRecurringDeposit( recurringDepositAccountId, CLOSED_ON_DATE); @@ -2109,7 +2106,7 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W interestRate -= preClosurePenalInterestRate; double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Calendar calendar = Calendar.getInstance(); @@ -2121,7 +2118,7 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth + depositAmount; calendar.add(Calendar.DATE, daysInMonth); - System.out.println(monthDayFormat.format(calendar.getTime())); + LOG.info(monthDayFormat.format(calendar.getTime())); EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(calendar.getTime()); Integer newTransactionIdForDeposit = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, @@ -2130,9 +2127,9 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W currentDate = currentDate - 1; interestPerMonth = (float) (interestPerDay * principal * currentDate); - System.out.println("IPM = " + interestPerMonth); + LOG.info("IPM = " + interestPerMonth); principal += interestPerMonth; - System.out.println("principal = " + principal); + LOG.info("principal = " + principal); HashMap recurringDepositPrematureData = this.recurringDepositAccountHelper.calculatePrematureAmountForRecurringDeposit( recurringDepositAccountId, CLOSED_ON_DATE); @@ -2224,7 +2221,6 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_365_Days Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); @@ -2236,7 +2232,6 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_365_Days decimalFormat.applyPattern("."); principal = new Float(decimalFormat.format(principal)); maturityAmount = new Float(decimalFormat.format(maturityAmount)); - System.out.println(principal); Assert.assertEquals("Verifying Maturity amount for Recurring Deposit Account", principal, maturityAmount); } @@ -2309,7 +2304,6 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_360_Days Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); @@ -2321,7 +2315,6 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_360_Days decimalFormat.applyPattern("."); principal = new Float(decimalFormat.format(principal)); maturityAmount = new Float(decimalFormat.format(maturityAmount)); - System.out.println(principal); Assert.assertEquals("Verifying Maturity amount for Recurring Deposit Account", principal, maturityAmount); } @@ -2352,7 +2345,7 @@ public void testRecurringDepositWithBi_AnnualCompoundingAndPosting_365_Days() { Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2400,7 +2393,7 @@ public void testRecurringDepositWithBi_AnnualCompoundingAndPosting_365_Days() { Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount, @@ -2443,7 +2436,7 @@ public void testRecurringDepositWithBi_AnnualCompoundingAndPosting_360_Days() { Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2491,7 +2484,7 @@ public void testRecurringDepositWithBi_AnnualCompoundingAndPosting_360_Days() { Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount, @@ -2533,7 +2526,7 @@ public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_365_Day Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2582,7 +2575,7 @@ public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_365_Day Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount, @@ -2624,7 +2617,7 @@ public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_360_Day Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2673,7 +2666,7 @@ public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_360_Day Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount, @@ -2716,7 +2709,7 @@ public void testRecurringDepositQuarterlyCompoundingAndQuarterlyPosting_365_Days Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2764,7 +2757,7 @@ public void testRecurringDepositQuarterlyCompoundingAndQuarterlyPosting_365_Days Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount, @@ -2807,7 +2800,7 @@ public void testRecurringDepositQuarterlyCompoundingAndQuarterlyPosting_360_Days Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); - System.out.println(dateFormat.format(todaysDate.getTime())); + LOG.info(dateFormat.format(todaysDate.getTime())); final String VALID_FROM = dateFormat.format(todaysDate.getTime()); final String VALID_TO = null; @@ -2855,7 +2848,7 @@ public void testRecurringDepositQuarterlyCompoundingAndQuarterlyPosting_360_Days Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod); double interestRateInFraction = (interestRate / 100); double perDay = (double) 1 / (daysInYear); - System.out.println("per day = " + perDay); + LOG.info("per day = " + perDay); double interestPerDay = interestRateInFraction * perDay; principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount, @@ -3037,7 +3030,7 @@ private void testFixedDepositAccountForInterestRate(final String chartToUse, fin private Integer createRecurringDepositProduct(final String validFrom, final String validTo, final String accountingRule, Account... accounts) { - System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------"); RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec); if (accountingRule.equals(CASH_BASED)) { recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsCashBased(accounts); @@ -3050,7 +3043,7 @@ private Integer createRecurringDepositProduct(final String validFrom, final Stri private Integer createRecurringDepositProductWithWithHoldTax(final String validFrom, final String validTo,final String taxGroupId, final String accountingRule, Account... accounts) { - System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------"); RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec); if (accountingRule.equals(CASH_BASED)) { recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsCashBased(accounts); @@ -3065,7 +3058,7 @@ private Integer createRecurringDepositProductWithWithHoldTax(final String validF private Integer createRecurringDepositProduct(final String validFrom, final String validTo, final String accountingRule, final String chartToBePicked, Account... accounts) { - System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------"); RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec); if (accountingRule.equals(CASH_BASED)) { recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsCashBased(accounts); @@ -3095,7 +3088,7 @@ private Integer createRecurringDepositProduct(final String validFrom, final Stri private Integer applyForRecurringDepositApplication(final String clientID, final String productID, final String validFrom, final String validTo, final String submittedOnDate, final String penalInterestType, final String expectedFirstDepositOnDate) { - System.out.println("--------------------------------APPLYING FOR RECURRING DEPOSIT ACCOUNT --------------------------------"); + LOG.info("--------------------------------APPLYING FOR RECURRING DEPOSIT ACCOUNT --------------------------------"); final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec) .withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate) .build(clientID, productID, penalInterestType); @@ -3106,7 +3099,7 @@ private Integer applyForRecurringDepositApplication(final String clientID, final private Integer applyForRecurringDepositApplication(final String clientID, final String productID, final String validFrom, final String validTo, final String submittedOnDate, final String penalInterestType, final String expectedFirstDepositOnDate, final String depositAmount, final String depositPeriod) { - System.out.println("--------------------------------APPLYING FOR RECURRING DEPOSIT ACCOUNT --------------------------------"); + LOG.info("--------------------------------APPLYING FOR RECURRING DEPOSIT ACCOUNT --------------------------------"); final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec) .withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate) .withDepositPeriod(depositPeriod).withMandatoryDepositAmount(depositAmount).build(clientID, productID, penalInterestType); @@ -3116,7 +3109,7 @@ private Integer applyForRecurringDepositApplication(final String clientID, final private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String minOpenningBalance, final String accountingRule, Account... accounts) { - System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); SavingsProductHelper savingsProductHelper = new SavingsProductHelper(); if (accountingRule.equals(CASH_BASED)) { savingsProductHelper = savingsProductHelper.withAccountingRuleAsCashBased(accounts); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RolesTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RolesTest.java index a03f8f177a4..6464c832bd3 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RolesTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RolesTest.java @@ -34,9 +34,11 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RolesTest { - + private final static Logger LOG = LoggerFactory.getLogger(RolesTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; @@ -52,11 +54,11 @@ public void setup() { @Test public void testCreateRolesStatus() { - System.out.println("---------------------------------CREATING A ROLE---------------------------------------------"); + LOG.info("---------------------------------CREATING A ROLE---------------------------------------------"); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); Assert.assertNotNull(roleId); - System.out.println("--------------------------------- Getting ROLE -------------------------------"); + LOG.info("--------------------------------- Getting ROLE -------------------------------"); HashMap role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); assertEquals((Integer) role.get("id"), roleId); @@ -66,15 +68,15 @@ public void testCreateRolesStatus() { @Test public void testDisableRolesStatus() { - System.out.println("---------------------------------CREATING A ROLE---------------------------------------------"); + LOG.info("---------------------------------CREATING A ROLE---------------------------------------------"); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); Assert.assertNotNull(roleId); - System.out.println("--------------------------------- Getting ROLE -------------------------------"); + LOG.info("--------------------------------- Getting ROLE -------------------------------"); HashMap role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); assertEquals((Integer) role.get("id"), roleId); - System.out.println("--------------------------------- DISABLING ROLE -------------------------------"); + LOG.info("--------------------------------- DISABLING ROLE -------------------------------"); final Integer disableRoleId = RolesHelper.disableRole(this.requestSpec, this.responseSpec, roleId); assertEquals(disableRoleId, roleId); role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); @@ -87,22 +89,22 @@ public void testDisableRolesStatus() { @Test public void testEnableRolesStatus() { - System.out.println("---------------------------------CREATING A ROLE---------------------------------------------"); + LOG.info("---------------------------------CREATING A ROLE---------------------------------------------"); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); Assert.assertNotNull(roleId); - System.out.println("--------------------------------- Getting ROLE -------------------------------"); + LOG.info("--------------------------------- Getting ROLE -------------------------------"); HashMap role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); assertEquals((Integer) role.get("id"), roleId); - System.out.println("--------------------------------- DISABLING ROLE -------------------------------"); + LOG.info("--------------------------------- DISABLING ROLE -------------------------------"); final Integer disableRoleId = RolesHelper.disableRole(this.requestSpec, this.responseSpec, roleId); assertEquals(disableRoleId, roleId); role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); assertEquals((Integer) role.get("id"), roleId); assertEquals((Boolean) role.get("disabled"), true); - System.out.println("--------------------------------- ENABLING ROLE -------------------------------"); + LOG.info("--------------------------------- ENABLING ROLE -------------------------------"); final Integer enableRoleId = RolesHelper.enableRole(this.requestSpec, this.responseSpec, roleId); assertEquals(enableRoleId, roleId); role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); @@ -115,15 +117,15 @@ public void testEnableRolesStatus() { @Test public void testDeleteRoleStatus() { - System.out.println("-------------------------------- CREATING A ROLE---------------------------------------------"); + LOG.info("-------------------------------- CREATING A ROLE---------------------------------------------"); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); Assert.assertNotNull(roleId); - System.out.println("--------------------------------- Getting ROLE -------------------------------"); + LOG.info("--------------------------------- Getting ROLE -------------------------------"); HashMap role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); assertEquals((Integer) role.get("id"), roleId); - System.out.println("--------------------------------- DELETE ROLE -------------------------------"); + LOG.info("--------------------------------- DELETE ROLE -------------------------------"); final Integer deleteRoleId = RolesHelper.deleteRole(this.requestSpec, this.responseSpec, roleId); assertEquals(deleteRoleId, roleId); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTest.java index bac4d42ef81..5929c9558db 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTest.java @@ -30,10 +30,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked", "static-access" }) public class SchedulerJobsTest { - + private final static Logger LOG = LoggerFactory.getLogger(SchedulerJobsTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private ResponseSpecification responseSpecForSchedulerJob; @@ -106,7 +108,7 @@ public void testSchedulerJobs() throws InterruptedException { Thread.sleep(15000); schedulerJob = this.schedulerJobHelper.getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString()); Assert.assertNotNull(schedulerJob); - System.out.println("Job " +jobId.toString() +" is Still Running"); + LOG.info("Job " +jobId.toString() +" is Still Running"); } ArrayList jobHistoryData = this.schedulerJobHelper.getSchedulerJobHistory(this.requestSpec, this.responseSpec, jobId.toString()); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java index 2700d148b3b..09a4ac709e6 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java @@ -64,10 +64,12 @@ import org.junit.Before; import org.junit.Ignore; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "unused", "unchecked", "rawtypes", "static-access", "cast" }) public class SchedulerJobsTestResults { - + private final static Logger LOG = LoggerFactory.getLogger(SchedulerJobsTestResults.class); private static final String FROM_ACCOUNT_TYPE_LOAN = "1"; private static final String FROM_ACCOUNT_TYPE_SAVINGS = "2"; private static final String TO_ACCOUNT_TYPE_LOAN = "1"; @@ -909,7 +911,7 @@ public void testInterestTransferForSavings() throws InterruptedException { private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String minOpenningBalance) { - System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); SavingsProductHelper savingsProductHelper = new SavingsProductHelper(); final String savingsProductJSON = savingsProductHelper // .withInterestCompoundingPeriodTypeAsDaily() // @@ -920,7 +922,7 @@ private Integer createSavingsProduct(final RequestSpecification requestSpec, fin } private static Integer createSavingsProduct(final String minOpenningBalance, final Account... accounts) { - System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); final String savingsProductJSON = new SavingsProductHelper().withInterestCompoundingPeriodTypeAsDaily() // .withInterestPostingPeriodTypeAsQuarterly() // .withInterestCalculationPeriodTypeAsDailyBalance() // @@ -929,7 +931,7 @@ private static Integer createSavingsProduct(final String minOpenningBalance, fin } private Integer createLoanProduct(final String chargeId) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); final String loanProductJSON = new LoanProductTestBuilder() // .withPrincipal("15,000.00") // .withNumberOfRepayments("4") // @@ -944,7 +946,7 @@ private Integer createLoanProduct(final String chargeId) { } private Integer applyForLoanApplication(final String clientID, final String loanProductID, final String savingsID) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal("15,000.00") // .withLoanTermFrequency("4") // @@ -963,7 +965,7 @@ private Integer applyForLoanApplication(final String clientID, final String loan } private Integer createFixedDepositProduct(final String validFrom, final String validTo, Account... accounts) { - System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------"); FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec); final String fixedDepositProductJSON = fixedDepositProductHelper // // .withAccountingRuleAsCashBased(accounts) @@ -975,7 +977,7 @@ private Integer createFixedDepositProduct(final String validFrom, final String v private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String validFrom, final String validTo, final String submittedOnDate, final String penalInterestType, String savingsId, final boolean transferInterest, final FixedDepositAccountHelper fixedDepositAccountHelper) { - System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------"); + LOG.info("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------"); final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) // .withSubmittedOnDate(submittedOnDate).withSavings(savingsId).transferInterest(true) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SkipRepaymentOnMonthFirstTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SkipRepaymentOnMonthFirstTest.java index 98a4dc968d5..bfad494a6e9 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SkipRepaymentOnMonthFirstTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SkipRepaymentOnMonthFirstTest.java @@ -40,10 +40,12 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "static-access", "rawtypes", "unchecked", "deprecation" }) public class SkipRepaymentOnMonthFirstTest { - + private final static Logger LOG = LoggerFactory.getLogger(SkipRepaymentOnMonthFirstTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private GlobalConfigurationHelper globalConfigurationHelper; @@ -102,10 +104,8 @@ public void checkRepaymentSkipOnFirstDayOfMonth() { final String interval = "1"; //Every One Moth Integer calendarID = calendarHelper.createMeetingForGroup(requestSpec, responseSpec, groupID, startDate, frequency, interval, null); - System.out.println("caladerId --------------------" + calendarID); final Integer loanProductID = createLoanProduct(); final Integer loanID = applyForLoanApplication(groupID, loanProductID, calendarID, clientID); - System.out.println("loanID----" + loanID); final ArrayList loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); verifyLoanRepaymentSchedule(loanSchedule); @@ -113,7 +113,7 @@ public void checkRepaymentSkipOnFirstDayOfMonth() { } private Integer createLoanProduct() { - System.out.println( + LOG.info( "------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); final String loanProductJSON = new LoanProductTestBuilder() // .withPrincipal("12,000.00") // @@ -130,7 +130,7 @@ private Integer createLoanProduct() { private Integer applyForLoanApplication(final Integer groupID, final Integer loanProductID, Integer calendarID, Integer clientID) { - System.out.println( + LOG.info( "--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal("12,000.00") // @@ -147,27 +147,22 @@ private Integer applyForLoanApplication(final Integer groupID, final Integer loa .withCalendarID(calendarID.toString()) // .withSubmittedOnDate("01 October 2011") // .withLoanType("jlg").build(clientID.toString(), groupID.toString(), loanProductID.toString(), null); - System.out.println(loanApplicationJSON); return this.loanTransactionHelper.getLoanId(loanApplicationJSON); } private void verifyLoanRepaymentSchedule(final ArrayList loanSchedule) { - System.out.println("--------------------VERIFYING THE REPAYMENT DATE--------------------------"); + LOG.info("--------------------VERIFYING THE REPAYMENT DATE--------------------------"); assertEquals("Checking for Repayment Date for 1st Month", new ArrayList<>(Arrays.asList(2011, 10, 15)), loanSchedule.get(1).get("dueDate")); - System.out.println("Repayment Date for 1st Month--" + loanSchedule.get(1).get("dueDate")); assertEquals("Checking for Repayment Date for 2nd Month", new ArrayList<>(Arrays.asList(2011, 11, 15)), loanSchedule.get(2).get("dueDate")); - System.out.println("Repayment Date for 2nd Month--" + loanSchedule.get(2).get("dueDate")); assertEquals("Checking for Repayment Date for 3rd Month", new ArrayList<>(Arrays.asList(2011, 12, 15)), loanSchedule.get(3).get("dueDate")); - System.out.println("Repayment Date for 3rd Month--" + loanSchedule.get(3).get("dueDate")); assertEquals("Checking for Repayment Date for 4th Month", new ArrayList<>(Arrays.asList(2012, 1, 15)), loanSchedule.get(4).get("dueDate")); - System.out.println("Repayment Date for 4th Month--" + loanSchedule.get(4).get("dueDate")); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java index 5932afa802b..5649a51a402 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java @@ -36,10 +36,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UserAdministrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(UserAdministrationTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private List transientUsers = new ArrayList<>(); @@ -79,8 +81,6 @@ public void testCreateNewUserBlocksDuplicateUsername() { final List errors = (List) UserHelper.createUser(this.requestSpec, expectStatusCode(403), roleId, staffId, "alphabet", "errors"); Map reason = (Map) errors.get(0); - System.out.println("Reason: " + reason.get("defaultUserMessage")); - System.out.println("Code: " + reason.get("userMessageGlobalisationCode")); Assert.assertEquals("User with username alphabet already exists.", reason.get("defaultUserMessage")); Assert.assertEquals("error.msg.user.duplicate.username", reason.get("userMessageGlobalisationCode")); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/XBRLIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/XBRLIntegrationTest.java index 1072b91f099..fb823ca5838 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/XBRLIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/XBRLIntegrationTest.java @@ -31,10 +31,12 @@ import org.apache.fineract.integrationtests.common.xbrl.XBRLIntegrationTestHelper; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked" }) public class XBRLIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(XBRLIntegrationTest.class); private RequestSpecification requestSpec; private ResponseSpecification responseSpec; @@ -57,7 +59,7 @@ public void shouldRetrieveTaxonomyList() { } private void verifyTaxonomyList(final ArrayList taxonomyList) { - System.out.println("--------------------VERIFYING TAXONOMY LIST--------------------------"); + LOG.info("--------------------VERIFYING TAXONOMY LIST--------------------------"); assertEquals("Checking for the 1st taxonomy", "AdministrativeExpense", taxonomyList.get(0).get("name")); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java index 0d111ed7688..b7d4518e2c1 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java @@ -28,6 +28,8 @@ import org.apache.fineract.batch.domain.BatchRequest; import org.apache.fineract.batch.domain.BatchResponse; import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Helper class for {@link org.apache.fineract.integrationtests.BatchApiTest}. It @@ -39,7 +41,7 @@ * @see org.apache.fineract.integrationtests.BatchApiTest */ public class BatchHelper { - + private final static Logger LOG = LoggerFactory.getLogger(BatchHelper.class); private static final String BATCH_API_URL = "/fineract-provider/api/v1/batches?" + Utils.TENANT_IDENTIFIER; private static final String BATCH_API_URL_EXT = BATCH_API_URL + "&enclosingTransaction=true"; @@ -422,7 +424,7 @@ public static BatchRequest repayLoanRequest(final Long requestId, final Long ref */ public static void verifyClientCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String externalId) { - System.out.println("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); final String CLIENT_URL = "/fineract-provider/api/v1/clients?externalId=" + externalId + "&" + Utils.TENANT_IDENTIFIER; final Integer responseRecords = Utils.performServerGet(requestSpec, responseSpec, CLIENT_URL, "totalFilteredRecords"); Assert.assertEquals("No records found with given externalId", (long) responseRecords, (long) 0); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java index e514b8ec0b1..547f53feec4 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java @@ -25,23 +25,24 @@ import com.jayway.restassured.specification.RequestSpecification; import com.jayway.restassured.specification.ResponseSpecification; import java.util.HashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class CalendarHelper { - + private final static Logger LOG = LoggerFactory.getLogger(CalendarHelper.class); private static final String BASE_URL = "/fineract-provider/api/v1/"; private static final String PARENT_ENTITY_NAME = "groups/"; private static final String ENITY_NAME = "/calendars"; private static final String Center_Entity = "centers/"; private static final String Edit_Calendar = "editcalendarbasedonmeetingdates/"; - public static Integer createMeetingCalendarForGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer groupId, final String startDate, final String frequency, final String interval, final String repeatsOnDay) { - System.out.println("---------------------------------CREATING A MEETING CALENDAR FOR THE GROUP------------------------------"); + LOG.info("---------------------------------CREATING A MEETING CALENDAR FOR THE GROUP------------------------------"); final String CALENDAR_RESOURCE_URL = BASE_URL + PARENT_ENTITY_NAME + groupId + ENITY_NAME + "?" + Utils.TENANT_IDENTIFIER; - System.out.println(CALENDAR_RESOURCE_URL); + LOG.info(CALENDAR_RESOURCE_URL); return Utils.performServerPost(requestSpec, responseSpec, CALENDAR_RESOURCE_URL, getTestCalendarAsJSON(frequency, interval, repeatsOnDay, startDate), "resourceId"); @@ -51,11 +52,11 @@ public static Integer updateMeetingCalendarForGroup(final RequestSpecification r final Integer groupId, String calendarID, final String startDate, final String frequency, final String interval, final String repeatsOnDay) { - System.out.println("---------------------------------UPDATING A MEETING CALENDAR FOR THE GROUP------------------------------"); + LOG.info("---------------------------------UPDATING A MEETING CALENDAR FOR THE GROUP------------------------------"); final String CALENDAR_RESOURCE_URL = BASE_URL + PARENT_ENTITY_NAME + groupId + ENITY_NAME + "/" + calendarID; - System.out.println(CALENDAR_RESOURCE_URL); + LOG.info(CALENDAR_RESOURCE_URL); // TODO: check that resource id indeed exists in calendar update put. return Utils.performServerPut(requestSpec, responseSpec, CALENDAR_RESOURCE_URL, getTestCalendarAsJSON(frequency, interval, repeatsOnDay, startDate), "resourceId"); @@ -74,13 +75,13 @@ public static String getTestCalendarAsJSON(final String frequency, final String map.put("title", Utils.randomNameGenerator("groups_CollectionMeeting", 4)); map.put("typeId", "1"); map.put("startDate", startDate); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static void verifyCalendarCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedGroupId, final Integer generatedCalendarId) { - System.out.println("------------------------------CHECK CALENDAR DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK CALENDAR DETAILS------------------------------------\n"); final String CLIENT_URL = "/fineract-provider/api/v1/groups/" + generatedGroupId + "?associations=all&" + Utils.TENANT_IDENTIFIER; final String responseCalendarDetailsinJSON = Utils.performServerGet(requestSpec, responseSpec, CLIENT_URL, "collectionMeetingCalendar"); @@ -91,11 +92,11 @@ public static void verifyCalendarCreatedOnServer(final RequestSpecification requ public static Integer createMeetingForGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer groupId, final String startDate, final String frequency, final String interval, final String repeatsOnDay) { - System.out.println("---------------------------------CREATING A MEETING CALENDAR FOR THE GROUP------------------------------"); + LOG.info("---------------------------------CREATING A MEETING CALENDAR FOR THE GROUP------------------------------"); final String CALENDAR_RESOURCE_URL = BASE_URL + Center_Entity + groupId + ENITY_NAME + "?" + Utils.TENANT_IDENTIFIER; - System.out.println(CALENDAR_RESOURCE_URL); + LOG.info(CALENDAR_RESOURCE_URL); return Utils.performServerPost(requestSpec, responseSpec, CALENDAR_RESOURCE_URL, getTestCalendarAsJSON(frequency, interval, repeatsOnDay, startDate), "resourceId"); @@ -104,12 +105,12 @@ public static Integer createMeetingForGroup(final RequestSpecification requestSp public static Integer updateMeetingCalendarForCenter(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, Integer centerId, String calendarID, String oldDate, String startDate) { - System.out.println("---------------------------------UPADATING A MEETING CALENDAR FOR THE CENTER------------------------------"); + LOG.info("---------------------------------UPADATING A MEETING CALENDAR FOR THE CENTER------------------------------"); final String CALENDAR_RESOURCE_URL = BASE_URL + Center_Entity + centerId + ENITY_NAME + "/" + calendarID + "?" + Utils.TENANT_IDENTIFIER; - System.out.println(CALENDAR_RESOURCE_URL); + LOG.info(CALENDAR_RESOURCE_URL); return Utils.performServerPut(requestSpec, responseSpec, CALENDAR_RESOURCE_URL, getTestCalendarMeetingAsJSON(oldDate, startDate), "resourceId"); @@ -123,7 +124,7 @@ private static String getTestCalendarMeetingAsJSON(String oldDate, String startD map.put("newMeetingDate", startDate); map.put("presentMeetingDate", oldDate); map.put("reschedulebasedOnMeetingDates", "true"); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } } \ No newline at end of file diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CenterDomain.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CenterDomain.java index 06d48dc29a9..1050deddc99 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CenterDomain.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CenterDomain.java @@ -22,9 +22,11 @@ import java.util.ArrayList; import java.util.HashMap; import org.apache.fineract.infrastructure.core.service.DateUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class CenterDomain implements Comparable { - + private final static Logger LOG = LoggerFactory.getLogger(CenterDomain.class); public static class Builder { private Integer id; @@ -147,7 +149,6 @@ public static String jsonRequestToCreateCenter(Integer id, Integer statusId, Str } if (externalId != null) map.put("externalId", externalId); if (groupMembers != null) map.put("groupMembers", groupMembers); - System.out.println(map); return new Gson().toJson(map); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CenterHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CenterHelper.java index 6e69a642cdf..f2ddb966e3a 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CenterHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CenterHelper.java @@ -27,10 +27,12 @@ import java.util.ArrayList; import java.util.HashMap; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked" }) public class CenterHelper { - + private final static Logger LOG = LoggerFactory.getLogger(CenterHelper.class); private static final String CENTERS_URL = "/fineract-provider/api/v1/centers"; public static final String CREATED_DATE = "29 December 2014"; @@ -38,7 +40,7 @@ public class CenterHelper { public static CenterDomain retrieveByID(int id, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String GET_CENTER_BY_ID_URL = CENTERS_URL + "/" + id + "?associations=groupMembers&" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING CENTER AT " + id + "-------------------------"); + LOG.info("------------------------ RETRIEVING CENTER AT " + id + "-------------------------"); Object get = Utils.performServerGet(requestSpec, responseSpec, GET_CENTER_BY_ID_URL, ""); final String jsonData = new Gson().toJson(get); return new Gson().fromJson(jsonData, new TypeToken() {}.getType()); @@ -47,7 +49,7 @@ public static CenterDomain retrieveByID(int id, final RequestSpecification reque public static ArrayList paginatedListCenters(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String GET_CENTER = CENTERS_URL + "?paged=true&limit=-1&" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING CENTERS-------------------------"); + LOG.info("------------------------ RETRIEVING CENTERS-------------------------"); Object get = Utils.performServerGet(requestSpec, responseSpec, GET_CENTER, "pageItems"); final String jsonData = new Gson().toJson(get); return new Gson().fromJson(jsonData, new TypeToken>() {}.getType()); @@ -55,7 +57,7 @@ public static ArrayList paginatedListCenters(final RequestSpecific public static ArrayList listCenters(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String GET_CENTER = CENTERS_URL + "?limit=-1&" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING CENTERS-------------------------"); + LOG.info("------------------------ RETRIEVING CENTERS-------------------------"); Object get = Utils.performServerGet(requestSpec, responseSpec, GET_CENTER, ""); final String jsonData = new Gson().toJson(get); return new Gson().fromJson(jsonData, new TypeToken>() {}.getType()); @@ -95,14 +97,14 @@ public static int createCenter(final String name, final int officeId, final Stri hm.put("activationDate", activationDate); } - System.out.println("------------------------CREATING CENTER-------------------------"); + LOG.info("------------------------CREATING CENTER-------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CENTER_URL, new Gson().toJson(hm), "resourceId"); } public static HashMap updateCenter(final int id, HashMap request, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String UPDATE_CENTER_URL = CENTERS_URL + "/" + id + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------UPDATE CENTER AT " + id + "---------------------------------------------"); + LOG.info("---------------------------------UPDATE CENTER AT " + id + "---------------------------------------------"); HashMap hash = Utils.performServerPut(requestSpec, responseSpec, UPDATE_CENTER_URL, new Gson().toJson(request), "changes"); return hash; @@ -113,10 +115,9 @@ public static int[] associateGroups(final int id, final int[] groupMembers, fina final String ASSOCIATE_GROUP_CENTER_URL = CENTERS_URL + "/" + id + "?command=associateGroups&" + Utils.TENANT_IDENTIFIER; HashMap groupMemberHashMap = new HashMap(); groupMemberHashMap.put("groupMembers", groupMembers); - System.out.println("---------------------------------ASSOCIATING GROUPS AT " + id + "--------------------------------------------"); + LOG.info("---------------------------------ASSOCIATING GROUPS AT " + id + "--------------------------------------------"); HashMap hash = Utils.performServerPost(requestSpec, responseSpec, ASSOCIATE_GROUP_CENTER_URL, new Gson().toJson(groupMemberHashMap), "changes"); - System.out.println(hash); ArrayList arr = (ArrayList) hash.get("groupMembers"); int[] ret = new int[arr.size()]; for (int i = 0; i < ret.length; i++) { @@ -127,38 +128,38 @@ public static int[] associateGroups(final int id, final int[] groupMembers, fina public static void deleteCenter(final int id, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String DELETE_CENTER_URL = CENTERS_URL + "/" + id + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------DELETING CENTER AT " + id + "--------------------------------------------"); + LOG.info("---------------------------------DELETING CENTER AT " + id + "--------------------------------------------"); Utils.performServerDelete(requestSpec, responseSpec, DELETE_CENTER_URL, ""); } public static Integer createCenter(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, @SuppressWarnings("unused") final boolean active) { - System.out.println("---------------------------------CREATING A CENTER---------------------------------------------"); + LOG.info("---------------------------------CREATING A CENTER---------------------------------------------"); return createCenter(requestSpec, responseSpec, "CREATED_DATE"); } public static Integer createCenter(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String activationDate) { - System.out.println("---------------------------------CREATING A CENTER---------------------------------------------"); + LOG.info("---------------------------------CREATING A CENTER---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CENTER_URL, getTestCenterAsJSON(true, activationDate), "groupId"); } public static Integer createCenter(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - System.out.println("---------------------------------CREATING A CENTER---------------------------------------------"); + LOG.info("---------------------------------CREATING A CENTER---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CENTER_URL, getTestCenterAsJSON(true, CenterHelper.CREATED_DATE), "groupId"); } public static int createCenterWithStaffId(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer staffId) { - System.out.println("---------------------------------CREATING A CENTER---------------------------------------------"); + LOG.info("---------------------------------CREATING A CENTER---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CENTER_URL, getTestCenterWithStaffAsJSON(true, CenterHelper.CREATED_DATE, staffId), "groupId"); } public static void verifyCenterCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedCenterID) { - System.out.println("------------------------------CHECK CENTER DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK CENTER DETAILS------------------------------------\n"); final String CENTER_URL = "/fineract-provider/api/v1/centers/" + generatedCenterID + "?" + Utils.TENANT_IDENTIFIER; final Integer responseCenterID = Utils.performServerGet(requestSpec, responseSpec, CENTER_URL, "id"); assertEquals("ERROR IN CREATING THE CENTER", generatedCenterID, responseCenterID); @@ -166,7 +167,7 @@ public static void verifyCenterCreatedOnServer(final RequestSpecification reques public static void verifyCenterActivatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedCenterID, final boolean generatedCenterStatus) { - System.out.println("------------------------------CHECK CENTER STATUS------------------------------------\n"); + LOG.info("------------------------------CHECK CENTER STATUS------------------------------------\n"); final String CENTER_URL = "/fineract-provider/api/v1/centers/" + generatedCenterID + "?" + Utils.TENANT_IDENTIFIER; final Boolean responseCenterStatus = Utils.performServerGet(requestSpec, responseSpec, CENTER_URL, "active"); assertEquals("ERROR IN ACTIVATING THE CENTER", generatedCenterStatus, responseCenterStatus); @@ -175,7 +176,7 @@ public static void verifyCenterActivatedOnServer(final RequestSpecification requ public static Integer activateCenter(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String centerId) { final String CENTER_ASSOCIATE_URL = "/fineract-provider/api/v1/centers/" + centerId + "?command=activate&" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------ACTIVATE A CENTER---------------------------------------------"); + LOG.info("---------------------------------ACTIVATE A CENTER---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CENTER_ASSOCIATE_URL, activateCenterAsJSON(""), "groupId"); } @@ -220,14 +221,14 @@ public static String getTestCenterAsJSON(final boolean active, final String acti public static String assignStaffAsJSON(final Long staffId) { final HashMap map = new HashMap<>(); map.put("staffId", staffId); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static String unassignStaffAsJSON(final Long staffId) { final HashMap map = new HashMap<>(); map.put("staffId", staffId); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -239,9 +240,9 @@ public static String activateCenterAsJSON(final String activationDate) { map.put("activationDate", activationDate); } else { map.put("activationDate", "CREATED_DATE"); - System.out.println("defaulting to fixed date: CREATED_DATE"); + LOG.info("defaulting to fixed date: CREATED_DATE"); } - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -257,7 +258,7 @@ public static Object assignStaff(final RequestSpecification requestSpec, final R final String groupId, final Long staffId) { final String GROUP_ASSIGN_STAFF_URL = "/fineract-provider/api/v1/groups/" + groupId + "?" + Utils.TENANT_IDENTIFIER + "&command=assignStaff"; - System.out.println("---------------------------------Assign Staff---------------------------------------------"); + LOG.info("---------------------------------Assign Staff---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, GROUP_ASSIGN_STAFF_URL, assignStaffAsJSON(staffId), "changes"); } @@ -265,7 +266,7 @@ public static Object unassignStaff(final RequestSpecification requestSpec, final final String groupId, final Long staffId) { final String GROUP_ASSIGN_STAFF_URL = "/fineract-provider/api/v1/groups/" + groupId + "?" + Utils.TENANT_IDENTIFIER + "&command=unassignStaff"; - System.out.println("---------------------------------Unassign Staff---------------------------------------------"); + LOG.info("---------------------------------Unassign Staff---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, GROUP_ASSIGN_STAFF_URL, unassignStaffAsJSON(staffId), "changes"); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ClientHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ClientHelper.java index 6a8088e8a1f..ea78017c533 100755 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ClientHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ClientHelper.java @@ -36,9 +36,11 @@ import org.apache.fineract.integrationtests.common.system.CodeHelper; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Workbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ClientHelper { - + private final static Logger LOG = LoggerFactory.getLogger(ClientHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -78,7 +80,7 @@ public static Integer createClient(final RequestSpecification requestSpec, final public static Integer createClient(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String activationDate, final String officeId) { - System.out.println("---------------------------------CREATING A CLIENT---------------------------------------------"); + LOG.info("---------------------------------CREATING A CLIENT---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestClientAsJSON(activationDate, officeId), "clientId"); } @@ -96,20 +98,20 @@ public static Integer createClientPending(final RequestSpecification requestSpec public static Integer createClientPending(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String submittedOnDate, final String officeId) { - System.out.println("---------------------------------CREATING A CLIENT IN PENDING---------------------------------------------"); + LOG.info("---------------------------------CREATING A CLIENT IN PENDING---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestClientAsJSONPending(submittedOnDate, officeId), "clientId"); } public Object createClientPendingWithError(final String jsonAttributeToGetBack) { - System.out.println("---------------------------------CREATING A CLIENT IN PENDING WITH ERROR---------------------------------------------"); + LOG.info("---------------------------------CREATING A CLIENT IN PENDING WITH ERROR---------------------------------------------"); return Utils.performServerPost(this.requestSpec, this.responseSpec, CREATE_CLIENT_URL, getTestClientAsJSONPending("04 March 2014", "1"), jsonAttributeToGetBack); } public static Integer createClientPendingWithDatatable(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String registeredTableName) { - System.out.println("-------------------------- CREATING A CLIENT IN PENDING WITH DATATABLES --------------------------------"); + LOG.info("-------------------------- CREATING A CLIENT IN PENDING WITH DATATABLES --------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestPendingClientWithDatatableAsJson(registeredTableName), "clientId"); } @@ -126,7 +128,7 @@ public static Integer createClientAsPerson(final RequestSpecification requestSpe public static Integer createClientAsPerson(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String activationDate, final String officeId) { - System.out.println("---------------------------------CREATING A CLIENT NON PERSON(ORGANISATION)---------------------------------------------"); + LOG.info("---------------------------------CREATING A CLIENT NON PERSON(ORGANISATION)---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestPersonClientAsJSON(activationDate, officeId), "clientId"); } @@ -146,7 +148,7 @@ public static Integer createClientAsEntity(final RequestSpecification requestSpe Integer constitutionCodeId = (Integer) CodeHelper.getCodeByName(requestSpec, responseSpec, "Constitution").get("id"); Integer soleProprietorCodeValueId = (Integer) CodeHelper.retrieveOrCreateCodeValue(constitutionCodeId, requestSpec, responseSpec).get("id"); - System.out.println("---------------------------------CREATING A CLIENT NON PERSON(ORGANISATION)---------------------------------------------"); + LOG.info("---------------------------------CREATING A CLIENT NON PERSON(ORGANISATION)---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestEntityClientAsJSON(activationDate, officeId, soleProprietorCodeValueId), "clientId"); } @@ -155,7 +157,7 @@ public static Integer createClientForAccountPreference(final RequestSpecificatio final Integer clientType, String jsonAttributeToGetBack) { final String activationDate = "04 March 2011"; final String officeId = "1"; - System.out.println( + LOG.info( "---------------------------------CREATING A CLIENT BASED ON ACCOUNT PREFERENCE---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestClientWithClientTypeAsJSON(activationDate, officeId, clientType.toString()), jsonAttributeToGetBack); @@ -166,7 +168,7 @@ public static Object assignStaffToClient(final RequestSpecification requestSpec, final String CLIENT_ASSIGN_STAFF_URL = "/fineract-provider/api/v1/clients/" + clientId + "?" + Utils.TENANT_IDENTIFIER + "&command=assignStaff"; - System.out.println("---------------------------------CREATING A CLIENT---------------------------------------------"); + LOG.info("---------------------------------CREATING A CLIENT---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CLIENT_ASSIGN_STAFF_URL, assignStaffToClientAsJson(staffId), "changes"); } @@ -185,7 +187,7 @@ public static String getTestClientAsJSON(final String dateOfJoining, final Strin map.put("locale", "en"); map.put("active", "true"); map.put("activationDate", dateOfJoining); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -199,7 +201,7 @@ public static String getTestClientAsJSONPending(final String submittedOnDate, fi map.put("locale", "en"); map.put("active", "false"); map.put("submittedOnDate", submittedOnDate); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -214,7 +216,7 @@ public static String getTestPendingClientWithDatatableAsJson(final String regist map.put("active", "false"); map.put("submittedOnDate", "04 March 2014"); String requestJson = getTestDatatableAsJson(map, registeredTableName); - System.out.println("map : " + requestJson); + LOG.info("map : " + requestJson); return requestJson; } @@ -246,7 +248,7 @@ public static String getTestPersonClientAsJSON(final String dateOfJoining, final map.put("activationDate", dateOfJoining); map.put("legalFormId", 1); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -265,7 +267,7 @@ public static String getTestEntityClientAsJSON(final String dateOfJoining, final clientNonPersonMap.put("constitutionId", soleProprietorCodeValueId); map.put("clientNonPersonDetails", clientNonPersonMap); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -280,20 +282,20 @@ public static String getTestClientWithClientTypeAsJSON(final String dateOfJoinin map.put("active", "true"); map.put("activationDate", dateOfJoining); map.put("clientTypeId", clientType); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static String assignStaffToClientAsJson(final String staffId) { final HashMap map = new HashMap<>(); map.put("staffId", staffId); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static void verifyClientCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedClientID) { - System.out.println("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); final String CLIENT_URL = "/fineract-provider/api/v1/clients/" + generatedClientID + "?" + Utils.TENANT_IDENTIFIER; final Integer responseClientID = Utils.performServerGet(requestSpec, responseSpec, CLIENT_URL, "id"); assertEquals("ERROR IN CREATING THE CLIENT", generatedClientID, responseClientID); @@ -302,7 +304,7 @@ public static void verifyClientCreatedOnServer(final RequestSpecification reques public static Object getClient(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String clientId, final String jsonReturn) { final String GET_CLIENT_URL = "/fineract-provider/api/v1/clients/" + clientId + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------GET A CLIENT---------------------------------------------"); + LOG.info("---------------------------------GET A CLIENT---------------------------------------------"); return Utils.performServerGet(requestSpec, responseSpec, GET_CLIENT_URL, jsonReturn); } @@ -336,7 +338,7 @@ private String getCloseClientAsJSON() { map.put("closureDate", CREATED_DATE_PLUS_ONE); String clientJson = new Gson().toJson(map); - System.out.println(clientJson); + LOG.info(clientJson); return clientJson; } @@ -347,7 +349,7 @@ private String getReactivateClientAsJSON() { map.put("dateFormat", CommonConstants.dateFormat); map.put("reactivationDate", CREATED_DATE_PLUS_ONE); String clientJson = new Gson().toJson(map); - System.out.println(clientJson); + LOG.info(clientJson); return clientJson; } @@ -358,7 +360,7 @@ private String getUndoRejectClientAsJSON(final String date) { map.put("dateFormat", CommonConstants.dateFormat); map.put("reopenedDate", date); String clientJson = new Gson().toJson(map); - System.out.println(clientJson); + LOG.info(clientJson); return clientJson; } @@ -369,7 +371,7 @@ private String getUndoWithdrawnClientAsJSON(final String date) { map.put("dateFormat", CommonConstants.dateFormat); map.put("reopenedDate", date); String clientJson = new Gson().toJson(map); - System.out.println(clientJson); + LOG.info(clientJson); return clientJson; } @@ -391,7 +393,7 @@ private String getRejectClientAsJSON() { map.put("rejectionDate", CREATED_DATE_PLUS_ONE); map.put("rejectionReasonId", rejectionReasonId.toString()); String clientJson = new Gson().toJson(map); - System.out.println(clientJson); + LOG.info(clientJson); return clientJson; } @@ -402,7 +404,7 @@ private String getActivateClientAsJSON(String date) { map.put("dateFormat", CommonConstants.dateFormat); map.put("activationDate", date); String clientJson = new Gson().toJson(map); - System.out.println(clientJson); + LOG.info(clientJson); return clientJson; } @@ -425,7 +427,7 @@ private String getWithdrawClientAsJSON() { map.put("withdrawalDate", CREATED_DATE_PLUS_ONE); map.put("withdrawalReasonId", withdrawalReasonId.toString()); String clientJson = new Gson().toJson(map); - System.out.println(clientJson); + LOG.info(clientJson); return clientJson; } @@ -448,7 +450,7 @@ public static String getPayChargeJSON(final String date, String amount) { map.put("transactionDate", date); map.put("amount", amount); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -458,32 +460,32 @@ public static String getWaiveChargeJSON(final String amount, String clientCharge map.put("amount", amount); map.put("clientChargeId", clientChargeId); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } public HashMap closeClient(final Integer clientId) { - System.out.println("--------------------------------- CLOSE CLIENT -------------------------------"); + LOG.info("--------------------------------- CLOSE CLIENT -------------------------------"); return performClientActions(createClientOperationURL(CLOSE_CLIENT_COMMAND, clientId), getCloseClientAsJSON(), clientId); } public HashMap reactivateClient(final Integer clientId) { - System.out.println("--------------------------------- REACTIVATE CLIENT -------------------------------"); + LOG.info("--------------------------------- REACTIVATE CLIENT -------------------------------"); return performClientActions(createClientOperationURL(REACTIVATE_CLIENT_COMMAND, clientId), getReactivateClientAsJSON(), clientId); } public HashMap rejectClient(final Integer clientId) { - System.out.println("--------------------------------- REJECT CLIENT -------------------------------"); + LOG.info("--------------------------------- REJECT CLIENT -------------------------------"); return performClientActions(createClientOperationURL(REJECT_CLIENT_COMMAND, clientId), getRejectClientAsJSON(), clientId); } public HashMap activateClient(final Integer clientId) { - System.out.println("--------------------------------- ACTIVATE CLIENT -------------------------------"); + LOG.info("--------------------------------- ACTIVATE CLIENT -------------------------------"); return performClientActions(createClientOperationURL(ACTIVATE_CLIENT_COMMAND, clientId), getActivateClientAsJSON(CREATED_DATE_PLUS_ONE), clientId); } public HashMap withdrawClient(final Integer clientId) { - System.out.println("--------------------------------- WITHDRAWN CLIENT -------------------------------"); + LOG.info("--------------------------------- WITHDRAWN CLIENT -------------------------------"); return performClientActions(createClientOperationURL(WITHDRAW_CLIENT_COMMAND, clientId), getWithdrawClientAsJSON(), clientId); } @@ -492,41 +494,41 @@ private String createClientOperationURL(final String command, final Integer clie } public HashMap undoReject(final Integer clientId) { - System.out.println("--------------------------------- UNDO REJECT CLIENT -------------------------------"); + LOG.info("--------------------------------- UNDO REJECT CLIENT -------------------------------"); return performClientActions(createClientOperationURL(UNDOREJECT_CLIENT_COMMAND, clientId), getUndoRejectClientAsJSON(CREATED_DATE_PLUS_TWO), clientId); } public HashMap undoWithdrawn(final Integer clientId) { - System.out.println("--------------------------------- UNDO WITHDRAWN CLIENT -------------------------------"); + LOG.info("--------------------------------- UNDO WITHDRAWN CLIENT -------------------------------"); return performClientActions(createClientOperationURL(UNDOWITHDRAWN_CLIENT_COMMAND, clientId), getUndoWithdrawnClientAsJSON(CREATED_DATE_PLUS_TWO), clientId); } public Object undoRejectedclient(final Integer clientId, final String jsonAttributeToGetBack, final String rejectedDate) { - System.out.println("----------------------------------UNDO REJECT CLIENT ----------------------------------"); + LOG.info("----------------------------------UNDO REJECT CLIENT ----------------------------------"); return performClientActionsWithValidationErrors(createClientOperationURL(UNDOREJECT_CLIENT_COMMAND, clientId), getUndoRejectClientAsJSON(rejectedDate), jsonAttributeToGetBack); } public Object undoWithdrawclient(final Integer clientId, final String jsonAttributeToGetBack, final String rejectedDate) { - System.out.println("----------------------------------UNDO WITHDRAW CLIENT ----------------------------------"); + LOG.info("----------------------------------UNDO WITHDRAW CLIENT ----------------------------------"); return performClientActionsWithValidationErrors( createClientOperationURL(UNDOWITHDRAWN_CLIENT_COMMAND, clientId), getUndoWithdrawnClientAsJSON(rejectedDate), jsonAttributeToGetBack); } public Object activateClient(final Integer clientId, final String jsonAttributeToGetBack) { - System.out.println("--------------------------------- ACTIVATE CLIENT -------------------------------"); + LOG.info("--------------------------------- ACTIVATE CLIENT -------------------------------"); return performClientActionsWithValidationErrors(createClientOperationURL(ACTIVATE_CLIENT_COMMAND, clientId), getActivateClientAsJSON(CREATED_DATE_PLUS_ONE), jsonAttributeToGetBack); } public HashMap activateClientWithDiffDateOption(final Integer clientId, final String activationDate) { - System.out.println("--------------------------------- ACTIVATE CLIENT -------------------------------"); + LOG.info("--------------------------------- ACTIVATE CLIENT -------------------------------"); return performClientActions(createClientOperationURL(ACTIVATE_CLIENT_COMMAND, clientId), getActivateClientAsJSON(activationDate), clientId); } @@ -546,7 +548,7 @@ private HashMap performClientActions(final String postURLForClie public static Integer addChargesForClient(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer clientId, final String request) { - System.out.println("--------------------------------- ADD CHARGES FOR Client --------------------------------"); + LOG.info("--------------------------------- ADD CHARGES FOR Client --------------------------------"); final String ADD_CHARGES_URL = "/fineract-provider/api/v1/clients/" + clientId + "/charges?" + Utils.TENANT_IDENTIFIER; final HashMap response = Utils.performServerPost(requestSpec, responseSpec, ADD_CHARGES_URL, request, ""); return (Integer) response.get("resourceId"); @@ -554,7 +556,7 @@ public static Integer addChargesForClient(final RequestSpecification requestSpec public static String payChargesForClients(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer clientId, final Integer clientChargeId, final String json) { - System.out.println("--------------------------------- PAY CHARGES FOR CLIENT --------------------------------"); + LOG.info("--------------------------------- PAY CHARGES FOR CLIENT --------------------------------"); final String CHARGES_URL = "/fineract-provider/api/v1/clients/" + clientId + "/charges/" + clientChargeId + "?command=paycharge&" + Utils.TENANT_IDENTIFIER; final HashMap response = Utils.performServerPost(requestSpec, responseSpec, CHARGES_URL, json, ""); @@ -563,7 +565,7 @@ public static String payChargesForClients(final RequestSpecification requestSpec public static String waiveChargesForClients(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer clientId, final Integer clientChargeId, final String json) { - System.out.println("--------------------------------- WAIVE CHARGES FOR CLIENT --------------------------------"); + LOG.info("--------------------------------- WAIVE CHARGES FOR CLIENT --------------------------------"); final String CHARGES_URL = "/fineract-provider/api/v1/clients/" + clientId + "/charges/" + clientChargeId + "?command=waive&" + Utils.TENANT_IDENTIFIER; @@ -573,7 +575,7 @@ public static String waiveChargesForClients(final RequestSpecification requestSp public static Integer revertClientChargeTransaction(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String clientId, String clientChargeId) { - System.out.println("---------------------------------UNDO TRANSACTION---------------------------------------------"); + LOG.info("---------------------------------UNDO TRANSACTION---------------------------------------------"); final String CHARGES_URL = "/fineract-provider/api/v1/clients/" + clientId + "/transactions/" + clientChargeId + "?command=undo&" + Utils.TENANT_IDENTIFIER; @@ -584,7 +586,7 @@ public static Integer revertClientChargeTransaction(final RequestSpecification r public static Object getClientCharge(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String clientId, final String clientChargeId) { - System.out.println("---------------------------------GET CLIENT CHARGE---------------------------------------------"); + LOG.info("---------------------------------GET CLIENT CHARGE---------------------------------------------"); final String CHARGES_URL = "/fineract-provider/api/v1/clients/" + clientId + "/charges/" + clientChargeId + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerGet(requestSpec, responseSpec, CHARGES_URL, "amountOutstanding"); @@ -592,7 +594,7 @@ public static Object getClientCharge(final RequestSpecification requestSpec, fin public static Boolean getClientTransactions(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String clientId, final String transactionId) { - System.out.println("---------------------------------GET CLIENT CHARGE TRANSACTIONS---------------------------------------------"); + LOG.info("---------------------------------GET CLIENT CHARGE TRANSACTIONS---------------------------------------------"); final String CHARGES_URL = "/fineract-provider/api/v1/clients/" + clientId + "/transactions/" + transactionId + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerGet(requestSpec, responseSpec, CHARGES_URL, "reversed"); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CurrenciesHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CurrenciesHelper.java index 5b4e3350fbe..03dcd373b57 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CurrenciesHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CurrenciesHelper.java @@ -24,16 +24,18 @@ import com.jayway.restassured.specification.ResponseSpecification; import java.util.ArrayList; import java.util.HashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "unused", "rawtypes", "unchecked" }) public class CurrenciesHelper { - + private final static Logger LOG = LoggerFactory.getLogger(CurrenciesHelper.class); private static final String CURRENCIES_URL = "/fineract-provider/api/v1/currencies"; public static ArrayList getAllCurrencies(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String GET_ALL_CURRENCIES_URL = CURRENCIES_URL + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING ALL CURRENCIES -------------------------"); + LOG.info("------------------------ RETRIEVING ALL CURRENCIES -------------------------"); final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_ALL_CURRENCIES_URL, ""); ArrayList selectedCurrencyOptions = (ArrayList) response.get("selectedCurrencyOptions"); ArrayList currencyOptions = (ArrayList) response.get("currencyOptions"); @@ -45,7 +47,7 @@ public static ArrayList getAllCurrencies(final RequestSpecificat public static ArrayList getSelectedCurrencies(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String GET_ALL_SELECTED_CURRENCIES_URL = CURRENCIES_URL + "?fields=selectedCurrencyOptions" + "&" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING ALL SELECTED CURRENCIES -------------------------"); + LOG.info("------------------------ RETRIEVING ALL SELECTED CURRENCIES -------------------------"); final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_ALL_SELECTED_CURRENCIES_URL, ""); final String jsonData = new Gson().toJson(response.get("selectedCurrencyOptions")); return new Gson().fromJson(jsonData, new TypeToken>() {}.getType()); @@ -63,7 +65,7 @@ public static CurrencyDomain getCurrencybyCode(final RequestSpecification reques public static ArrayList updateSelectedCurrencies(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final ArrayList currencies) { final String CURRENCIES_UPDATE_URL = CURRENCIES_URL + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------UPDATE SELECTED CURRENCIES LIST---------------------------------------------"); + LOG.info("---------------------------------UPDATE SELECTED CURRENCIES LIST---------------------------------------------"); HashMap hash = Utils.performServerPut(requestSpec, responseSpec, CURRENCIES_UPDATE_URL, currenciesToJSON(currencies), "changes"); return (ArrayList) hash.get("currencies"); } @@ -71,7 +73,7 @@ public static ArrayList updateSelectedCurrencies(final RequestSpecificat private static String currenciesToJSON(final ArrayList currencies) { HashMap map = new HashMap<>(); map.put("currencies", currencies); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ExternalServicesConfigurationHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ExternalServicesConfigurationHelper.java index 843c9f1964c..f84ae8b6fcd 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ExternalServicesConfigurationHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ExternalServicesConfigurationHelper.java @@ -23,9 +23,11 @@ import com.jayway.restassured.specification.ResponseSpecification; import java.util.ArrayList; import java.util.HashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ExternalServicesConfigurationHelper { - + private final static Logger LOG = LoggerFactory.getLogger(ExternalServicesConfigurationHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -38,7 +40,7 @@ public static ArrayList getExternalServicesConfigurationByServiceName(f final ResponseSpecification responseSpec, final String serviceName) { final String GET_EXTERNAL_SERVICES_CONFIG_BY_SERVICE_NAME_URL = "/fineract-provider/api/v1/externalservice/" + serviceName + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING GLOBAL CONFIGURATION BY ID -------------------------"); + LOG.info("------------------------ RETRIEVING GLOBAL CONFIGURATION BY ID -------------------------"); return Utils.performServerGet(requestSpec, responseSpec, GET_EXTERNAL_SERVICES_CONFIG_BY_SERVICE_NAME_URL, ""); } @@ -46,7 +48,7 @@ public static HashMap updateValueForExternaServicesConfiguration(final RequestSp final ResponseSpecification responseSpec, final String serviceName, final String name, final String value) { final String EXTERNAL_SERVICES_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/externalservice/" + serviceName + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------"); + LOG.info("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------"); HashMap map = Utils.performServerPut(requestSpec, responseSpec, EXTERNAL_SERVICES_CONFIG_UPDATE_URL, updateExternalServicesConfigUpdateValueAsJSON(name, value), ""); @@ -56,7 +58,7 @@ public static HashMap updateValueForExternaServicesConfiguration(final RequestSp public static String updateExternalServicesConfigUpdateValueAsJSON(final String name, final String value) { final HashMap map = new HashMap<>(); map.put(name, value); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java index c76a6ef74db..bc90a3da26e 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java @@ -24,10 +24,12 @@ import java.util.ArrayList; import java.util.HashMap; import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "unused", "rawtypes" }) public class GlobalConfigurationHelper { - + private final static Logger LOG = LoggerFactory.getLogger(GlobalConfigurationHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -38,7 +40,7 @@ public GlobalConfigurationHelper(final RequestSpecification requestSpec, final R public static ArrayList getAllGlobalConfigurations(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String GET_ALL_GLOBAL_CONFIG_URL = "/fineract-provider/api/v1/configurations?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING ALL GLOBAL CONFIGURATIONS -------------------------"); + LOG.info("------------------------ RETRIEVING ALL GLOBAL CONFIGURATIONS -------------------------"); final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_ALL_GLOBAL_CONFIG_URL, ""); return (ArrayList) response.get("globalConfiguration"); } @@ -46,7 +48,7 @@ public static ArrayList getAllGlobalConfigurations(final RequestSpecifi public static HashMap getGlobalConfigurationById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String configId) { final String GET_GLOBAL_CONFIG_BY_ID_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING GLOBAL CONFIGURATION BY ID -------------------------"); + LOG.info("------------------------ RETRIEVING GLOBAL CONFIGURATION BY ID -------------------------"); return Utils.performServerGet(requestSpec, responseSpec, GET_GLOBAL_CONFIG_BY_ID_URL, ""); } @@ -338,7 +340,7 @@ private static ArrayList getAllDefaultGlobalConfigurations() { public static Integer updateValueForGlobalConfiguration(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String configId, final String value) { final String GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------"); + LOG.info("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------"); return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL, updateGlobalConfigUpdateValueAsJSON(value), "resourceId"); } @@ -346,8 +348,7 @@ public static Integer updateValueForGlobalConfiguration(final RequestSpecificati public static Integer updateEnabledFlagForGlobalConfiguration(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String configId, final Boolean enabled) { final String GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER; - System.out - .println("---------------------------------UPDATE GLOBAL CONFIG FOR ENABLED FLAG---------------------------------------------"); + LOG.info("---------------------------------UPDATE GLOBAL CONFIG FOR ENABLED FLAG---------------------------------------------"); return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL, updateGlobalConfigUpdateEnabledFlagAsJSON(enabled), "resourceId"); } @@ -355,7 +356,7 @@ public static Integer updateEnabledFlagForGlobalConfiguration(final RequestSpeci public static ArrayList getGlobalConfigurationIsCacheEnabled(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String GET_IS_CACHE_GLOBAL_CONFIG_URL = "/fineract-provider/api/v1/caches?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING IS CACHE ENABLED GLOBAL CONFIGURATION -------------------------"); + LOG.info("------------------------ RETRIEVING IS CACHE ENABLED GLOBAL CONFIGURATION -------------------------"); final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, GET_IS_CACHE_GLOBAL_CONFIG_URL, ""); return response; } @@ -363,7 +364,7 @@ public static ArrayList getGlobalConfigurationIsCacheEnabled(final RequestSpecif public static HashMap updateIsCacheEnabledForGlobalConfiguration(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String cacheType) { final String IS_CACHE_GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/caches?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------UPDATE GLOBAL CONFIG FOR IS CACHE ENABLED----------------------"); + LOG.info("------------------UPDATE GLOBAL CONFIG FOR IS CACHE ENABLED----------------------"); return Utils.performServerPut(requestSpec, responseSpec, IS_CACHE_GLOBAL_CONFIG_UPDATE_URL, updateIsCacheEnabledGlobalConfigUpdateAsJSON(cacheType), "changes"); } @@ -371,7 +372,7 @@ public static HashMap updateIsCacheEnabledForGlobalConfiguration(final RequestSp public static Object updatePasswordResetDaysForGlobalConfiguration(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer configId, final String value, final String enabled, final String jsonAttributeToGetBack) { final String UPDATE_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------UPDATE GLOBAL CONFIG FOR FORCE PASSWORD RESET DAYS----------------------"); + LOG.info("------------------UPDATE GLOBAL CONFIG FOR FORCE PASSWORD RESET DAYS----------------------"); return Utils.performServerPut(requestSpec, responseSpec, UPDATE_URL, updatePasswordResetDaysGlobalConfigAsJSON(value, enabled), jsonAttributeToGetBack); } @@ -379,7 +380,7 @@ public static Object updatePasswordResetDaysForGlobalConfiguration(final Request public static String updateGlobalConfigUpdateValueAsJSON(final String value) { final HashMap map = new HashMap<>(); map.put("value", value); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -389,21 +390,21 @@ public static String updatePasswordResetDaysGlobalConfigAsJSON(final String valu map.put("value", value); } map.put("enabled", enabled); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static String updateGlobalConfigUpdateEnabledFlagAsJSON(final Boolean enabled) { final HashMap map = new HashMap(); map.put("enabled", enabled); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static String updateIsCacheEnabledGlobalConfigUpdateAsJSON(final String cacheType) { final HashMap map = new HashMap<>(); map.put("cacheType", cacheType); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GroupHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GroupHelper.java index c9aa956f75b..34dfade8b33 100755 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GroupHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GroupHelper.java @@ -29,9 +29,11 @@ import java.util.HashMap; import java.util.List; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class GroupHelper { - + private final static Logger LOG = LoggerFactory.getLogger(GroupHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -46,30 +48,30 @@ public GroupHelper(final RequestSpecification requestSpec, final ResponseSpecifi public static Integer createGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, @SuppressWarnings("unused") final boolean active) { - System.out.println("---------------------------------CREATING A GROUP---------------------------------------------"); + LOG.info("---------------------------------CREATING A GROUP---------------------------------------------"); return createGroup(requestSpec, responseSpec, "04 March 2011"); } public static Integer createGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String activationDate) { - System.out.println("---------------------------------CREATING A GROUP---------------------------------------------"); + LOG.info("---------------------------------CREATING A GROUP---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_GROUP_URL, getTestGroupAsJSON(true, activationDate), "groupId"); } public static Integer createGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - System.out.println("---------------------------------CREATING A GROUP---------------------------------------------"); + LOG.info("---------------------------------CREATING A GROUP---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_GROUP_URL, getTestGroupAsJSON(false, ""), "groupId"); } public Object createGroupWithError(final String jsonAttributeToGetBack) { - System.out.println("---------------------------------CREATING A GROUP WITH ERROR---------------------------------------------"); + LOG.info("---------------------------------CREATING A GROUP WITH ERROR---------------------------------------------"); return Utils.performServerPost(this.requestSpec, this.responseSpec, CREATE_GROUP_URL, getTestGroupAsJSON(false, ""), jsonAttributeToGetBack); } public static Integer createGroupPendingWithDatatable(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String registeredTableName) { - System.out.println("-------------------------- CREATING A GROUP WITH DATATABLES --------------------------------"); + LOG.info("-------------------------- CREATING A GROUP WITH DATATABLES --------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_GROUP_URL, getTestGroupWithDatatableAsJson(registeredTableName), "groupId"); } @@ -78,7 +80,7 @@ public static Integer associateClient(final RequestSpecification requestSpec, fi final String groupId, final String clientMember) { final String GROUP_ASSOCIATE_URL = "/fineract-provider/api/v1/groups/" + groupId + "?command=associateClients&" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------Associate Client To A GROUP---------------------------------------------"); + LOG.info("---------------------------------Associate Client To A GROUP---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, GROUP_ASSOCIATE_URL, associateClientAsJSON(clientMember), "groupId"); } @@ -86,39 +88,39 @@ public static Integer disAssociateClient(final RequestSpecification requestSpec, final String groupId, final String clientMember) { final String GROUP_ASSOCIATE_URL = "/fineract-provider/api/v1/groups/" + groupId + "?command=disassociateClients&" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------Disassociate Client To A GROUP---------------------------------------------"); + LOG.info("---------------------------------Disassociate Client To A GROUP---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, GROUP_ASSOCIATE_URL, associateClientAsJSON(clientMember), "groupId"); } public static Integer activateGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String groupId) { final String GROUP_ASSOCIATE_URL = "/fineract-provider/api/v1/groups/" + groupId + "?command=activate&" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------Activate A GROUP---------------------------------------------"); + LOG.info("---------------------------------Activate A GROUP---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, GROUP_ASSOCIATE_URL, activateGroupAsJSON(""), "groupId"); } public static Integer updateGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String name, final String groupId) { final String GROUP_ASSOCIATE_URL = "/fineract-provider/api/v1/groups/" + groupId + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------UPDATE GROUP---------------------------------------------"); + LOG.info("---------------------------------UPDATE GROUP---------------------------------------------"); return Utils.performServerPut(requestSpec, responseSpec, GROUP_ASSOCIATE_URL, updateGroupAsJSON(name), "groupId"); } public static Integer deleteGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String groupId) { final String GROUP_ASSOCIATE_URL = "/fineract-provider/api/v1/groups/" + groupId + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------DELETE GROUP---------------------------------------------"); + LOG.info("---------------------------------DELETE GROUP---------------------------------------------"); return Utils.performServerDelete(requestSpec, responseSpec, GROUP_ASSOCIATE_URL, "groupId"); } public static Object assignStaff(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String groupId,final Long staffId){ final String GROUP_ASSIGN_STAFF_URL = "/fineract-provider/api/v1/groups/" + groupId + "?" + Utils.TENANT_IDENTIFIER + "&command=assignStaff"; - System.out.println("---------------------------------DELETE GROUP---------------------------------------------"); + LOG.info("---------------------------------DELETE GROUP---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, GROUP_ASSIGN_STAFF_URL,assignStaffAsJSON(staffId),"changes"); } public static Object assignStaffInheritStaffForClientAccounts(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String groupId,final String staffId){ final String GROUP_ASSIGN_STAFF_URL = "/fineract-provider/api/v1/groups/" + groupId + "?" + Utils.TENANT_IDENTIFIER + "&command=assignStaff"; - System.out.println("---------------------------------DELETE GROUP---------------------------------------------"); + LOG.info("---------------------------------DELETE GROUP---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, GROUP_ASSIGN_STAFF_URL,assignStaffAndInheritStaffForClientAccountsAsJSON(staffId),"changes"); } @@ -136,10 +138,10 @@ public static String getTestGroupAsJSON(final boolean active, final String activ } else { map.put("active", "false"); map.put("submittedOnDate", "04 March 2011"); - System.out.println("defaulting to inactive group: 04 March 2011"); + LOG.info("defaulting to inactive group: 04 March 2011"); } - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -148,7 +150,7 @@ public static String associateClientAsJSON(final String clientMember) { final List list = new ArrayList<>(); list.add(clientMember); map.put("clientMembers", list); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -160,36 +162,36 @@ public static String activateGroupAsJSON(final String activationDate) { map.put("activationDate", activationDate); } else { map.put("activationDate", "04 March 2011"); - System.out.println("defaulting to fixed date: 04 March 2011"); + LOG.info("defaulting to fixed date: 04 March 2011"); } - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static String updateGroupAsJSON(final String name) { final HashMap map = new HashMap<>(); map.put("name", name); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static String assignStaffAsJSON(final Long staffId) { final HashMap map = new HashMap<>(); map.put("staffId", staffId); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static String assignStaffAndInheritStaffForClientAccountsAsJSON(final String staffId) { final HashMap map = new HashMap<>(); map.put("staffId", staffId); map.put("inheritStaffForClientAccounts","true"); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static void verifyGroupCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedGroupID) { - System.out.println("------------------------------CHECK GROUP DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK GROUP DETAILS------------------------------------\n"); final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?" + Utils.TENANT_IDENTIFIER; final Integer responseGroupID = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "id"); assertEquals("ERROR IN CREATING THE GROUP", generatedGroupID, responseGroupID); @@ -197,7 +199,7 @@ public static void verifyGroupCreatedOnServer(final RequestSpecification request public static void verifyGroupDetails(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedGroupID, final String field, final String expectedValue) { - System.out.println("------------------------------CHECK GROUP DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK GROUP DETAILS------------------------------------\n"); final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?" + Utils.TENANT_IDENTIFIER; final String responseValue = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, field); assertEquals("ERROR IN CREATING THE GROUP", expectedValue, responseValue); @@ -205,7 +207,7 @@ public static void verifyGroupDetails(final RequestSpecification requestSpec, fi public static void verifyGroupActivatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedGroupID, final boolean generatedGroupStatus) { - System.out.println("------------------------------CHECK GROUP STATUS------------------------------------\n"); + LOG.info("------------------------------CHECK GROUP STATUS------------------------------------\n"); final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?" + Utils.TENANT_IDENTIFIER; final Boolean responseGroupStatus = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "active"); assertEquals("ERROR IN ACTIVATING THE GROUP", generatedGroupStatus, responseGroupStatus); @@ -214,7 +216,7 @@ public static void verifyGroupActivatedOnServer(final RequestSpecification reque public static void verifyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedGroupID, final Integer groupMember) { List list = new ArrayList<>(); - System.out.println("------------------------------CHECK GROUP MEMBERS------------------------------------\n"); + LOG.info("------------------------------CHECK GROUP MEMBERS------------------------------------\n"); final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?associations=clientMembers&" + Utils.TENANT_IDENTIFIER; list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "clientMembers"); @@ -224,7 +226,7 @@ public static void verifyGroupMembers(final RequestSpecification requestSpec, fi public static void verifyEmptyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedGroupID) { List list = new ArrayList<>(); - System.out.println("------------------------------CHECK EMPTY GROUP MEMBER LIST------------------------------------\n"); + LOG.info("------------------------------CHECK EMPTY GROUP MEMBER LIST------------------------------------\n"); final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?associations=clientMembers&" + Utils.TENANT_IDENTIFIER; list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "clientMembers"); @@ -234,7 +236,7 @@ public static void verifyEmptyGroupMembers(final RequestSpecification requestSpe public static void verifyGroupDeleted(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedGroupID) { List list = new ArrayList<>(); - System.out.println("------------------------------CHECK GROUP DELETED------------------------------------\n"); + LOG.info("------------------------------CHECK GROUP DELETED------------------------------------\n"); final String GROUP_URL = "/fineract-provider/api/v1/groups/?" + Utils.TENANT_IDENTIFIER; list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "pageItems"); @@ -259,7 +261,6 @@ public static String getTestGroupWithDatatableAsJson(final String registeredTabl map.put("active", "false"); map.put("submittedOnDate", "04 March 2011"); String requestJson = getTestDatatableAsJson(map, registeredTableName); - System.out.println("map : " + requestJson); return requestJson; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/HolidayHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/HolidayHelper.java index 8c0cb0059fc..dcfbbe771d8 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/HolidayHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/HolidayHelper.java @@ -24,13 +24,15 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "unused", "rawtypes" }) public class HolidayHelper { private static final String HOLIDAYS_URL = "/fineract-provider/api/v1/holidays"; private static final String CREATE_HOLIDAY_URL = HOLIDAYS_URL + "?" + Utils.TENANT_IDENTIFIER; - + private final static Logger LOG = LoggerFactory.getLogger(HolidayHelper.class); private static final String OFFICE_ID = "1"; private final RequestSpecification requestSpec; @@ -57,14 +59,14 @@ public static String getCreateHolidayDataAsJSON() { map.put("repaymentsRescheduledTo", "08 April 2013"); map.put("reschedulingType", 2); String HolidayCreateJson = new Gson().toJson(map); - System.out.println(HolidayCreateJson); + LOG.info(HolidayCreateJson); return HolidayCreateJson; } public static String getActivateHolidayDataAsJSON() { final HashMap map = new HashMap<>(); String activateHoliday = new Gson().toJson(map); - System.out.println(activateHoliday); + LOG.info(activateHoliday); return activateHoliday; } @@ -80,7 +82,7 @@ public static Integer activateHolidays(final RequestSpecification requestSpec, f public static HashMap getHolidayById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String holidayID) { final String GET_HOLIDAY_BY_ID_URL = HOLIDAYS_URL + "/" + holidayID + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING HOLIDAY BY ID -------------------------"); + LOG.info("------------------------ RETRIEVING HOLIDAY BY ID -------------------------"); final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_HOLIDAY_BY_ID_URL, ""); return response; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/HookHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/HookHelper.java index f2a9b20dd00..becef99bf85 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/HookHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/HookHelper.java @@ -26,9 +26,11 @@ import com.jayway.restassured.specification.ResponseSpecification; import java.util.ArrayList; import java.util.HashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HookHelper { - + private final static Logger LOG = LoggerFactory.getLogger(HookHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -40,7 +42,7 @@ public HookHelper(final RequestSpecification requestSpec, final ResponseSpecific } public Integer createHook(final String payloadURL) { - System.out.println("---------------------------------CREATING A HOOK---------------------------------------------"); + LOG.info("---------------------------------CREATING A HOOK---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_HOOK_URL, getTestHookAsJson(payloadURL), "resourceId"); } @@ -60,31 +62,31 @@ public String getTestHookAsJson(final String payloadURL) { createOfficeEvent.put("entityName", "OFFICE"); events.add(createOfficeEvent); map.put("events", events); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public Integer updateHook(final String payloadURL, final Long hookId) { - System.out.println("---------------------------------UPDATING HOOK---------------------------------------------"); + LOG.info("---------------------------------UPDATING HOOK---------------------------------------------"); final String UPDATE_HOOK_URL = "/fineract-provider/api/v1/hooks/" + hookId + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerPut(this.requestSpec, this.responseSpec, UPDATE_HOOK_URL, getTestHookAsJson(payloadURL), "resourceId"); } public Integer deleteHook(final Long hookId) { - System.out.println("---------------------------------DELETING HOOK---------------------------------------------"); + LOG.info("---------------------------------DELETING HOOK---------------------------------------------"); final String DELETE_HOOK_URL = "/fineract-provider/api/v1/hooks/" + hookId + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerDelete(this.requestSpec, this.responseSpec, DELETE_HOOK_URL, "resourceId"); } public void verifyHookCreatedOnServer(final Long hookId) { - System.out.println("------------------------------CHECK CREATE HOOK DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK CREATE HOOK DETAILS------------------------------------\n"); final String GET_URL = "/fineract-provider/api/v1/hooks/" + hookId + "?" + Utils.TENANT_IDENTIFIER; final Integer responseHookId = Utils.performServerGet(this.requestSpec, this.responseSpec, GET_URL, "id"); assertEquals(hookId.toString(), responseHookId.toString()); } public void verifyUpdateHook(final String updateURL, final Long hookId) { - System.out.println("------------------------------CHECK UPDATE HOOK DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK UPDATE HOOK DETAILS------------------------------------\n"); final String GET_URL = "/fineract-provider/api/v1/hooks/" + hookId + "?" + Utils.TENANT_IDENTIFIER; ArrayList map = Utils.performServerGet(this.requestSpec, this.responseSpec, GET_URL, "config"); HashMap hash = (HashMap) map.get(1); @@ -92,7 +94,7 @@ public void verifyUpdateHook(final String updateURL, final Long hookId) { } public void verifyDeleteHook(final Long hookId) { - System.out.println("------------------------------CHECK DELETE HOOK DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK DELETE HOOK DETAILS------------------------------------\n"); final String GET_URL = "/fineract-provider/api/v1/hooks/" + hookId + "?" + Utils.TENANT_IDENTIFIER; ResponseSpecification responseSpec404 = new ResponseSpecBuilder().expectStatusCode(404).build(); ArrayList array = Utils.performServerGet(this.requestSpec, responseSpec404, GET_URL, "errors"); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ImageHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ImageHelper.java index 613f7635412..ee1e7254a95 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ImageHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ImageHelper.java @@ -21,29 +21,31 @@ import com.jayway.restassured.specification.RequestSpecification; import com.jayway.restassured.specification.ResponseSpecification; import org.apache.http.HttpHeaders; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ImageHelper { - + private final static Logger LOG = LoggerFactory.getLogger(ImageHelper.class); private static final String STAFF_IMAGE_URL = "/fineract-provider/api/v1/staff/"; private static final String IMAGES_URI = "/images"; public static Integer createImageForStaff(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, Integer staffId) { - System.out.println("---------------------------------CREATING AN IMAGE FOR STAFF---------------------------------------------"); + LOG.info("---------------------------------CREATING AN IMAGE FOR STAFF---------------------------------------------"); String URL = STAFF_IMAGE_URL + staffId + IMAGES_URI + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerPost(requestSpec, responseSpec, URL, generateImageAsText(), "resourceId"); } public static Integer updateImageForStaff(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, Integer staffId) { - System.out.println("---------------------------------UPDATING AN IMAGE FOR STAFF---------------------------------------------"); + LOG.info("---------------------------------UPDATING AN IMAGE FOR STAFF---------------------------------------------"); String URL = STAFF_IMAGE_URL + staffId + IMAGES_URI + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerPut(requestSpec, responseSpec, URL, generateImageAsText(), "resourceId"); } public static String getStaffImageAsText(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, Integer staffId) { - System.out.println("---------------------------------RETRIEVING STAFF IMAGE---------------------------------------------"); + LOG.info("---------------------------------RETRIEVING STAFF IMAGE---------------------------------------------"); String URL = STAFF_IMAGE_URL + staffId + IMAGES_URI + "?" + Utils.TENANT_IDENTIFIER; requestSpec.header(HttpHeaders.ACCEPT, "text/plain"); return Utils.performGetTextResponse(requestSpec, responseSpec, URL); @@ -51,14 +53,14 @@ public static String getStaffImageAsText(final RequestSpecification requestSpec, public static byte[] getStaffImageAsBinary(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, Integer staffId) { - System.out.println("---------------------------------RETRIEVING STAFF IMAGE---------------------------------------------"); + LOG.info("---------------------------------RETRIEVING STAFF IMAGE---------------------------------------------"); String URL = STAFF_IMAGE_URL + staffId + IMAGES_URI + "?" + Utils.TENANT_IDENTIFIER; requestSpec.header(HttpHeaders.ACCEPT, "application/octet-stream"); return Utils.performGetBinaryResponse(requestSpec, responseSpec, URL); } public static Integer deleteStaffImage(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, Integer staffId) { - System.out.println("---------------------------------RETRIEVING STAFF IMAGE---------------------------------------------"); + LOG.info("---------------------------------RETRIEVING STAFF IMAGE---------------------------------------------"); String URL = STAFF_IMAGE_URL + staffId + IMAGES_URI + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerDelete(requestSpec, responseSpec, URL, "resourceId"); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/NotificationHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/NotificationHelper.java index a2674bac69f..7a05419fd76 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/NotificationHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/NotificationHelper.java @@ -20,9 +20,11 @@ import com.jayway.restassured.specification.RequestSpecification; import com.jayway.restassured.specification.ResponseSpecification; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class NotificationHelper { - + private final static Logger LOG = LoggerFactory.getLogger(NotificationHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -36,7 +38,7 @@ public NotificationHelper(RequestSpecification requestSpec, ResponseSpecificatio public static Object getNotifications(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String jsonReturn) { final String GET_NOTIFICATIONS_URL = NOTIFICATION_API_URL; - System.out.println("-----------------------------GET NOTIFICATIONS-----------------------------------"); + LOG.info("-----------------------------GET NOTIFICATIONS-----------------------------------"); return Utils.performServerGet(requestSpec, responseSpec, GET_NOTIFICATIONS_URL, ""); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/OfficeHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/OfficeHelper.java index 5895ad3fe16..a5284d57ee3 100755 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/OfficeHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/OfficeHelper.java @@ -31,9 +31,11 @@ import javax.ws.rs.core.MediaType; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Workbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class OfficeHelper { - + private final static Logger LOG = LoggerFactory.getLogger(OfficeHelper.class); private static final String OFFICE_URL = "/fineract-provider/api/v1/offices"; private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -67,7 +69,7 @@ public Integer updateOffice(int id, String name, String openingDate) { map.put("locale", "en"); map.put("openingDate", openingDate); - System.out.println("map : " + map); + LOG.info("map : " + map); return Utils.performServerPut(requestSpec, responseSpec, OFFICE_URL + "/" + id + "?" + Utils.TENANT_IDENTIFIER, @@ -81,7 +83,7 @@ public static String getAsJSON(final String openingDate) { map.put("dateFormat", "dd MMMM yyyy"); map.put("locale", "en"); map.put("openingDate", openingDate); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/PasswordPreferencesHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/PasswordPreferencesHelper.java index defeb69b568..bdecddb3348 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/PasswordPreferencesHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/PasswordPreferencesHelper.java @@ -22,23 +22,24 @@ import com.jayway.restassured.specification.RequestSpecification; import com.jayway.restassured.specification.ResponseSpecification; import java.util.HashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class PasswordPreferencesHelper { - + private final static Logger LOG = LoggerFactory.getLogger(PasswordPreferencesHelper.class); private static final String PASSWORD_PREFERENCES_URL = "/fineract-provider/api/v1/passwordpreferences"; public static Object updatePasswordPreferences(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, String validationPolicyId) { final String UPDATE_PASSWORD_PREFERENCES_URL = PASSWORD_PREFERENCES_URL + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------UPDATE PASSWORD PREFERENCE---------------------------------------------"); + LOG.info("---------------------------------UPDATE PASSWORD PREFERENCE---------------------------------------------"); return Utils.performServerPut(requestSpec, responseSpec, UPDATE_PASSWORD_PREFERENCES_URL, updatePreferencesAsJson(validationPolicyId), ""); } public static Object updateWithInvalidValidationPolicyId(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,String invalidValidationPolicyId, String jsonAttributeToGetback) { final String UPDATE_PASSWORD_PREFERENCES_URL = PASSWORD_PREFERENCES_URL + "?" + Utils.TENANT_IDENTIFIER; - System.out - .println("---------------------------------UPDATE PASSWORD PREFERENCES WITH INVALID ID-----------------------------------------"); + LOG.info("---------------------------------UPDATE PASSWORD PREFERENCES WITH INVALID ID-----------------------------------------"); return Utils.performServerPut(requestSpec, responseSpec, UPDATE_PASSWORD_PREFERENCES_URL, updatePreferencesWithInvalidId(invalidValidationPolicyId), jsonAttributeToGetback); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/PaymentTypeHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/PaymentTypeHelper.java index 9f207db79ec..00db6997807 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/PaymentTypeHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/PaymentTypeHelper.java @@ -25,16 +25,18 @@ import com.jayway.restassured.specification.RequestSpecification; import com.jayway.restassured.specification.ResponseSpecification; import java.util.HashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked" }) public class PaymentTypeHelper { - + private final static Logger LOG = LoggerFactory.getLogger(PaymentTypeHelper.class); private static final String CREATE_PAYMENTTYPE_URL = "/fineract-provider/api/v1/paymenttypes?" + Utils.TENANT_IDENTIFIER; private static final String PAYMENTTYPE_URL = "/fineract-provider/api/v1/paymenttypes"; public static Integer createPaymentType(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String name, final String description, final Boolean isCashPayment, final Integer position) { - System.out.println("---------------------------------CREATING A PAYMENT TYPE---------------------------------------------"); + LOG.info("---------------------------------CREATING A PAYMENT TYPE---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_PAYMENTTYPE_URL, getJsonToCreatePaymentType(name, description, isCashPayment, position), "resourceId"); } @@ -47,13 +49,13 @@ public static String getJsonToCreatePaymentType(final String name, final String hm.put("isCashPayment", isCashPayment); if (position != null) hm.put("position", position); - System.out.println("------------------------CREATING PAYMENT TYPE-------------------------" + hm); + LOG.info("------------------------CREATING PAYMENT TYPE-------------------------" + hm); return new Gson().toJson(hm); } public static void verifyPaymentTypeCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedPaymentTypeID) { - System.out.println("------------------------------CHECK PAYMENT DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK PAYMENT DETAILS------------------------------------\n"); final String GET_PAYMENTTYPE_URL = PAYMENTTYPE_URL + "/" + generatedPaymentTypeID + "?" + Utils.TENANT_IDENTIFIER; final Integer responsePaymentTypeID = Utils.performServerGet(requestSpec, responseSpec, GET_PAYMENTTYPE_URL, "id"); assertEquals("ERROR IN CREATING THE PAYMENT TYPE", generatedPaymentTypeID, responsePaymentTypeID); @@ -62,7 +64,7 @@ public static void verifyPaymentTypeCreatedOnServer(final RequestSpecification r public static PaymentTypeDomain retrieveById(RequestSpecification requestSpec, ResponseSpecification responseSpec, final Integer paymentTypeId) { final String GET_PAYMENTTYPE_URL = PAYMENTTYPE_URL + "/" + paymentTypeId + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------GET PAYMENT TYPE---------------------------------------------"); + LOG.info("---------------------------------GET PAYMENT TYPE---------------------------------------------"); Object get = Utils.performServerGet(requestSpec, responseSpec, GET_PAYMENTTYPE_URL, ""); final String jsonData = new Gson().toJson(get); return new Gson().fromJson(jsonData, new TypeToken() {}.getType()); @@ -72,7 +74,7 @@ public static PaymentTypeDomain retrieveById(RequestSpecification requestSpec, R public static HashMap updatePaymentType(final int id, HashMap request, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String UPDATE_PAYMENTTYPE_URL = PAYMENTTYPE_URL + "/" + id + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------UPDATE PAYMENT TYPE " + id + "---------------------------------------------"); + LOG.info("---------------------------------UPDATE PAYMENT TYPE " + id + "---------------------------------------------"); HashMap hash = Utils.performServerPut(requestSpec, responseSpec, UPDATE_PAYMENTTYPE_URL, new Gson().toJson(request), "changes"); return hash; @@ -80,7 +82,7 @@ public static HashMap updatePaymentType(final int id, HashMap re public static Integer deletePaymentType(final int id, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String DELETE_PAYMENTTYPE_URL = PAYMENTTYPE_URL + "/" + id + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------DELETING PAYMENT TYPE " + id + "--------------------------------------------"); + LOG.info("---------------------------------DELETING PAYMENT TYPE " + id + "--------------------------------------------"); return Utils.performServerDelete(requestSpec, responseSpec, DELETE_PAYMENTTYPE_URL, "resourceId"); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ProvisioningIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ProvisioningIntegrationTest.java index 9eccc902353..32d4dfcaf8a 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ProvisioningIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ProvisioningIntegrationTest.java @@ -44,10 +44,12 @@ import org.junit.Assume; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked" }) public class ProvisioningIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(ProvisioningIntegrationTest.class); private static final String NONE = "1"; private final static int LOANPRODUCTS_SIZE = 10; @@ -84,7 +86,7 @@ public void testCreateProvisioningCriteria() { loanStatusHashMap = this.loanTransactionHelper.approveLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); loans.add(loanID); @@ -181,7 +183,7 @@ private void checkProperty(String propertyName, Map requestMap, Map newMap) { } private Integer createLoanProduct(final boolean multiDisburseLoan, final String accountingRule, final Account... accounts) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); LoanProductTestBuilder builder = new LoanProductTestBuilder() // .withPrincipal("1,00,000.00") // .withNumberOfRepayments("4") // @@ -203,7 +205,7 @@ private Integer createLoanProduct(final boolean multiDisburseLoan, final String private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID, List charges, final String savingsId, String principal) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) // .withLoanTermFrequency("4") // diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java index 6c2505ffdf7..d1f003f37ab 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java @@ -25,10 +25,12 @@ import java.util.ArrayList; import java.util.HashMap; import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked" }) public class SchedulerJobHelper { - + private final static Logger LOG = LoggerFactory.getLogger(SchedulerJobHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -39,7 +41,7 @@ public SchedulerJobHelper(final RequestSpecification requestSpec, final Response public static ArrayList getAllSchedulerJobs(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String GET_ALL_SCHEDULER_JOBS_URL = "/fineract-provider/api/v1/jobs?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING ALL SCHEDULER JOBS -------------------------"); + LOG.info("------------------------ RETRIEVING ALL SCHEDULER JOBS -------------------------"); final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, GET_ALL_SCHEDULER_JOBS_URL, ""); return response; } @@ -47,14 +49,14 @@ public static ArrayList getAllSchedulerJobs(final RequestSpecification requestSp public static HashMap getSchedulerJobById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String jobId) { final String GET_SCHEDULER_JOB_BY_ID_URL = "/fineract-provider/api/v1/jobs/" + jobId + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING SCHEDULER JOB BY ID -------------------------"); + LOG.info("------------------------ RETRIEVING SCHEDULER JOB BY ID -------------------------"); final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_SCHEDULER_JOB_BY_ID_URL, ""); return response; } public static HashMap getSchedulerStatus(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String GET_SCHEDULER_STATUS_URL = "/fineract-provider/api/v1/scheduler?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING SCHEDULER STATUS -------------------------"); + LOG.info("------------------------ RETRIEVING SCHEDULER STATUS -------------------------"); final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_SCHEDULER_STATUS_URL, ""); return response; } @@ -62,14 +64,14 @@ public static HashMap getSchedulerStatus(final RequestSpecification requestSpec, public static void updateSchedulerStatus(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String command) { final String UPDATE_SCHEDULER_STATUS_URL = "/fineract-provider/api/v1/scheduler?command=" + command + "&" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ UPDATING SCHEDULER STATUS -------------------------"); + LOG.info("------------------------ UPDATING SCHEDULER STATUS -------------------------"); Utils.performServerPost(requestSpec, responseSpec, UPDATE_SCHEDULER_STATUS_URL, runSchedulerJobAsJSON(), null); } public static HashMap updateSchedulerJob(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String jobId, final String active) { final String UPDATE_SCHEDULER_JOB_URL = "/fineract-provider/api/v1/jobs/" + jobId + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ UPDATING SCHEDULER JOB -------------------------"); + LOG.info("------------------------ UPDATING SCHEDULER JOB -------------------------"); final HashMap response = Utils.performServerPut(requestSpec, responseSpec, UPDATE_SCHEDULER_JOB_URL, updateSchedulerJobAsJSON(active), "changes"); return response; @@ -78,14 +80,14 @@ public static HashMap updateSchedulerJob(final RequestSpecification requestSpec, public static String updateSchedulerJobAsJSON(final String active) { final HashMap map = new HashMap<>(); map.put("active", active); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static ArrayList getSchedulerJobHistory(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String jobId) { final String GET_SCHEDULER_STATUS_URL = "/fineract-provider/api/v1/jobs/" + jobId + "/runhistory?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING SCHEDULER JOB HISTORY -------------------------"); + LOG.info("------------------------ RETRIEVING SCHEDULER JOB HISTORY -------------------------"); final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_SCHEDULER_STATUS_URL, ""); return (ArrayList) response.get("pageItems"); } @@ -93,14 +95,14 @@ public static ArrayList getSchedulerJobHistory(final RequestSpecification reques public static void runSchedulerJob(final RequestSpecification requestSpec, final String jobId) { final ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(202).build(); final String RUN_SCHEDULER_JOB_URL = "/fineract-provider/api/v1/jobs/" + jobId + "?command=executeJob&" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RUN SCHEDULER JOB -------------------------"); + LOG.info("------------------------ RUN SCHEDULER JOB -------------------------"); Utils.performServerPost(requestSpec, responseSpec, RUN_SCHEDULER_JOB_URL, runSchedulerJobAsJSON(), null); } public static String runSchedulerJobAsJSON() { final HashMap map = new HashMap<>(); String runSchedulerJob = new Gson().toJson(map); - System.out.println(runSchedulerJob); + LOG.info(runSchedulerJob); return runSchedulerJob; } @@ -124,15 +126,15 @@ public void executeJob(String JobName) throws InterruptedException { Thread.sleep(15000); schedulerJob = getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString()); Assert.assertNotNull(schedulerJob); - System.out.println("Job is Still Running"); + LOG.info("Job is Still Running"); } ArrayList jobHistoryData = getSchedulerJobHistory(this.requestSpec, this.responseSpec, jobId.toString()); // print error associated with recent job failure (if any) - System.out.println("Job run error message (printed only if the job fails: " + LOG.info("Job run error message (printed only if the job fails: " + jobHistoryData.get(jobHistoryData.size() - 1).get("jobRunErrorMessage")); - System.out.println("Job failure error log (printed only if the job fails: " + LOG.info("Job failure error log (printed only if the job fails: " + jobHistoryData.get(jobHistoryData.size() - 1).get("jobRunErrorLog")); // Verifying the Status of the Recently executed Scheduler Job diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/StandingInstructionsHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/StandingInstructionsHelper.java index 1cc39e33369..4eafa59d012 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/StandingInstructionsHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/StandingInstructionsHelper.java @@ -23,10 +23,12 @@ import com.jayway.restassured.specification.ResponseSpecification; import java.util.HashMap; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({"unused", "rawtypes", "unchecked" }) public class StandingInstructionsHelper { - + private final static Logger LOG = LoggerFactory.getLogger(StandingInstructionsHelper.class); private static final String STANDING_INSTRUCTIONS_URL = "/fineract-provider/api/v1/standinginstructions"; private static final String STANDING_INSTRUCTIONS_RUNHISTORY_URL = "/fineract-provider/api/v1/standinginstructionrunhistory"; private static final String LOCALE = "en_GB"; @@ -88,13 +90,13 @@ public String build(final String clientId, final String fromAccountId, final Str map.put("recurrenceFrequency", RECURRENCE_FREQUENCY_WEEKS); map.put("recurrenceOnMonthDay", monthDay); String savingsApplicationJSON = new Gson().toJson(map); - System.out.println(savingsApplicationJSON); + LOG.info(savingsApplicationJSON); return savingsApplicationJSON; } public Integer createStandingInstruction(final String clientId, final String fromAccountId, final String toAccountId, final String fromAccountType, final String toAccountType, final String validFrom, final String validTo, final String monthDay) { - System.out.println("-------------------------------- CREATE STANDING INSTRUCTIONS --------------------------------"); + LOG.info("-------------------------------- CREATE STANDING INSTRUCTIONS --------------------------------"); final String standingInstructionAsJSON = new StandingInstructionsHelper(this.requestSpec, this.responseSpec) // .build(clientId.toString(), fromAccountId.toString(), toAccountId.toString(), fromAccountType, toAccountType, validFrom, validTo, monthDay); @@ -104,7 +106,7 @@ public Integer createStandingInstruction(final String clientId, final String fro public HashMap getStandingInstructionById(final String standingInstructionId) { - System.out.println("----------------------------- RETRIEVING STANDING INSTRUCTION BY ID---------------------------"); + LOG.info("----------------------------- RETRIEVING STANDING INSTRUCTION BY ID---------------------------"); final String GET_STANDING_INSTRUCTION_BY_ID_URL = STANDING_INSTRUCTIONS_URL + "/" + standingInstructionId + "?" + Utils.TENANT_IDENTIFIER; final HashMap response = Utils.performServerGet(this.requestSpec, this.responseSpec, GET_STANDING_INSTRUCTION_BY_ID_URL, ""); @@ -115,7 +117,7 @@ public List getStandingInstructionHistory(Integer fromSavingsId, Intege final String STANDING_INSTRUCTIONS_HISTORY_URL = STANDING_INSTRUCTIONS_RUNHISTORY_URL + "?" + Utils.TENANT_IDENTIFIER + "&fromSavingsId=" + fromSavingsId + "&fromAccountType=" + fromAccountType + "&clientId=" + fromClientId + "&transferType=" + transferType; - System.out.println("STANDING_INSTRUCTIONS_HISTORY_URL="+STANDING_INSTRUCTIONS_HISTORY_URL); + LOG.info("STANDING_INSTRUCTIONS_HISTORY_URL="+STANDING_INSTRUCTIONS_HISTORY_URL); final List response = (List) Utils.performServerGet(this.requestSpec, this.responseSpec, STANDING_INSTRUCTIONS_HISTORY_URL, "pageItems"); return response; diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SurveyHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SurveyHelper.java index b4865ab56cf..d4c94ac088e 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SurveyHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SurveyHelper.java @@ -24,9 +24,11 @@ import com.jayway.restassured.specification.RequestSpecification; import com.jayway.restassured.specification.ResponseSpecification; import java.util.HashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SurveyHelper { - + private final static Logger LOG = LoggerFactory.getLogger(SurveyHelper.class); private static final String FULFIL_SURVEY_URL = "/fineract-provider/api/v1/survey/ppi_kenya_2009/clientId?" + Utils.TENANT_IDENTIFIER; public static Integer fulfilSurvey(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { @@ -35,7 +37,7 @@ public static Integer fulfilSurvey(final RequestSpecification requestSpec, final public static Integer fulfilSurvey(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String activationDate) { - System.out.println("---------------------------------FULFIL PPI ---------------------------------------------"); + LOG.info("---------------------------------FULFIL PPI ---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec,FULFIL_SURVEY_URL, getTestPPIAsJSON(), "clientId"); } @@ -57,13 +59,13 @@ public static String getTestPPIAsJSON() { map.put("ppi_towels_cd_q9_towels", "134"); map.put("ppi_fryingpans_cd_q10_fryingpans", "138"); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } public static void verifySurveyCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedClientID) { - System.out.println("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); final String SURVEY_URL = "/fineract-provider/api/v1/Survey/ppi_kenya_2009/clientid/entryId" + generatedClientID + "?" + Utils.TENANT_IDENTIFIER; final Integer responseClientID = Utils.performServerGet(requestSpec, responseSpec, SURVEY_URL, "id"); assertEquals("ERROR IN CREATING THE CLIENT", generatedClientID, responseClientID); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/TaxComponentHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/TaxComponentHelper.java index b368a9aec03..17404881a9e 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/TaxComponentHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/TaxComponentHelper.java @@ -23,14 +23,16 @@ import com.jayway.restassured.specification.ResponseSpecification; import java.util.HashMap; import org.apache.fineract.integrationtests.common.accounting.Account; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaxComponentHelper { - + private final static Logger LOG = LoggerFactory.getLogger(TaxComponentHelper.class); private static final String CREATE_TAX_COMPONENT_URL = "/fineract-provider/api/v1/taxes/component?" + Utils.TENANT_IDENTIFIER; public static Integer createTaxComponent(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String percentage, final Integer liabilityAccountId) { - System.out.println("---------------------------------CREATING A TAX COMPONENT---------------------------------------------"); + LOG.info("---------------------------------CREATING A TAX COMPONENT---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_TAX_COMPONENT_URL, getTaxComponentAsJSON(percentage, liabilityAccountId), "resourceId"); } @@ -41,7 +43,7 @@ public static String getTaxComponentAsJSON(final String percentage, final Intege map.put("creditAccountType", Account.AccountType.LIABILITY.toString()); map.put("creditAcountId", String.valueOf(creditAccountId)); } - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/TaxGroupHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/TaxGroupHelper.java index 72562e8142f..9ef3b61d90c 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/TaxGroupHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/TaxGroupHelper.java @@ -25,14 +25,16 @@ import java.util.Collection; import java.util.HashMap; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaxGroupHelper { - + private final static Logger LOG = LoggerFactory.getLogger(TaxGroupHelper.class); private static final String CREATE_TAX_COMPONENT_URL = "/fineract-provider/api/v1/taxes/group?" + Utils.TENANT_IDENTIFIER; public static Integer createTaxGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Collection taxComponentIds) { - System.out.println("---------------------------------CREATING A TAX GROUP---------------------------------------------"); + LOG.info("---------------------------------CREATING A TAX GROUP---------------------------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_TAX_COMPONENT_URL, getTaxGroupAsJSON(taxComponentIds), "resourceId"); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java index ee7afa36079..245711fd514 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java @@ -51,7 +51,7 @@ */ @SuppressWarnings("unchecked") public class Utils { - + private final static Logger LOG = LoggerFactory.getLogger(Utils.class); private final static Logger logger = LoggerFactory.getLogger(Utils.class); public static final String TENANT_PARAM_NAME = "tenantIdentifier"; @@ -114,7 +114,7 @@ public static String loginIntoServerAndGetBase64EncodedAuthenticationKey() { awaitSpringBootActuatorHealthyUp(); try { logger.info("Logging in, for integration test..."); - System.out.println("-----------------------------------LOGIN-----------------------------------------"); + LOG.info("-----------------------------------LOGIN-----------------------------------------"); String json = RestAssured.given().contentType(ContentType.JSON) .body("{\"username\":\"mifos\", \"password\":\"password\"}") .expect().log().ifError().when().post(LOGIN_URL).asString(); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/WorkingDaysHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/WorkingDaysHelper.java index 0f6841da1b5..357c96f84d7 100755 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/WorkingDaysHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/WorkingDaysHelper.java @@ -23,22 +23,23 @@ import com.jayway.restassured.specification.ResponseSpecification; import java.util.HashMap; import java.util.Random; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WorkingDaysHelper { private static final String WORKINGDAYS_URL = "/fineract-provider/api/v1/workingdays"; - + private final static Logger LOG = LoggerFactory.getLogger(WorkingDaysHelper.class); public static Object updateWorkingDays(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String UPDATE_WORKINGDAYS_URL = WORKINGDAYS_URL + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("---------------------------------UPDATE WORKINGDAY---------------------------------------------"); + LOG.info("---------------------------------UPDATE WORKINGDAY---------------------------------------------"); return Utils.performServerPut(requestSpec, responseSpec, UPDATE_WORKINGDAYS_URL, updateWorkingDaysAsJson(), ""); } public static Object updateWorkingDaysWithWrongRecurrence(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, String jsonAttributeToGetback) { final String UPDATE_WORKINGDAYS_URL = WORKINGDAYS_URL + "?" + Utils.TENANT_IDENTIFIER; - System.out - .println("---------------------------------UPDATE WORKINGDAY WITH WRONG RECURRENCE-----------------------------------------"); + LOG.info("---------------------------------UPDATE WORKINGDAY WITH WRONG RECURRENCE-----------------------------------------"); return Utils.performServerPut(requestSpec, responseSpec, UPDATE_WORKINGDAYS_URL, updateWorkingDayWithWrongRecur(), jsonAttributeToGetback); } @@ -49,7 +50,7 @@ public static String updateWorkingDaysAsJson() { map.put("locale", "en"); map.put("repaymentRescheduleType", new Random().nextInt(4) + 1); map.put("extendTermForDailyRepayments", false); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -59,7 +60,7 @@ public static String updateWorkingDayWithWrongRecur() { map.put("locale", "en"); map.put("repaymentRescheduleType", new Random().nextInt(4) + 1); map.put("extendTermForDailyRepayments", false); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } 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 0e5a638ed98..20ec23ad204 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 @@ -26,10 +26,12 @@ import org.apache.fineract.integrationtests.common.CommonConstants; import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.portfolio.charge.domain.ChargeTimeType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked" }) public class ChargesHelper { - + private final static Logger LOG = LoggerFactory.getLogger(ChargesHelper.class); private static final String CHARGES_URL = "/fineract-provider/api/v1/charges"; private static final String CREATE_CHARGES_URL = CHARGES_URL + "?" + Utils.TENANT_IDENTIFIER; @@ -81,7 +83,7 @@ public static String getSavingsSpecifiedDueDateJSON() { map.put("chargeTimeType", CHARGE_SPECIFIED_DUE_DATE); map.put("feeInterval", 2); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -101,7 +103,7 @@ public static String getSavingsJSON(String amount, String currencyCode, ChargeTi final HashMap map = populateDefaultsForSavings(amount.toString(), currencyCode); map.put("chargeTimeType", timeType.getValue()); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -110,7 +112,7 @@ public static String getSavingsAnnualFeeJSON() { map.put("feeOnMonthDay", ChargesHelper.feeOnMonthDay); map.put("chargeTimeType", CHARGE_ANNUAL_FEE); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -120,7 +122,7 @@ public static String getSavingsMonthlyFeeJSON() { map.put("chargeTimeType", CHARGE_MONTHLY_FEE); map.put("feeInterval", 2); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -129,7 +131,7 @@ public static String getSavingsWeeklyFeeJSON() { map.put("chargeTimeType", WEEKLY_FEE); map.put("feeInterval", 1); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -137,7 +139,7 @@ public static String getSavingsOverdraftFeeJSON() { final HashMap map = populateDefaultsForSavings(); map.put("chargeTimeType", CHARGE_OVERDRAFT_FEE); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -177,7 +179,7 @@ public static String getLoanDisbursementJSON(final Integer chargeCalculationType map.put("amount", amount); map.put("chargeCalculationType", chargeCalculationType); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -199,7 +201,7 @@ public static String getLoanSpecifiedDueDateJSON(final Integer chargeCalculation map.put("chargeCalculationType", chargeCalculationType); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -227,7 +229,7 @@ public static String getLoanInstallmentJSON(final Integer chargeCalculationType, map.put("chargeCalculationType", chargeCalculationType); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -242,21 +244,21 @@ public static String getLoanInstallmentFeeJSON() { public static String getShareAccountActivationChargeJson() { HashMap map = populateDefaultsShareActivationCharge() ; String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } public static String getShareAccountPurchaseChargeJson() { HashMap map = populateDefaultsSharePurchaseFlatCharge() ; String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } public static String getShareAccountRedeemChargeJson() { HashMap map = populateDefaultsShareRedeemFlatCharge() ; String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -269,7 +271,7 @@ public static String getLoanOverdueFeeJSON() { map.put("feeOnMonthDay", ChargesHelper.feeOnMonthDay); map.put("feeInterval", 2); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -281,7 +283,7 @@ public static String getLoanOverdueFeeJSONWithCalculattionTypePercentage(String map.put("chargeTimeType", CHARGE_OVERDUE_INSTALLMENT_FEE); map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST); String chargesCreateJson = new Gson().toJson(map); - System.out.println(chargesCreateJson); + LOG.info(chargesCreateJson); return chargesCreateJson; } @@ -388,7 +390,7 @@ public static String getModifyChargeJSON() { map.put("locale", CommonConstants.locale); map.put("amount", "200.0"); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -397,7 +399,7 @@ public static String getModifyWithdrawalFeeSavingsChargeJSON() { map.put("locale", CommonConstants.locale); map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -407,7 +409,7 @@ public static String getModifyChargeAsPecentageAmountJSON() { map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT); map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -417,7 +419,7 @@ public static String getModifyChargeAsPecentageLoanAmountWithInterestJSON() { map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST); map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -427,7 +429,7 @@ public static String getModifyChargeAsPercentageInterestJSON() { map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST); map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -437,7 +439,7 @@ public static String getModifyChargeFeeFrequencyAsDaysJSON() { map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_DAYS); map.put("feeInterval", 2); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -447,7 +449,7 @@ public static String getModifyChargeFeeFrequencyAsWeeksJSON() { map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_WEEKS); map.put("feeInterval", 2); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -457,7 +459,7 @@ public static String getModifyChargeFeeFrequencyAsMonthsJSON() { map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS); map.put("feeInterval", 2); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -467,14 +469,14 @@ public static String getModifyChargeFeeFrequencyAsYearsJSON() { map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_YEARS); map.put("feeInterval", 2); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } public static String getChargeSpecifiedDueDateJSON() { final HashMap map = populateDefaultsClientCharge(); String chargesCreateJson = new Gson().toJson(map); - System.out.println("chargesCreateJson:"+chargesCreateJson); + LOG.info("chargesCreateJson:"+chargesCreateJson); return chargesCreateJson; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java index 045e00a0d01..04469b43e3b 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java @@ -26,10 +26,12 @@ import java.util.HashMap; import org.apache.fineract.integrationtests.common.CommonConstants; import org.apache.fineract.integrationtests.common.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "unused", "rawtypes" }) public class FixedDepositAccountHelper { - + private final static Logger LOG = LoggerFactory.getLogger(FixedDepositAccountHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -126,13 +128,13 @@ public String build(final String clientId, final String productId, final String map.put("transferInterestToSavings", transferInterest); String fixedDepositAccountJson = new Gson().toJson(map); - System.out.println(fixedDepositAccountJson); + LOG.info(fixedDepositAccountJson); return fixedDepositAccountJson; } public static Integer applyFixedDepositApplication(final String fixedDepositAccountAsJson, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - System.out.println("--------------------- APPLYING FOR FIXED DEPOSIT ACCOUNT ------------------------"); + LOG.info("--------------------- APPLYING FOR FIXED DEPOSIT ACCOUNT ------------------------"); return Utils.performServerPost(requestSpec, responseSpec, APPLY_FIXED_DEPOSIT_ACCOUNT_URL, fixedDepositAccountAsJson, CommonConstants.RESPONSE_RESOURCE_ID); } @@ -140,7 +142,7 @@ public static Integer applyFixedDepositApplication(final String fixedDepositAcco public static HashMap getFixedDepositAccountById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer accountID) { final String GET_FIXED_DEPOSIT_BY_ID_URL = FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING FIXED DEPOSIT ACCOUNT BY ID -------------------------"); + LOG.info("------------------------ RETRIEVING FIXED DEPOSIT ACCOUNT BY ID -------------------------"); return Utils.performServerGet(requestSpec, responseSpec, GET_FIXED_DEPOSIT_BY_ID_URL, ""); } @@ -194,8 +196,6 @@ public static Float getPrincipalAfterCompoundingInterest(Calendar currentDate, F principal += totalInterest; } totalInterest = 0.0f; - System.out.println(principal); - } currentDate.add(Calendar.MONTH, 1); interestEarned = 0.0f; @@ -232,60 +232,60 @@ public HashMap updateInterestCalculationConfigForFixedDeposit(final String clien } public HashMap approveFixedDeposit(final Integer fixedDepositAccountID, final String approvedOnDate) { - System.out.println("--------------------------------- APPROVING FIXED DEPOSIT APPLICATION ------------------------------------"); + LOG.info("--------------------------------- APPROVING FIXED DEPOSIT APPLICATION ------------------------------------"); return performFixedDepositApplicationActions(createFixedDepositOperationURL(APPROVE_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID), getApproveFixedDepositAccountAsJSON(approvedOnDate)); } public HashMap undoApproval(final Integer fixedDepositAccountID) { - System.out.println("--------------------------------- UNDO APPROVING FIXED DEPOSIT APPLICATION -------------------------------"); + LOG.info("--------------------------------- UNDO APPROVING FIXED DEPOSIT APPLICATION -------------------------------"); final String undoBodyJson = "{'note':'UNDO APPROVAL'}"; return performFixedDepositApplicationActions( createFixedDepositOperationURL(UNDO_APPROVAL_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID), undoBodyJson); } public HashMap rejectApplication(final Integer fixedDepositAccountID, final String rejectedOnDate) { - System.out.println("--------------------------------- REJECT FIXED DEPOSIT APPLICATION -------------------------------"); + LOG.info("--------------------------------- REJECT FIXED DEPOSIT APPLICATION -------------------------------"); return performFixedDepositApplicationActions(createFixedDepositOperationURL(REJECT_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID), getRejectedFixedDepositAsJSON(rejectedOnDate)); } public HashMap withdrawApplication(final Integer fixedDepositAccountID, final String withdrawApplicationOnDate) { - System.out.println("--------------------------------- Withdraw FIXED DEPOSIT APPLICATION -------------------------------"); + LOG.info("--------------------------------- Withdraw FIXED DEPOSIT APPLICATION -------------------------------"); return performFixedDepositApplicationActions( createFixedDepositOperationURL(WITHDRAWN_BY_CLIENT_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID), getWithdrawnFixedDepositAccountAsJSON(withdrawApplicationOnDate)); } public HashMap activateFixedDeposit(final Integer fixedDepositAccountID, final String activationDate) { - System.out.println("---------------------------------- ACTIVATING FIXED DEPOSIT APPLICATION ----------------------------------"); + LOG.info("---------------------------------- ACTIVATING FIXED DEPOSIT APPLICATION ----------------------------------"); return performFixedDepositApplicationActions(createFixedDepositOperationURL(ACTIVATE_FIXED_DEPOSIT_COMMAND, fixedDepositAccountID), getActivatedFixedDepositAccountAsJSON(activationDate)); } public Object deleteFixedDepositApplication(final Integer fixedDepositAccountID, final String jsonAttributeToGetBack) { - System.out.println("---------------------------------- DELETE FIXED DEPOSIT APPLICATION ----------------------------------"); + LOG.info("---------------------------------- DELETE FIXED DEPOSIT APPLICATION ----------------------------------"); return Utils.performServerDelete(this.requestSpec, this.responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "/" + fixedDepositAccountID + "?" + Utils.TENANT_IDENTIFIER, jsonAttributeToGetBack); } public Integer calculateInterestForFixedDeposit(final Integer fixedDepositAccountId) { - System.out.println("--------------------------------- CALCULATING INTEREST FOR FIXED DEPOSIT --------------------------------"); + LOG.info("--------------------------------- CALCULATING INTEREST FOR FIXED DEPOSIT --------------------------------"); return (Integer) performFixedDepositActions( createFixedDepositCalculateInterestURL(CALCULATE_INTEREST_FIXED_DEPOSIT_COMMAND, fixedDepositAccountId), getCalculatedInterestForFixedDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID); } public Integer postInterestForFixedDeposit(final Integer fixedDepositAccountId) { - System.out.println("--------------------------------- POST INTEREST FOR FIXED DEPOSIT --------------------------------"); + LOG.info("--------------------------------- POST INTEREST FOR FIXED DEPOSIT --------------------------------"); return (Integer) performFixedDepositActions( createFixedDepositCalculateInterestURL(POST_INTEREST_FIXED_DEPOSIT_COMMAND, fixedDepositAccountId), getCalculatedInterestForFixedDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID); } public HashMap calculatePrematureAmountForFixedDeposit(final Integer fixedDepositAccountId, final String closedOnDate) { - System.out.println("--------------------- CALCULATING PREMATURE AMOUNT FOR FIXED DEPOSIT ----------------------------"); + LOG.info("--------------------- CALCULATING PREMATURE AMOUNT FOR FIXED DEPOSIT ----------------------------"); return (HashMap) performFixedDepositActions( createFixedDepositCalculateInterestURL(CALCULATE_PREMATURE_AMOUNT_COMMAND, fixedDepositAccountId), getCalculatedPrematureAmountForFixedDepositAccountAsJSON(closedOnDate), ""); @@ -293,7 +293,7 @@ public HashMap calculatePrematureAmountForFixedDeposit(final Integer fixedDeposi public Object prematureCloseForFixedDeposit(final Integer fixedDepositAccountId, final String closedOnDate, final String closureType, final Integer toSavingsId, final String jsonAttributeToGetBack) { - System.out.println("--------------------- PREMATURE CLOSE FOR FIXED DEPOSIT ----------------------------"); + LOG.info("--------------------- PREMATURE CLOSE FOR FIXED DEPOSIT ----------------------------"); return performFixedDepositActions(createFixedDepositCalculateInterestURL(PREMATURE_CLOSE_COMMAND, fixedDepositAccountId), getPrematureCloseForFixedDepositAccountAsJSON(closedOnDate, closureType, toSavingsId), jsonAttributeToGetBack); } @@ -305,7 +305,7 @@ private String getApproveFixedDepositAccountAsJSON(final String approvedOnDate) map.put("approvedOnDate", approvedOnDate); map.put("note", "Approval NOTE"); String fixedDepositAccountApproveJson = new Gson().toJson(map); - System.out.println(fixedDepositAccountApproveJson); + LOG.info(fixedDepositAccountApproveJson); return fixedDepositAccountApproveJson; } @@ -316,7 +316,7 @@ private String getRejectedFixedDepositAsJSON(final String rejectedOnDate) { map.put("rejectedOnDate", rejectedOnDate); map.put("note", "Rejected NOTE"); String fixedDepositAccountJson = new Gson().toJson(map); - System.out.println(fixedDepositAccountJson); + LOG.info(fixedDepositAccountJson); return fixedDepositAccountJson; } @@ -327,7 +327,7 @@ private String getWithdrawnFixedDepositAccountAsJSON(final String withdrawnAppli map.put("withdrawnOnDate", withdrawnApplicationOnDate); map.put("note", "Withdraw NOTE"); String fixedDepositAccountJson = new Gson().toJson(map); - System.out.println(fixedDepositAccountJson); + LOG.info(fixedDepositAccountJson); return fixedDepositAccountJson; } @@ -337,14 +337,14 @@ private String getActivatedFixedDepositAccountAsJSON(final String activationDate map.put("dateFormat", CommonConstants.dateFormat); map.put("activatedOnDate", activationDate); String fixedDepositAccountActivateJson = new Gson().toJson(map); - System.out.println(fixedDepositAccountActivateJson); + LOG.info(fixedDepositAccountActivateJson); return fixedDepositAccountActivateJson; } private String getCalculatedInterestForFixedDepositApplicationAsJSON() { final HashMap map = new HashMap<>(); String fixedDepositAccountCalculatedInterestJson = new Gson().toJson(map); - System.out.println(fixedDepositAccountCalculatedInterestJson); + LOG.info(fixedDepositAccountCalculatedInterestJson); return fixedDepositAccountCalculatedInterestJson; } @@ -354,7 +354,7 @@ private String getCalculatedPrematureAmountForFixedDepositAccountAsJSON(final St map.put("dateFormat", CommonConstants.dateFormat); map.put("closedOnDate", closedOnDate); String fixedDepositAccountPrematureClosureJson = new Gson().toJson(map); - System.out.println(fixedDepositAccountPrematureClosureJson); + LOG.info(fixedDepositAccountPrematureClosureJson); return fixedDepositAccountPrematureClosureJson; } @@ -370,7 +370,7 @@ private String getPrematureCloseForFixedDepositAccountAsJSON(final String closed map.put("transferDescription", "Transferring To Savings Account"); } String fixedDepositAccountPrematureCloseJson = new Gson().toJson(map); - System.out.println(fixedDepositAccountPrematureCloseJson); + LOG.info(fixedDepositAccountPrematureCloseJson); return fixedDepositAccountPrematureCloseJson; } @@ -398,7 +398,7 @@ private String createFixedDepositCalculateInterestURL(final String command, fina } public static ArrayList retrieveAllFixedDepositAccounts(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - System.out.println("-------------------- RETRIEVING ALL FIXED DEPOSIT ACCOUNTS ---------------------"); + LOG.info("-------------------- RETRIEVING ALL FIXED DEPOSIT ACCOUNTS ---------------------"); final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "?" + Utils.TENANT_IDENTIFIER, ""); return response; diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountStatusChecker.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountStatusChecker.java index 81bda5fab19..b6b7e0a18ac 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountStatusChecker.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountStatusChecker.java @@ -25,52 +25,47 @@ import java.util.HashMap; import org.apache.fineract.integrationtests.common.Utils; import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings("rawtypes") public class FixedDepositAccountStatusChecker { - + private final static Logger LOG = LoggerFactory.getLogger(FixedDepositAccountStatusChecker.class); private static final String FIXED_DEPOSIT_ACCOUNT_URL = "/fineract-provider/api/v1/fixeddepositaccounts"; public static void verifyFixedDepositIsApproved(final HashMap fixedDepositStatusHashMap) { - System.out.println("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS APPROVED --------------------"); + LOG.info("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS APPROVED --------------------"); assertTrue("Error in Approving Fixed deposit application", getStatus(fixedDepositStatusHashMap, "approved")); - System.out.println(fixedDepositStatusHashMap); } public static void verifyFixedDepositIsPending(final HashMap fixedDepositStatusHashMap) { - System.out.println("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS PENDING --------------------"); + LOG.info("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS PENDING --------------------"); assertTrue("FIXED DEPOSIT ACCOUNT IS NOT IN PENDING STATE", getStatus(fixedDepositStatusHashMap, "submittedAndPendingApproval")); - System.out.println(fixedDepositStatusHashMap); } public static void verifyFixedDepositIsActive(final HashMap fixedDepositStatusHashMap) { - System.out.println("----------------- VERIFYING FIXED DEPOSIT APPLICATION IS ACTIVE -----------------"); + LOG.info("----------------- VERIFYING FIXED DEPOSIT APPLICATION IS ACTIVE -----------------"); assertTrue("ERROR IN ACTIVATING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "active")); - System.out.println(fixedDepositStatusHashMap); } public static void verifyFixedDepositIsRejected(final HashMap fixedDepositStatusHashMap) { - System.out.println("-------------- VERIFYING FIXED DEPOSIT APPLICATION IS REJECTED ----------------"); + LOG.info("-------------- VERIFYING FIXED DEPOSIT APPLICATION IS REJECTED ----------------"); assertTrue("ERROR IN REJECTING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "rejected")); - System.out.println(fixedDepositStatusHashMap); } public static void verifyFixedDepositIsWithdrawn(final HashMap fixedDepositStatusHashMap) { - System.out.println("---------------- VERIFYING FIXED DEPOSIT APPLICATION IS WITHDRAWN ----------------"); + LOG.info("---------------- VERIFYING FIXED DEPOSIT APPLICATION IS WITHDRAWN ----------------"); assertTrue("ERROR IN WITHDRAW THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "withdrawnByApplicant")); - System.out.println(fixedDepositStatusHashMap); } public static void verifyFixedDepositAccountIsClosed(final HashMap fixedDepositStatusHashMap) { - System.out.println("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------"); + LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------"); assertTrue("ERROR IN CLOSING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "closed")); - System.out.println(fixedDepositStatusHashMap); } public static void verifyFixedDepositAccountIsNotActive(final HashMap fixedDepositStatusHashMap) { - System.out.println("------------------ VERIFYING FIXED DEPOSIT APPLICATION IS INACTIVE --------------------"); + LOG.info("------------------ VERIFYING FIXED DEPOSIT APPLICATION IS INACTIVE --------------------"); Assert.assertFalse(getStatus(fixedDepositStatusHashMap, "active")); - System.out.println(fixedDepositStatusHashMap); } public static HashMap getStatusOfFixedDepositAccount(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, @@ -81,15 +76,13 @@ public static HashMap getStatusOfFixedDepositAccount(final RequestSpecification } public static void verifyFixedDepositAccountIsPrematureClosed(HashMap fixedDepositStatusHashMap) { - System.out.println("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------"); + LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------"); assertTrue("ERROR IN PREMATURELY CLOSING THE FIXED DEPOSIT ACCOUNT", getStatus(fixedDepositStatusHashMap, "prematureClosed")); - System.out.println(fixedDepositStatusHashMap); } public static void verifyFixedDepositAccountIsMatured(HashMap fixedDepositStatusHashMap) { - System.out.println("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS MATURED ---------------------"); + LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS MATURED ---------------------"); assertTrue("ERROR IN MATURITY JOB OF THE FIXED DEPOSIT ACCOUNT", getStatus(fixedDepositStatusHashMap, "matured")); - System.out.println(fixedDepositStatusHashMap); } private static boolean getStatus(final HashMap fixedDepositStatusMap, final String fixedDepositStatusString) { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java index 6e904990461..b3bb4f450c5 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java @@ -28,10 +28,12 @@ import org.apache.fineract.integrationtests.common.CommonConstants; import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.accounting.Account; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "unused", "rawtypes" }) public class FixedDepositProductHelper { - + private final static Logger LOG = LoggerFactory.getLogger(FixedDepositProductHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -147,7 +149,7 @@ public String build(final String validFrom, final String validTo) { } String FixedDepositProductCreateJson = new Gson().toJson(map); - System.out.println(FixedDepositProductCreateJson); + LOG.info(FixedDepositProductCreateJson); return FixedDepositProductCreateJson; } @@ -421,13 +423,13 @@ private Map getAccountMappingForCashBased() { public static Integer createFixedDepositProduct(final String fixedDepositProductCreateJson, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - System.out.println("--------------------- CREATING FIXED DEPOSIT PRODUCT ------------------------"); + LOG.info("--------------------- CREATING FIXED DEPOSIT PRODUCT ------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_FIXED_DEPOSIT_PRODUCT_URL, fixedDepositProductCreateJson, CommonConstants.RESPONSE_RESOURCE_ID); } public static ArrayList retrieveAllFixedDepositProducts(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - System.out.println("-------------------- RETRIEVING ALL FIXED DEPOSIT PRODUCTS ---------------------"); + LOG.info("-------------------- RETRIEVING ALL FIXED DEPOSIT PRODUCTS ---------------------"); final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, FIXED_DEPOSIT_PRODUCT_URL + "?" + Utils.TENANT_IDENTIFIER, ""); return response; @@ -435,7 +437,7 @@ public static ArrayList retrieveAllFixedDepositProducts(final RequestSpecificati public static HashMap retrieveFixedDepositProductById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String productId) { - System.out.println("------------------------ RETRIEVING FIXED DEPOSIT PRODUCT BY ID ------------------------"); + LOG.info("------------------------ RETRIEVING FIXED DEPOSIT PRODUCT BY ID ------------------------"); final String GET_FD_PRODUCT_BY_ID_URL = FIXED_DEPOSIT_PRODUCT_URL + "/" + productId + "?" + Utils.TENANT_IDENTIFIER; final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_FD_PRODUCT_BY_ID_URL, ""); return response; @@ -443,7 +445,7 @@ public static HashMap retrieveFixedDepositProductById(final RequestSpecification public static ArrayList getInterestRateChartSlabsByProductId(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer productId) { - System.out.println("-------------------- RETRIEVE INTEREST CHART BY PRODUCT ID ---------------------"); + LOG.info("-------------------- RETRIEVE INTEREST CHART BY PRODUCT ID ---------------------"); final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, INTEREST_CHART_URL + "?productId=" + productId, "chartSlabs"); return response; 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 b00fabced8d..921ee4dec45 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 @@ -22,9 +22,11 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class LoanApplicationTestBuilder { - + private final static Logger LOG = LoggerFactory.getLogger(LoanApplicationTestBuilder.class); private static final String DAYS = "0"; private static final String WEEKS = "1"; private static final String MONTHS = "2"; @@ -137,7 +139,7 @@ private String build(final HashMap map, final String loanProduct if (datatables != null) { map.put("datatables", this.datatables); } - System.out.println("Loan Application request : " + map); + LOG.info("Loan Application request : " + map); return new Gson().toJson(map); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanTransactionHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanTransactionHelper.java index 82f144e82ca..d8fdae1786c 100755 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanTransactionHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanTransactionHelper.java @@ -38,10 +38,12 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Workbook; import org.joda.time.LocalDate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes", "unchecked" }) public class LoanTransactionHelper { - + private final static Logger LOG = LoggerFactory.getLogger(LoanTransactionHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -153,8 +155,8 @@ public ArrayList getLoanCharges(final Integer loanId) { public HashMap approveLoan(final String approvalDate, final Integer loanID) { String loanApprovalCommand = createLoanOperationURL(APPROVE_LOAN_COMMAND, loanID); String loanApprovalRequest = getApproveLoanAsJSON(approvalDate); - System.out.println("Loan approval command:" + loanApprovalCommand); - System.out.println("Loan approval request:" + loanApprovalRequest); + LOG.info("Loan approval command:" + loanApprovalCommand); + LOG.info("Loan approval request:" + loanApprovalRequest); return performLoanTransaction(loanApprovalCommand, loanApprovalRequest); } @@ -206,16 +208,16 @@ public HashMap disburseLoanToSavings(final String date, final Integer loanID) { public HashMap undoDisbursal(final Integer loanID) { final String undoDisburseJson = "{'note' : 'UNDO DISBURSAL'}"; - System.out.println("IN DISBURSE LOAN"); + LOG.info("IN DISBURSE LOAN"); final String url = createLoanOperationURL(UNDO_DISBURSE_LOAN_COMMAND, loanID); - System.out.println("IN DISBURSE LOAN URL " + url); + LOG.info("IN DISBURSE LOAN URL " + url); return performLoanTransaction(createLoanOperationURL(UNDO_DISBURSE_LOAN_COMMAND, loanID), undoDisburseJson); } public Float undoLastDisbursal(final Integer loanID) { final String undoLastDisburseJson = "{'note' : 'UNDO LAST DISBURSAL'}"; final String url = createLoanOperationURL(UNDO_LAST_DISBURSE_LOAN_COMMAND, loanID); - System.out.println("IN UNDO LAST DISBURSE LOAN URL " + url); + LOG.info("IN UNDO LAST DISBURSE LOAN URL " + url); return performUndoLastLoanDisbursementTransaction(createLoanOperationURL(UNDO_LAST_DISBURSE_LOAN_COMMAND, loanID), undoLastDisburseJson); } @@ -253,7 +255,7 @@ public HashMap withdrawLoanApplicationByClient(final String date, final Integer } public Integer addChargesForLoan(final Integer loanId, final String request) { - System.out.println("--------------------------------- ADD CHARGES FOR LOAN --------------------------------"); + LOG.info("--------------------------------- ADD CHARGES FOR LOAN --------------------------------"); final String ADD_CHARGES_URL = "/fineract-provider/api/v1/loans/" + loanId + "/charges?" + Utils.TENANT_IDENTIFIER; final HashMap response = Utils.performServerPost(requestSpec, responseSpec, ADD_CHARGES_URL, request, ""); return (Integer) response.get("resourceId"); @@ -265,7 +267,7 @@ public Object addChargesForAllreadyDisursedLoan(final Integer loanId, final Stri } public Integer updateChargesForLoan(final Integer loanId, final Integer loanchargeId, final String request) { - System.out.println("--------------------------------- ADD CHARGES FOR LOAN --------------------------------"); + LOG.info("--------------------------------- ADD CHARGES FOR LOAN --------------------------------"); final String UPDATE_CHARGES_URL = "/fineract-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId + "?" + Utils.TENANT_IDENTIFIER; final HashMap response = Utils.performServerPut(requestSpec, responseSpec, UPDATE_CHARGES_URL, request, ""); @@ -273,7 +275,7 @@ public Integer updateChargesForLoan(final Integer loanId, final Integer loanchar } public Integer deleteChargesForLoan(final Integer loanId, final Integer loanchargeId) { - System.out.println("--------------------------------- DELETE CHARGES FOR LOAN --------------------------------"); + LOG.info("--------------------------------- DELETE CHARGES FOR LOAN --------------------------------"); final String DELETE_CHARGES_URL = "/fineract-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId + "?" + Utils.TENANT_IDENTIFIER; final HashMap response = Utils.performServerDelete(requestSpec, responseSpec, DELETE_CHARGES_URL, ""); @@ -281,7 +283,7 @@ public Integer deleteChargesForLoan(final Integer loanId, final Integer loanchar } public Integer waiveChargesForLoan(final Integer loanId, final Integer loanchargeId, final String json) { - System.out.println("--------------------------------- WAIVE CHARGES FOR LOAN --------------------------------"); + LOG.info("--------------------------------- WAIVE CHARGES FOR LOAN --------------------------------"); final String CHARGES_URL = "/fineract-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId + "?command=waive&" + Utils.TENANT_IDENTIFIER; final HashMap response = Utils.performServerPost(requestSpec, responseSpec, CHARGES_URL, json, ""); @@ -289,7 +291,7 @@ public Integer waiveChargesForLoan(final Integer loanId, final Integer loancharg } public Integer payChargesForLoan(final Integer loanId, final Integer loanchargeId, final String json) { - System.out.println("--------------------------------- WAIVE CHARGES FOR LOAN --------------------------------"); + LOG.info("--------------------------------- WAIVE CHARGES FOR LOAN --------------------------------"); final String CHARGES_URL = "/fineract-provider/api/v1/loans/" + loanId + "/charges/" + loanchargeId + "?command=pay&" + Utils.TENANT_IDENTIFIER; final HashMap response = Utils.performServerPost(requestSpec, responseSpec, CHARGES_URL, json, ""); @@ -305,7 +307,7 @@ private String getDisburseLoanAsJSON(final String actualDisbursementDate, final if (transactionAmount != null) { map.put("transactionAmount", transactionAmount); } - System.out.println("Loan Application disburse request : " + map); + LOG.info("Loan Application disburse request : " + map); return new Gson().toJson(map); } @@ -319,7 +321,7 @@ private String getDisburseLoanWithRepaymentRescheduleAsJSON(final String actualD if (transactionAmount != null) { map.put("transactionAmount", transactionAmount); } - System.out.println("Loan Application disburse request : " + map); + LOG.info("Loan Application disburse request : " + map); return new Gson().toJson(map); } @@ -363,7 +365,7 @@ private String getForeclosureBodyAsJSON(final String transactionDate, final Inte map.put("transactionDate", transactionDate); map.put("note", "Foreclosure Made!!!"); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -408,7 +410,7 @@ public static String getSpecifiedDueDateChargesForLoanAsJSON(final String charge map.put("dueDate", dueDate); map.put("chargeId", chargeId); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -423,7 +425,7 @@ public static String getDisbursementChargesForLoanAsJSON(final String chargeId, map.put("amount", amount); map.put("chargeId", chargeId); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -434,7 +436,7 @@ public static String getInstallmentChargesForLoanAsJSON(final String chargeId, f map.put("amount", amount); map.put("chargeId", chargeId); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -444,7 +446,7 @@ public static String getUpdateChargesForLoanAsJSON(String amount) { map.put("dateFormat", "dd MMMM yyyy"); map.put("amount", amount); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -457,7 +459,7 @@ public static String getPayChargeJSON(final String date, final String installmen map.put("installmentNumber", installmentNumber); } String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -466,7 +468,7 @@ public static String getWaiveChargeJSON(final String installmentNumber) { map.put("locale", "en_GB"); map.put("installmentNumber", installmentNumber); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -540,7 +542,7 @@ private String getAdjustTransactionJSON(final String date, final String transact map.put("transactionDate", date); map.put("transactionAmount", transactionAmount); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -556,7 +558,7 @@ private String createLoanRefundTransferURL() { } public void verifyRepaymentScheduleEntryFor(final int repaymentNumber, final float expectedPrincipalOutstanding, final Integer loanID) { - System.out.println("---------------------------GETTING LOAN REPAYMENT SCHEDULE--------------------------------"); + LOG.info("---------------------------GETTING LOAN REPAYMENT SCHEDULE--------------------------------"); final ArrayList repaymentPeriods = getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); assertEquals("Mismatch in Principal Loan Balance Outstanding ", expectedPrincipalOutstanding, repaymentPeriods.get(repaymentNumber) .get("principalLoanBalanceOutstanding")); @@ -675,7 +677,7 @@ public static String getEditDisbursementsAsJSON(final String approvalAmount, fin map.put("updatedExpectedDisbursementDate", updatedExpectedDisbursementDate); map.put("updatedPrincipal", updatedPrincipal); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -688,7 +690,7 @@ public static String getAddAndDeleteDisbursementsAsJSON(final String approvalAmo map.put("expectedDisbursementDate", expectedDisbursementDate); map.put("disbursementData", disbursementData); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java index 17fdb832140..3eb242c3f42 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java @@ -33,10 +33,12 @@ import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.report.ReportData; import org.joda.time.LocalDateTime; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.util.Assert; public class CampaignsHelper { - + private final static Logger LOG = LoggerFactory.getLogger(CampaignsHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -52,7 +54,7 @@ public CampaignsHelper(final RequestSpecification requestSpec, final ResponseSpe } public Integer createCampaign(String reportName, Integer triggerType) { - System.out.println("---------------------------------CREATING A CAMPAIGN---------------------------------------------"); + LOG.info("---------------------------------CREATING A CAMPAIGN---------------------------------------------"); final String CREATE_SMS_CAMPAIGNS_URL = SMS_CAMPAIGNS_URL + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerPost(requestSpec, responseSpec, CREATE_SMS_CAMPAIGNS_URL, getCreateCampaignJSON(reportName, triggerType), "resourceId"); @@ -60,7 +62,7 @@ public Integer createCampaign(String reportName, Integer triggerType) { public void verifyCampaignCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedCampaignId) { - System.out.println("------------------------------CHECK CAMPAIGN DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK CAMPAIGN DETAILS------------------------------------\n"); final String RETRIEVE_SMS_CAMPAIGNS_URL = SMS_CAMPAIGNS_URL + "/" + generatedCampaignId + "?" + Utils.TENANT_IDENTIFIER; final Integer responseCampaignId = Utils.performServerGet(requestSpec, responseSpec, RETRIEVE_SMS_CAMPAIGNS_URL, "id"); assertEquals("ERROR IN CREATING THE CAMPAIGN", generatedCampaignId, responseCampaignId); @@ -68,7 +70,7 @@ public void verifyCampaignCreatedOnServer(final RequestSpecification requestSpec public Integer updateCampaign(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedCampaignId, String reportName, Integer triggerType) { - System.out.println("------------------------------UPDATE CAMPAIGN DETAILS------------------------------------\n"); + LOG.info("------------------------------UPDATE CAMPAIGN DETAILS------------------------------------\n"); final String UPDATE_SMS_CAMPAIGNS_URL = SMS_CAMPAIGNS_URL + "/" + generatedCampaignId + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerPut(requestSpec, responseSpec, UPDATE_SMS_CAMPAIGNS_URL, getUpdateCampaignJSON(reportName, triggerType), "resourceId"); @@ -76,14 +78,14 @@ public Integer updateCampaign(final RequestSpecification requestSpec, final Resp public Integer deleteCampaign(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedCampaignId) { - System.out.println("------------------------------DELETE CAMPAIGN DETAILS------------------------------------\n"); + LOG.info("------------------------------DELETE CAMPAIGN DETAILS------------------------------------\n"); final String DELETE_SMS_CAMPAIGNS_URL = SMS_CAMPAIGNS_URL + "/" + generatedCampaignId + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerDelete(requestSpec, responseSpec, DELETE_SMS_CAMPAIGNS_URL, "resourceId"); } public Integer performActionsOnCampaign(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedCampaignId, String command) { - System.out.println("------------------------------PERFORM ACTION ON CAMPAIGN DETAILS------------------------------------\n"); + LOG.info("------------------------------PERFORM ACTION ON CAMPAIGN DETAILS------------------------------------\n"); final String SMS_CAMPAIGNS_ACTION_URL = SMS_CAMPAIGNS_URL + "/" + generatedCampaignId + "?command=" + command + "&" + Utils.TENANT_IDENTIFIER; String actionDate = Utils.getLocalDateOfTenant().toString(DATE_FORMAT); @@ -92,7 +94,7 @@ public Integer performActionsOnCampaign(final RequestSpecification requestSpec, } public Object performActionsOnCampaignWithFailure(final Integer generatedCampaignId, String command, String actionDate, String responseJsonAttribute) { - System.out.println("--------------------------PERFORM ACTION ON CAMPAIGN DETAILS WITH FAILURE-------------------------------\n"); + LOG.info("--------------------------PERFORM ACTION ON CAMPAIGN DETAILS WITH FAILURE-------------------------------\n"); final String SMS_CAMPAIGNS_ACTION_URL = SMS_CAMPAIGNS_URL + "/" + generatedCampaignId + "?command=" + command + "&" + Utils.TENANT_IDENTIFIER; return Utils.performServerPost(this.requestSpec, this.responseSpec, SMS_CAMPAIGNS_ACTION_URL, getJSONForCampaignAction(command, actionDate), @@ -122,7 +124,7 @@ public String getCreateCampaignJSON(String reportName, Integer triggerType) { paramValueMap.put("reportName", reportName); map.put("paramValue", paramValueMap); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -147,7 +149,7 @@ public String getUpdateCampaignJSON(String reportName, Integer triggerType) { paramValueMap.put("reportName", reportName); map.put("paramValue", paramValueMap); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -158,7 +160,7 @@ public String getJSONForCampaignAction(String command, String actionDate) { map.put("locale", "en"); map.put("dateFormat", DATE_FORMAT); String json = new Gson().toJson(map); - System.out.println(json); + LOG.info(json); return json; } @@ -167,7 +169,7 @@ public ArrayList getReports() { } private ArrayList getReports(String jsonAttributeToGetBack) { - System.out.println("--------------------------------- GET REPORTS OPTIONS -------------------------------"); + LOG.info("--------------------------------- GET REPORTS OPTIONS -------------------------------"); Assert.notNull(jsonAttributeToGetBack); final String templateUrl = SMS_CAMPAIGNS_URL + "/template?" + Utils.TENANT_IDENTIFIER; final String json = given().spec(requestSpec).expect().spec(responseSpec).log().ifError().when().get(templateUrl).andReturn() diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CurrencyHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CurrencyHelper.java index 288d322eab1..33ead831b78 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CurrencyHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CurrencyHelper.java @@ -31,10 +31,12 @@ import java.util.List; import java.util.Map; import org.apache.fineract.integrationtests.common.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.util.Assert; public class CurrencyHelper { - + private final static Logger LOG = LoggerFactory.getLogger(CurrencyHelper.class); private static final String CURRENCY_URL = "/fineract-provider/api/v1/currencies?" + Utils.TENANT_IDENTIFIER; private static final String CURRENCY_URL_SELECTED = CURRENCY_URL + "&fields=selectedCurrencyOptions"; @@ -61,7 +63,7 @@ public ArrayList getSelectedCurrencies() { private ArrayList getCurrencies(final String getUrl, final List permittedCurrencyArrays) { - System.out.println("--------------------------------- GET CURRENCY OPTIONS -------------------------------"); + LOG.info("--------------------------------- GET CURRENCY OPTIONS -------------------------------"); final String json = given().spec(requestSpec).expect().spec(responseSpec).log().ifError().when() .get(getUrl).andReturn().asString(); final Gson gson = new Gson(); @@ -79,7 +81,7 @@ private ArrayList getCurrencies(final String getUrl, final List updateCurrencies(final List currencies) { - System.out.println("--------------------------------- UPDATE CURRENCY OPTIONS -------------------------------"); + LOG.info("--------------------------------- UPDATE CURRENCY OPTIONS -------------------------------"); final String json = given().spec(requestSpec).body(getUpdateJSON(currencies)).expect().spec(responseSpec).log().ifError().when() .put(CURRENCY_URL).andReturn().asString(); final Gson gson = new Gson(); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksHelper.java index 91fb0e9b793..728dc8fb7bc 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksHelper.java @@ -23,9 +23,11 @@ import com.jayway.restassured.specification.ResponseSpecification; import java.util.HashMap; import org.apache.fineract.integrationtests.common.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class EntityDatatableChecksHelper { - + private final static Logger LOG = LoggerFactory.getLogger(EntityDatatableChecksHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -59,7 +61,7 @@ public static String getTestEdcAsJSON(final String apptableName, final String da map.put("productId", productId); } String requestJsonString = new Gson().toJson(map); - System.out.println("map : " + requestJsonString); + LOG.info("map : " + requestJsonString); return requestJsonString; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksIntegrationTest.java index d51db9f4bc4..9e7a1fcc5b2 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksIntegrationTest.java @@ -42,6 +42,8 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Entity Datatable Checks Integration Test for checking Creation, Deletion and @@ -49,7 +51,7 @@ */ public class EntityDatatableChecksIntegrationTest { - + private final static Logger LOG = LoggerFactory.getLogger(EntityDatatableChecksIntegrationTest.class); private RequestSpecification requestSpec; private ResponseSpecification responseSpec; private EntityDatatableChecksHelper entityDatatableChecksHelper; @@ -407,7 +409,7 @@ private Integer createSavingsProduct(final RequestSpecification requestSpec, fin private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String minOpenningBalance, String minBalanceForInterestCalculation, String minRequiredBalance, String enforceMinRequiredBalance, final boolean allowOverdraft, final String taxGroupId, boolean withDormancy) { - System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); SavingsProductHelper savingsProductHelper = new SavingsProductHelper(); if (allowOverdraft) { final String overDraftLimit = "2000.0"; @@ -433,7 +435,7 @@ private Integer createSavingsProduct(final RequestSpecification requestSpec, fin } private Integer createLoanProduct(final String inMultiplesOf, final String digitsAfterDecimal, final String repaymentStrategy) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); final String loanProductJSON = new LoanProductTestBuilder() // .withPrincipal("10000000.00") // .withNumberOfRepayments("24") // @@ -450,7 +452,7 @@ private Integer createLoanProduct(final String inMultiplesOf, final String digit private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID, String graceOnPrincipalPayment, final String registeredTableName) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal("10000000.00") // .withLoanTermFrequency("24") // @@ -471,7 +473,7 @@ private Integer applyForLoanApplication(final Integer clientID, final Integer lo private Object applyForLoanApplicationWithError(final Integer clientID, final Integer loanProductID, String graceOnPrincipalPayment, final String responseAttribute) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal("10000000.00") // .withLoanTermFrequency("24") // diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/StaffHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/StaffHelper.java index ae587932cc8..cf455840bde 100755 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/StaffHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/StaffHelper.java @@ -25,9 +25,11 @@ import java.util.HashMap; import java.util.List; import org.apache.fineract.integrationtests.common.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class StaffHelper { - + private final static Logger LOG = LoggerFactory.getLogger(StaffHelper.class); private static final String TRANSFER_STAFF_URL = "/fineract-provider/api/v1/groups"; private static final String CREATE_STAFF_URL = "/fineract-provider/api/v1/staff"; @@ -47,7 +49,7 @@ public static String transferStaffToGroupAsJSON(final Integer staffToTransferId, final HashMap map = new HashMap<>(); map.put("staffId", staffToTransferId); map.put("note", note); - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -98,7 +100,7 @@ public static String createStaffAsJSON(){ map.put("locale", "en"); map.put("dateFormat", "dd MMMM yyyy"); map.put("joiningDate", "20 September 2011") ; - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } @@ -120,7 +122,7 @@ public static String createStaffWithJSONFields(String... fields) { if(fieldList.contains("mobileNo")) { map.put("mobileNo", "+123515198"); } - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java index e7896c8ce6c..3e3ea6b6c9a 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java @@ -29,10 +29,12 @@ import java.util.Locale; import org.apache.fineract.integrationtests.common.CommonConstants; import org.apache.fineract.integrationtests.common.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "unused", "rawtypes" }) public class RecurringDepositAccountHelper { - + private final static Logger LOG = LoggerFactory.getLogger(RecurringDepositAccountHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -140,13 +142,13 @@ public String build(final String clientId, final String productId, final String map.put("isCalendarInherited", this.isCalendarInherited); String recurringDepositAccountJson = new Gson().toJson(map); - System.out.println(recurringDepositAccountJson); + LOG.info(recurringDepositAccountJson); return recurringDepositAccountJson; } public static Integer applyRecurringDepositApplication(final String recurringDepositAccountAsJson, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - System.out.println("--------------------- APPLYING FOR RECURRING DEPOSIT ACCOUNT ------------------------"); + LOG.info("--------------------- APPLYING FOR RECURRING DEPOSIT ACCOUNT ------------------------"); return Utils.performServerPost(requestSpec, responseSpec, APPLY_RECURRING_DEPOSIT_ACCOUNT_URL, recurringDepositAccountAsJson, CommonConstants.RESPONSE_RESOURCE_ID); } @@ -154,7 +156,7 @@ public static Integer applyRecurringDepositApplication(final String recurringDep public static HashMap getRecurringDepositAccountById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer accountID) { final String GET_RECURRING_DEPOSIT_BY_ID_URL = RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER; - System.out.println("------------------------ RETRIEVING RECURRING DEPOSIT ACCOUNT BY ID -------------------------"); + LOG.info("------------------------ RETRIEVING RECURRING DEPOSIT ACCOUNT BY ID -------------------------"); return Utils.performServerGet(requestSpec, responseSpec, GET_RECURRING_DEPOSIT_BY_ID_URL, ""); } @@ -202,7 +204,6 @@ public static Float getPrincipalAfterCompoundingInterest(Calendar currentDate, F principal += totalInterest; } totalInterest = 0.0f; - System.out.println(principal); } currentDate.add(Calendar.MONTH, 1); @@ -248,7 +249,7 @@ public HashMap updateInterestCalculationConfigForRecurringDeposit(final String c public Integer updateTransactionForRecurringDeposit(final Integer accountID, final Integer transactionId, final String transactionDate, final Float transactionAmount) { - System.out.println("--------------------------------- UPDATE RECURRING DEPOSIT TRANSACTION ------------------------------------"); + LOG.info("--------------------------------- UPDATE RECURRING DEPOSIT TRANSACTION ------------------------------------"); return Utils.performServerPost(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "/transactions/" + transactionId + "?command=" + MODIFY_TRANSACTION_COMMAND, getUpdateTransactionAsJSON(transactionDate, transactionAmount), CommonConstants.RESPONSE_RESOURCE_ID); @@ -256,66 +257,63 @@ public Integer updateTransactionForRecurringDeposit(final Integer accountID, fin public Integer undoTransactionForRecurringDeposit(final Integer accountID, final Integer transactionId, final String transactionDate, final Float transactionAmount) { - System.out.println("--------------------------------- UNDO RECURRING DEPOSIT TRANSACTION ------------------------------------"); + LOG.info("--------------------------------- UNDO RECURRING DEPOSIT TRANSACTION ------------------------------------"); return Utils.performServerPost(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "/transactions/" + transactionId + "?command=" + UNDO_TRANSACTION_COMMAND, getUpdateTransactionAsJSON(transactionDate, transactionAmount), CommonConstants.RESPONSE_RESOURCE_ID); } public HashMap approveRecurringDeposit(final Integer recurringDepositAccountID, final String approvedOnDate) { - System.out - .println("--------------------------------- APPROVING RECURRING DEPOSIT APPLICATION ------------------------------------"); + LOG.info("--------------------------------- APPROVING RECURRING DEPOSIT APPLICATION ------------------------------------"); return performRecurringDepositApplicationActions( createRecurringDepositOperationURL(APPROVE_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID), getApproveRecurringDepositAccountAsJSON(approvedOnDate)); } public HashMap undoApproval(final Integer recurringDepositAccountID) { - System.out - .println("--------------------------------- UNDO APPROVING RECURRING DEPOSIT APPLICATION -------------------------------"); + LOG.info("--------------------------------- UNDO APPROVING RECURRING DEPOSIT APPLICATION -------------------------------"); final String undoBodyJson = "{'note':'UNDO APPROVAL'}"; return performRecurringDepositApplicationActions( createRecurringDepositOperationURL(UNDO_APPROVAL_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID), undoBodyJson); } public HashMap rejectApplication(final Integer recurringDepositAccountID, final String rejectedOnDate) { - System.out.println("--------------------------------- REJECT RECURRING DEPOSIT APPLICATION -------------------------------"); + LOG.info("--------------------------------- REJECT RECURRING DEPOSIT APPLICATION -------------------------------"); return performRecurringDepositApplicationActions( createRecurringDepositOperationURL(REJECT_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID), getRejectedRecurringDepositAsJSON(rejectedOnDate)); } public HashMap withdrawApplication(final Integer recurringDepositAccountID, final String withdrawApplicationOnDate) { - System.out.println("--------------------------------- WITHDRAW RECURRING DEPOSIT APPLICATION -------------------------------"); + LOG.info("--------------------------------- WITHDRAW RECURRING DEPOSIT APPLICATION -------------------------------"); return performRecurringDepositApplicationActions( createRecurringDepositOperationURL(WITHDRAWN_BY_CLIENT_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID), getWithdrawnRecurringDepositAccountAsJSON(withdrawApplicationOnDate)); } public HashMap activateRecurringDeposit(final Integer recurringDepositAccountID, final String activationDate) { - System.out - .println("---------------------------------- ACTIVATING RECURRING DEPOSIT APPLICATION ----------------------------------"); + LOG.info("---------------------------------- ACTIVATING RECURRING DEPOSIT APPLICATION ----------------------------------"); return performRecurringDepositApplicationActions( createRecurringDepositOperationURL(ACTIVATE_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountID), getActivatedRecurringDepositAccountAsJSON(activationDate)); } public Object deleteRecurringDepositApplication(final Integer recurringDepositAccountID, final String jsonAttributeToGetBack) { - System.out.println("---------------------------------- DELETE RECURRING DEPOSIT APPLICATION ----------------------------------"); + LOG.info("---------------------------------- DELETE RECURRING DEPOSIT APPLICATION ----------------------------------"); return Utils.performServerDelete(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "?" + Utils.TENANT_IDENTIFIER, jsonAttributeToGetBack); } public Integer calculateInterestForRecurringDeposit(final Integer recurringDepositAccountId) { - System.out.println("--------------------------------- CALCULATING INTEREST FOR RECURRING DEPOSIT --------------------------------"); + LOG.info("--------------------------------- CALCULATING INTEREST FOR RECURRING DEPOSIT --------------------------------"); return (Integer) performRecurringDepositActions( createRecurringDepositCalculateInterestURL(CALCULATE_INTEREST_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountId), getCalculatedInterestForRecurringDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID); } public Integer postInterestForRecurringDeposit(final Integer recurringDepositAccountId) { - System.out.println("--------------------------------- POST INTEREST FOR RECURRING DEPOSIT --------------------------------"); + LOG.info("--------------------------------- POST INTEREST FOR RECURRING DEPOSIT --------------------------------"); return (Integer) performRecurringDepositActions( createRecurringDepositCalculateInterestURL(POST_INTEREST_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountId), getCalculatedInterestForRecurringDepositApplicationAsJSON(), CommonConstants.RESPONSE_RESOURCE_ID); @@ -323,14 +321,14 @@ public Integer postInterestForRecurringDeposit(final Integer recurringDepositAcc public Integer depositToRecurringDepositAccount(final Integer recurringDepositAccountId, final Float depositAmount, final String depositedOnDate) { - System.out.println("--------------------------------- DEPOSIT TO RECURRING DEPOSIT ACCOUNT --------------------------------"); + LOG.info("--------------------------------- DEPOSIT TO RECURRING DEPOSIT ACCOUNT --------------------------------"); return (Integer) performRecurringDepositActions( createDepositToRecurringDepositURL(DEPOSIT_INTO_RECURRING_DEPOSIT_COMMAND, recurringDepositAccountId), getDepositToRecurringDepositAccountAsJSON(depositAmount, depositedOnDate), CommonConstants.RESPONSE_RESOURCE_ID); } public HashMap calculatePrematureAmountForRecurringDeposit(final Integer recurringDepositAccountId, final String closedOnDate) { - System.out.println("--------------------- CALCULATING PREMATURE AMOUNT FOR RECURRING DEPOSIT ----------------------------"); + LOG.info("--------------------- CALCULATING PREMATURE AMOUNT FOR RECURRING DEPOSIT ----------------------------"); return (HashMap) performRecurringDepositActions( createRecurringDepositCalculateInterestURL(CALCULATE_PREMATURE_AMOUNT_COMMAND, recurringDepositAccountId), getCalculatedPrematureAmountForRecurringDepositAccountAsJSON(closedOnDate), ""); @@ -338,7 +336,7 @@ public HashMap calculatePrematureAmountForRecurringDeposit(final Integer recurri public Object prematureCloseForRecurringDeposit(final Integer recurringDepositAccountId, final String closedOnDate, final String closureType, final Integer toSavingsId, final String jsonAttributeToGetBack) { - System.out.println("--------------------- PREMATURE CLOSE FOR RECURRING DEPOSIT ----------------------------"); + LOG.info("--------------------- PREMATURE CLOSE FOR RECURRING DEPOSIT ----------------------------"); return performRecurringDepositActions( createRecurringDepositCalculateInterestURL(PREMATURE_CLOSE_COMMAND, recurringDepositAccountId), getPrematureCloseForRecurringDepositAccountAsJSON(closedOnDate, closureType, toSavingsId), jsonAttributeToGetBack); @@ -351,7 +349,7 @@ private String getApproveRecurringDepositAccountAsJSON(final String approvedOnDa map.put("approvedOnDate", approvedOnDate); map.put("note", "Approval NOTE"); String recurringDepositAccountApproveJson = new Gson().toJson(map); - System.out.println(recurringDepositAccountApproveJson); + LOG.info(recurringDepositAccountApproveJson); return recurringDepositAccountApproveJson; } @@ -362,7 +360,7 @@ private String getUpdateTransactionAsJSON(final String transactionDate, final Fl map.put("transactionDate", transactionDate); map.put("transactionAmount", transactionAmount); String updateTransactionJson = new Gson().toJson(map); - System.out.println(updateTransactionJson); + LOG.info(updateTransactionJson); return updateTransactionJson; } @@ -373,7 +371,7 @@ private String getRejectedRecurringDepositAsJSON(final String rejectedOnDate) { map.put("rejectedOnDate", rejectedOnDate); map.put("note", "Rejected NOTE"); String recurringDepositAccountJson = new Gson().toJson(map); - System.out.println(recurringDepositAccountJson); + LOG.info(recurringDepositAccountJson); return recurringDepositAccountJson; } @@ -384,7 +382,7 @@ private String getWithdrawnRecurringDepositAccountAsJSON(final String withdrawnA map.put("withdrawnOnDate", withdrawnApplicationOnDate); map.put("note", "Withdraw NOTE"); String recurringDepositAccountJson = new Gson().toJson(map); - System.out.println(recurringDepositAccountJson); + LOG.info(recurringDepositAccountJson); return recurringDepositAccountJson; } @@ -394,14 +392,14 @@ private String getActivatedRecurringDepositAccountAsJSON(final String activation map.put("dateFormat", CommonConstants.dateFormat); map.put("activatedOnDate", activationDate); String recurringDepositAccountActivateJson = new Gson().toJson(map); - System.out.println(recurringDepositAccountActivateJson); + LOG.info(recurringDepositAccountActivateJson); return recurringDepositAccountActivateJson; } private String getCalculatedInterestForRecurringDepositApplicationAsJSON() { final HashMap map = new HashMap<>(); String recurringDepositAccountCalculatedInterestJson = new Gson().toJson(map); - System.out.println(recurringDepositAccountCalculatedInterestJson); + LOG.info(recurringDepositAccountCalculatedInterestJson); return recurringDepositAccountCalculatedInterestJson; } @@ -411,7 +409,7 @@ private String getCalculatedPrematureAmountForRecurringDepositAccountAsJSON(fina map.put("dateFormat", CommonConstants.dateFormat); map.put("closedOnDate", closedOnDate); String recurringDepositAccountPrematureClosureJson = new Gson().toJson(map); - System.out.println(recurringDepositAccountPrematureClosureJson); + LOG.info(recurringDepositAccountPrematureClosureJson); return recurringDepositAccountPrematureClosureJson; } @@ -422,7 +420,7 @@ private String getDepositToRecurringDepositAccountAsJSON(final Float depositAmou map.put("transactionAmount", depositAmount); map.put("transactionDate", depositedOnDate); String recurringDepositAccountPrematureClosureJson = new Gson().toJson(map); - System.out.println(recurringDepositAccountPrematureClosureJson); + LOG.info(recurringDepositAccountPrematureClosureJson); return recurringDepositAccountPrematureClosureJson; } @@ -438,7 +436,7 @@ private String getPrematureCloseForRecurringDepositAccountAsJSON(final String cl map.put("transferDescription", "Transferring To Savings Account"); } String recurringDepositAccountPrematureCloseJson = new Gson().toJson(map); - System.out.println(recurringDepositAccountPrematureCloseJson); + LOG.info(recurringDepositAccountPrematureCloseJson); return recurringDepositAccountPrematureCloseJson; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountStatusChecker.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountStatusChecker.java index c5093b479f0..6a9e6b49948 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountStatusChecker.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountStatusChecker.java @@ -25,73 +25,64 @@ import java.util.HashMap; import org.apache.fineract.integrationtests.common.Utils; import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings("rawtypes") public class RecurringDepositAccountStatusChecker { - private static final String RECURRING_DEPOSIT_ACCOUNT_URL = "/fineract-provider/api/v1/recurringdepositaccounts"; - + private final static Logger LOG = LoggerFactory.getLogger(RecurringDepositAccountStatusChecker.class); public static void verifyRecurringDepositIsApproved(final HashMap recurringDepositStatusHashMap) { - System.out.println("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS APPROVED --------------------"); + LOG.info("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS APPROVED --------------------"); assertTrue("Error in Approving Recurring deposit application", getStatus(recurringDepositStatusHashMap, "approved")); - System.out.println(recurringDepositStatusHashMap); } public static void verifyRecurringDepositIsPending(final HashMap recurringDepositStatusHashMap) { - System.out.println("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS PENDING --------------------"); + LOG.info("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS PENDING --------------------"); assertTrue("RECURRING DEPOSIT ACCOUNT IS NOT IN PENDING STATE", getStatus(recurringDepositStatusHashMap, "submittedAndPendingApproval")); - System.out.println(recurringDepositStatusHashMap); } public static void verifyRecurringDepositIsActive(final HashMap recurringDepositStatusHashMap) { - System.out.println("----------------- VERIFYING RECURRING DEPOSIT APPLICATION IS ACTIVE -----------------"); + LOG.info("----------------- VERIFYING RECURRING DEPOSIT APPLICATION IS ACTIVE -----------------"); assertTrue("ERROR IN ACTIVATING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "active")); - System.out.println(recurringDepositStatusHashMap); } public static void verifyRecurringDepositIsRejected(final HashMap recurringDepositStatusHashMap) { - System.out.println("-------------- VERIFYING RECURRING DEPOSIT APPLICATION IS REJECTED ----------------"); + LOG.info("-------------- VERIFYING RECURRING DEPOSIT APPLICATION IS REJECTED ----------------"); assertTrue("ERROR IN REJECTING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "rejected")); - System.out.println(recurringDepositStatusHashMap); } public static void verifyRecurringDepositIsWithdrawn(final HashMap recurringDepositStatusHashMap) { - System.out.println("---------------- VERIFYING RECURRING DEPOSIT APPLICATION IS WITHDRAWN ----------------"); + LOG.info("---------------- VERIFYING RECURRING DEPOSIT APPLICATION IS WITHDRAWN ----------------"); assertTrue("ERROR IN WITHDRAW THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "withdrawnByApplicant")); - System.out.println(recurringDepositStatusHashMap); } public static void verifyRecurringDepositAccountIsClosed(final HashMap recurringDepositStatusHashMap) { - System.out.println("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------"); + LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------"); assertTrue("ERROR IN CLOSING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "closed")); - System.out.println(recurringDepositStatusHashMap); } public static void verifyRecurringDepositAccountIsNotActive(final HashMap recurringDepositStatusHashMap) { - System.out.println("------------------ VERIFYING RECURRING DEPOSIT APPLICATION IS INACTIVE --------------------"); + LOG.info("------------------ VERIFYING RECURRING DEPOSIT APPLICATION IS INACTIVE --------------------"); Assert.assertFalse(getStatus(recurringDepositStatusHashMap, "active")); - System.out.println(recurringDepositStatusHashMap); } public static HashMap getStatusOfRecurringDepositAccount(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String recurringDepositAccountID) { - final String GET_STATUS_OF_RECURRING_DEPOSIT_ACCOUNT_URL = RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "?" - + Utils.TENANT_IDENTIFIER; + final String GET_STATUS_OF_RECURRING_DEPOSIT_ACCOUNT_URL = RECURRING_DEPOSIT_ACCOUNT_URL + "/" + recurringDepositAccountID + "?" + Utils.TENANT_IDENTIFIER; return Utils.performServerGet(requestSpec, responseSpec, GET_STATUS_OF_RECURRING_DEPOSIT_ACCOUNT_URL, "status"); } public static void verifyRecurringDepositAccountIsPrematureClosed(HashMap recurringDepositStatusHashMap) { - System.out.println("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------"); + LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------"); assertTrue("ERROR IN PREMATURELY CLOSING THE RECURRING DEPOSIT ACCOUNT", getStatus(recurringDepositStatusHashMap, "prematureClosed")); - System.out.println(recurringDepositStatusHashMap); } public static void verifyRecurringDepositAccountIsMatured(HashMap recurringDepositStatusHashMap) { - System.out.println("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS MATURED ---------------------"); + LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS MATURED ---------------------"); assertTrue("ERROR IN MATURITY JOB OF THE RECURRING DEPOSIT ACCOUNT", getStatus(recurringDepositStatusHashMap, "matured")); - System.out.println(recurringDepositStatusHashMap); } private static boolean getStatus(final HashMap recurringDepositStatusMap, final String recurringDepositStatusString) { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java index d5b7219dfe5..d51456b6b26 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java @@ -27,10 +27,12 @@ import java.util.Map; import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.accounting.Account; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "unused", "rawtypes" }) public class RecurringDepositProductHelper { - + private final static Logger LOG = LoggerFactory.getLogger(RecurringDepositProductHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -153,7 +155,7 @@ public String build(final String validFrom, final String validTo) { } String RecurringDepositProductCreateJson = new Gson().toJson(map); - System.out.println(RecurringDepositProductCreateJson); + LOG.info(RecurringDepositProductCreateJson); return RecurringDepositProductCreateJson; } @@ -226,14 +228,14 @@ private Map getAccountMappingForCashBased() { public static Integer createRecurringDepositProduct(final String recurrungDepositProductCreateJson, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - System.out.println("------------------ CREATING RECURRING DEPOSIT PRODUCT--------------------"); + LOG.info("------------------ CREATING RECURRING DEPOSIT PRODUCT--------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_RECURRING_DEPOSIT_PRODUCT_URL, recurrungDepositProductCreateJson, "resourceId"); } public static ArrayList retrieveAllRecurringDepositProducts(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - System.out.println("----------------- RETRIEVING ALL RECURRING DEPOSIT PRODUCTS---------------------------"); + LOG.info("----------------- RETRIEVING ALL RECURRING DEPOSIT PRODUCTS---------------------------"); final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, RECURRING_DEPOSIT_PRODUCT_URL + "?" + Utils.TENANT_IDENTIFIER, ""); return response; @@ -241,7 +243,7 @@ public static ArrayList retrieveAllRecurringDepositProducts(final RequestSpecifi public static HashMap retrieveRecurringDepositProductById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String productId) { - System.out.println("-------------------- RETRIEVING RECURRING DEPOSIT PRODUCT BY ID --------------------------"); + LOG.info("-------------------- RETRIEVING RECURRING DEPOSIT PRODUCT BY ID --------------------------"); final String GET_RD_PRODUCT_BY_ID_URL = RECURRING_DEPOSIT_PRODUCT_URL + "/" + productId + "?" + Utils.TENANT_IDENTIFIER; final HashMap response = Utils.performServerGet(requestSpec, responseSpec, GET_RD_PRODUCT_BY_ID_URL, ""); return response; @@ -249,7 +251,7 @@ public static HashMap retrieveRecurringDepositProductById(final RequestSpecifica public static ArrayList getInterestRateChartSlabsByProductId(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer productId) { - System.out.println("-------------------- RETRIEVE INTEREST CHART BY PRODUCT ID ---------------------"); + LOG.info("-------------------- RETRIEVE INTEREST CHART BY PRODUCT ID ---------------------"); final ArrayList response = Utils.performServerGet(requestSpec, responseSpec, INTEREST_CHART_URL + "?productId=" + productId, "chartSlabs"); return response; diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/AccountTransferHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/AccountTransferHelper.java index 00cb311622a..e60bd459a01 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/AccountTransferHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/AccountTransferHelper.java @@ -23,9 +23,11 @@ import com.jayway.restassured.specification.ResponseSpecification; import java.util.HashMap; import org.apache.fineract.integrationtests.common.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class AccountTransferHelper { - + private final static Logger LOG = LoggerFactory.getLogger(AccountTransferHelper.class); private static final String ACCOUNT_TRANSFER_URL = "/fineract-provider/api/v1/accounttransfers"; private static final String LOAN_REFUND_BY_TRANSFER_URL = "/fineract-provider/api/v1/accounttransfers/refundByTransfer"; private static final String LOCALE = "en_GB"; @@ -63,7 +65,6 @@ public String build(final String fromAccountId, final String fromClientId, final map.put("transferAmount", transferAmount); map.put("transferDescription", this.transferDescription); String savingsApplicationJSON = new Gson().toJson(map); - System.out.println(savingsApplicationJSON); return savingsApplicationJSON; } @@ -74,7 +75,7 @@ public AccountTransferHelper withTransferOnDate(final String savingsAccountTrans public Integer accountTransfer(final Integer fromClientId, final Integer fromAccountId, final Integer toClientId, final Integer toAccountId, final String fromAccountType, final String toAccountType, final String transferAmount) { - System.out.println("--------------------------------ACCOUNT TRANSFER--------------------------------"); + LOG.info("--------------------------------ACCOUNT TRANSFER--------------------------------"); final String accountTransferJSON = new AccountTransferHelper(this.requestSpec, this.responseSpec) // .withTransferOnDate(ACCOUNT_TRANSFER_DATE) // .build(fromAccountId.toString(), fromClientId.toString(), toAccountId.toString(), toClientId.toString(), fromAccountType, @@ -85,7 +86,7 @@ public Integer accountTransfer(final Integer fromClientId, final Integer fromAcc public Integer refundLoanByTransfer(final String date, final Integer fromClientId, final Integer fromAccountId, final Integer toClientId, final Integer toAccountId, final String fromAccountType, final String toAccountType, final String transferAmount) { - System.out.println("--------------------------------ACCOUNT TRANSFER--------------------------------"); + LOG.info("--------------------------------ACCOUNT TRANSFER--------------------------------"); final String accountTransferJSON = new AccountTransferHelper(this.requestSpec, this.responseSpec) // .withTransferOnDate(date) // .build(fromAccountId.toString(), fromClientId.toString(), toAccountId.toString(), toClientId.toString(), fromAccountType, 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 d520c2890be..95032f25289 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 @@ -39,10 +39,12 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Workbook; import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({ "rawtypes" }) public class SavingsAccountHelper { - + private final static Logger LOG = LoggerFactory.getLogger(SavingsAccountHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -111,7 +113,7 @@ public Integer applyForSavingsApplicationWithExternalId(final Integer ID, final public Integer applyForSavingsApplicationOnDate(final Integer ID, final Integer savingsProductID, final String accountType, String externalId, boolean withdrawalFeeForTransfers, final String submittedOnDate) { - System.out.println("--------------------------------APPLYING FOR SAVINGS APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR SAVINGS APPLICATION--------------------------------"); final String savingsApplicationJSON = new SavingsApplicationTestBuilder() // .withExternalId(externalId) // .withWithdrawalFeeForTransfers(withdrawalFeeForTransfers) // @@ -123,7 +125,7 @@ public Integer applyForSavingsApplicationOnDate(final Integer ID, final Integer public Integer applyForSavingsApplicationWithDatatables(final Integer ID, final Integer savingsProductID, final String accountType, final String submittedOnDate, final String datatableName) { - System.out.println("----------------------------APPLYING FOR SAVINGS APPLICATION WITH DATATABLES----------------------------"); + LOG.info("----------------------------APPLYING FOR SAVINGS APPLICATION WITH DATATABLES----------------------------"); final String savingsApplicationJSON = new SavingsApplicationTestBuilder() // .withSubmittedOnDate(submittedOnDate) // .withDatatables(getTestDatatableAsJson(datatableName)) // @@ -134,7 +136,7 @@ public Integer applyForSavingsApplicationWithDatatables(final Integer ID, final public Object applyForSavingsApplicationWithFailure(final Integer ID, final Integer savingsProductID, final String accountType, final String submittedOnDate, final String responseAttribute) { - System.out.println("----------------------------APPLYING FOR SAVINGS APPLICATION WITH ERROR----------------------------"); + LOG.info("----------------------------APPLYING FOR SAVINGS APPLICATION WITH ERROR----------------------------"); final String savingsApplicationJSON = new SavingsApplicationTestBuilder() // .withSubmittedOnDate(submittedOnDate) // .build(ID.toString(), savingsProductID.toString(), accountType); @@ -165,7 +167,7 @@ public HashMap approveSavings(final Integer savingsID) { } public HashMap approveSavingsOnDate(final Integer savingsID, final String approvalDate) { - System.out.println("--------------------------------- APPROVING SAVINGS APPLICATION ------------------------------------"); + LOG.info("--------------------------------- APPROVING SAVINGS APPLICATION ------------------------------------"); final String savingsOperationURL = createSavingsOperationURL(APPROVE_SAVINGS_COMMAND, savingsID); if (approvalDate == null || approvalDate.equals("")) return performSavingApplicationActions(savingsOperationURL, getApproveSavingsAsJSON(), isBlock); @@ -173,85 +175,85 @@ public HashMap approveSavingsOnDate(final Integer savingsID, final String approv } public HashMap undoApproval(final Integer savingsID) { - System.out.println("--------------------------------- UNDO APPROVING SAVINGS APPLICATION -------------------------------"); + LOG.info("--------------------------------- UNDO APPROVING SAVINGS APPLICATION -------------------------------"); final String undoBodyJson = "{'note':'UNDO APPROVAL'}"; return performSavingApplicationActions(createSavingsOperationURL(UNDO_APPROVAL_SAVINGS_COMMAND, savingsID), undoBodyJson, isBlock); } public HashMap rejectApplication(final Integer savingsID) { - System.out.println("--------------------------------- REJECT SAVINGS APPLICATION -------------------------------"); + LOG.info("--------------------------------- REJECT SAVINGS APPLICATION -------------------------------"); return performSavingApplicationActions(createSavingsOperationURL(REJECT_SAVINGS_COMMAND, savingsID), getRejectedSavingsAsJSON(CREATED_DATE_PLUS_ONE), isBlock); } public List rejectApplicationWithErrorCode(final Integer savingsId, final String date) { - System.out.println("--------------------------------- REJECT SAVINGS APPLICATION -------------------------------"); + LOG.info("--------------------------------- REJECT SAVINGS APPLICATION -------------------------------"); return (List) performSavingActions(createSavingsOperationURL(REJECT_SAVINGS_COMMAND, savingsId), getRejectedSavingsAsJSON(date), CommonConstants.RESPONSE_ERROR); } public HashMap withdrawApplication(final Integer savingsID) { - System.out.println("--------------------------------- Withdraw SAVINGS APPLICATION -------------------------------"); + LOG.info("--------------------------------- Withdraw SAVINGS APPLICATION -------------------------------"); return performSavingApplicationActions(createSavingsOperationURL(WITHDRAWN_BY_CLIENT_SAVINGS_COMMAND, savingsID), getWithdrawnSavingsAsJSON(), isBlock); } public HashMap activateSavings(final Integer savingsID) { - System.out.println("---------------------------------- ACTIVATING SAVINGS APPLICATION ----------------------------------"); + LOG.info("---------------------------------- ACTIVATING SAVINGS APPLICATION ----------------------------------"); return performSavingApplicationActions(createSavingsOperationURL(ACTIVATE_SAVINGS_COMMAND, savingsID), getActivatedSavingsAsJSON(), isBlock); } public HashMap closeSavingsAccount(final Integer savingsID, String withdrawBalance) { - System.out.println("---------------------------------- CLOSE SAVINGS APPLICATION ----------------------------------"); + LOG.info("---------------------------------- CLOSE SAVINGS APPLICATION ----------------------------------"); return performSavingApplicationActions(createSavingsOperationURL(CLOSE_SAVINGS_COMMAND, savingsID), getCloseAccountJSON(withdrawBalance, LAST_TRANSACTION_DATE), isBlock); } public Object deleteSavingsApplication(final Integer savingsId, final String jsonAttributeToGetBack) { - System.out.println("---------------------------------- DELETE SAVINGS APPLICATION ----------------------------------"); + LOG.info("---------------------------------- DELETE SAVINGS APPLICATION ----------------------------------"); return Utils.performServerDelete(this.requestSpec, this.responseSpec, SAVINGS_ACCOUNT_URL + "/" + savingsId + "?" + Utils.TENANT_IDENTIFIER, jsonAttributeToGetBack); } public Object depositToSavingsAccount(final Integer savingsID, final String amount, String date, String jsonAttributeToGetback) { - System.out.println("--------------------------------- SAVINGS TRANSACTION DEPOSIT --------------------------------"); + LOG.info("--------------------------------- SAVINGS TRANSACTION DEPOSIT --------------------------------"); return performSavingActions(createSavingsTransactionURL(DEPOSIT_SAVINGS_COMMAND, savingsID), getSavingsTransactionJSON(amount, date), jsonAttributeToGetback); } public Object withdrawalFromSavingsAccount(final Integer savingsId, final String amount, String date, String jsonAttributeToGetback) { - System.out.println("\n--------------------------------- SAVINGS TRANSACTION WITHDRAWAL --------------------------------"); + LOG.info("\n--------------------------------- SAVINGS TRANSACTION WITHDRAWAL --------------------------------"); return performSavingActions(createSavingsTransactionURL(WITHDRAW_SAVINGS_COMMAND, savingsId), getSavingsTransactionJSON(amount, date), jsonAttributeToGetback); } public Integer updateSavingsAccountTransaction(final Integer savingsId, final Integer transactionId, final String amount) { - System.out.println("\n--------------------------------- MODIFY SAVINGS TRANSACTION --------------------------------"); + LOG.info("\n--------------------------------- MODIFY SAVINGS TRANSACTION --------------------------------"); return (Integer) performSavingActions(createAdjustTransactionURL(MODIFY_TRASACTION_COMMAND, savingsId, transactionId), getSavingsTransactionJSON(amount, LAST_TRANSACTION_DATE), CommonConstants.RESPONSE_RESOURCE_ID); } public Integer undoSavingsAccountTransaction(final Integer savingsId, final Integer transactionId) { - System.out.println("\n--------------------------------- UNDO SAVINGS TRANSACTION --------------------------------"); + LOG.info("\n--------------------------------- UNDO SAVINGS TRANSACTION --------------------------------"); return (Integer) performSavingActions(createAdjustTransactionURL(UNDO_TRASACTION_COMMAND, savingsId, transactionId), getSavingsTransactionJSON("0", LAST_TRANSACTION_DATE), CommonConstants.RESPONSE_RESOURCE_ID); } public void calculateInterestForSavings(final Integer savingsId) { - System.out.println("--------------------------------- CALCULATING INTEREST FOR SAVINGS --------------------------------"); + LOG.info("--------------------------------- CALCULATING INTEREST FOR SAVINGS --------------------------------"); performSavingActions(createSavingsCalculateInterestURL(CALCULATE_INTEREST_SAVINGS_COMMAND, savingsId), getCalculatedInterestForSavingsApplicationAsJSON(), ""); } public void postInterestForSavings(final Integer savingsId) { - System.out.println("--------------------------------- POST INTEREST FOR SAVINGS --------------------------------"); + LOG.info("--------------------------------- POST INTEREST FOR SAVINGS --------------------------------"); performSavingActions(createSavingsCalculateInterestURL(POST_INTEREST_SAVINGS_COMMAND, savingsId), getCalculatedInterestForSavingsApplicationAsJSON(), ""); } public void postInterestAsOnSavings(final Integer savingsId, final String today) { - System.out.println("--------------------------------- POST INTEREST AS ON FOR SAVINGS --------------------------------"); + LOG.info("--------------------------------- POST INTEREST AS ON FOR SAVINGS --------------------------------"); performSavingActions(createSavingsPostInterestAsOnURL(POST_INTEREST_AS_ON_SAVINGS_COMMAND, savingsId), getCalculatedInterestForSavingsApplicationAsJSON(today), CommonConstants.RESPONSE_RESOURCE_ID); } @@ -261,7 +263,7 @@ public Integer addChargesForSavings(final Integer savingsId, final Integer charg } public Integer addChargesForSavings(final Integer savingsId, final Integer chargeId, boolean addDueDate, BigDecimal amount) { - System.out.println("--------------------------------- ADD CHARGES FOR SAVINGS --------------------------------"); + LOG.info("--------------------------------- ADD CHARGES FOR SAVINGS --------------------------------"); return (Integer) performSavingActions(SAVINGS_ACCOUNT_URL + "/" + savingsId + "/charges?" + Utils.TENANT_IDENTIFIER, getPeriodChargeRequestJSON(chargeId, addDueDate, amount), CommonConstants.RESPONSE_RESOURCE_ID); } @@ -292,55 +294,55 @@ public Integer deleteCharge(final Integer chargeId, final Integer savingsId) { } public HashMap blockSavings(final Integer savingsID) { - System.out.println("---------------------------------- BLOCKING SAVINGS ACCOUNT ----------------------------------"); + LOG.info("---------------------------------- BLOCKING SAVINGS ACCOUNT ----------------------------------"); Boolean isBlock = true; return performSavingApplicationActions(createSavingsOperationURL(BLOCK_SAVINGS_COMMAND, savingsID), getActivatedSavingsAsJSON(), isBlock); } public HashMap unblockSavings(final Integer savingsID) { - System.out.println("---------------------------------- UNBLOCKING SAVINGS ACCOUNT ----------------------------------"); + LOG.info("---------------------------------- UNBLOCKING SAVINGS ACCOUNT ----------------------------------"); Boolean isBlock = true; return performSavingApplicationActions(createSavingsOperationURL(UNBLOCK_SAVINGS_COMMAND, savingsID), getActivatedSavingsAsJSON(), isBlock); } public HashMap blockDebit(final Integer savingsID) { - System.out.println("---------------------------------- BLOCKING DEBIT TRANSACTIONS ----------------------------------"); + LOG.info("---------------------------------- BLOCKING DEBIT TRANSACTIONS ----------------------------------"); Boolean isBlock = true; return performSavingApplicationActions(createSavingsOperationURL(BLOCK_DEBITS_SAVINGS_COMMAND, savingsID), getActivatedSavingsAsJSON(), isBlock); } public HashMap unblockDebit(final Integer savingsID) { - System.out.println("---------------------------------- UNBLOCKING DEBIT TRANSACTIONS ----------------------------------"); + LOG.info("---------------------------------- UNBLOCKING DEBIT TRANSACTIONS ----------------------------------"); Boolean isBlock = true; return performSavingApplicationActions(createSavingsOperationURL(UNBLOCK_DEBITS_SAVINGS_COMMAND, savingsID), getActivatedSavingsAsJSON(), isBlock); } public HashMap blockCredit(final Integer savingsID) { - System.out.println("---------------------------------- BLOCKING CREDIT TRANSACTIONS ----------------------------------"); + LOG.info("---------------------------------- BLOCKING CREDIT TRANSACTIONS ----------------------------------"); Boolean isBlock = true; return performSavingApplicationActions(createSavingsOperationURL(BLOCK_CREDITS_SAVINGS_COMMAND, savingsID), getActivatedSavingsAsJSON(), isBlock); } public HashMap unblockCredit(final Integer savingsID) { - System.out.println("---------------------------------- UNBLOCKING CREDIT TRANSACTIONS ----------------------------------"); + LOG.info("---------------------------------- UNBLOCKING CREDIT TRANSACTIONS ----------------------------------"); Boolean isBlock = true; return performSavingApplicationActions(createSavingsOperationURL(UNBLOCK_CREDITS_SAVINGS_COMMAND, savingsID), getActivatedSavingsAsJSON(), isBlock); } public Object holdAmountInSavingsAccount(final Integer savingsID, final String amount, String date, String jsonAttributeToGetback) { - System.out.println("--------------------------------- SAVINGS TRANSACTION HOLD AMOUNT--------------------------------"); + LOG.info("--------------------------------- SAVINGS TRANSACTION HOLD AMOUNT--------------------------------"); return performSavingActions(createSavingsTransactionURL(HOLD_AMOUNT_SAVINGS_COMMAND, savingsID), getSavingsTransactionJSON(amount, date), jsonAttributeToGetback); } public Integer releaseAmount(final Integer savingsId, final Integer transactionId) { - System.out.println("\n--------------------------------- SAVINGS TRANSACTION RELEASE AMOUNT--------------------------------"); + LOG.info("\n--------------------------------- SAVINGS TRANSACTION RELEASE AMOUNT--------------------------------"); return (Integer) performSavingActions(createAdjustTransactionURL(RELEASE_AMOUNT_SAVINGS_COMMAND, savingsId, transactionId), getSavingsTransactionJSON("1000", LAST_TRANSACTION_DATE), CommonConstants.RESPONSE_RESOURCE_ID); } @@ -356,7 +358,7 @@ private String getApproveSavingsAsJsonOnDate(final String approvalDate) { map.put("approvedOnDate", approvalDate); map.put("note", "Approval NOTE"); String savingsAccountApproveJson = new Gson().toJson(map); - System.out.println(savingsAccountApproveJson); + LOG.info(savingsAccountApproveJson); return savingsAccountApproveJson; } @@ -367,7 +369,7 @@ private String getRejectedSavingsAsJSON(final String rejectedOnDate) { map.put("rejectedOnDate", rejectedOnDate); map.put("note", "Rejected NOTE"); String savingsAccountJson = new Gson().toJson(map); - System.out.println(savingsAccountJson); + LOG.info(savingsAccountJson); return savingsAccountJson; } @@ -378,7 +380,7 @@ private String getWithdrawnSavingsAsJSON() { map.put("withdrawnOnDate", CREATED_DATE_PLUS_ONE); map.put("note", "Rejected NOTE"); String savingsAccountJson = new Gson().toJson(map); - System.out.println(savingsAccountJson); + LOG.info(savingsAccountJson); return savingsAccountJson; } @@ -388,7 +390,7 @@ private String getActivatedSavingsAsJSON() { map.put("dateFormat", CommonConstants.dateFormat); map.put("activatedOnDate", TRANSACTION_DATE); String savingsAccountActivateJson = new Gson().toJson(map); - System.out.println(savingsAccountActivateJson); + LOG.info(savingsAccountActivateJson); return savingsAccountActivateJson; } @@ -399,14 +401,14 @@ private String getSavingsTransactionJSON(final String amount, final String trans map.put("transactionDate", transactionDate); map.put("transactionAmount", amount); String savingsAccountWithdrawalJson = new Gson().toJson(map); - System.out.println(savingsAccountWithdrawalJson); + LOG.info(savingsAccountWithdrawalJson); return savingsAccountWithdrawalJson; } private String getCalculatedInterestForSavingsApplicationAsJSON() { final HashMap map = new HashMap<>(); String savingsAccountCalculatedInterestJson = new Gson().toJson(map); - System.out.println(savingsAccountCalculatedInterestJson); + LOG.info(savingsAccountCalculatedInterestJson); return savingsAccountCalculatedInterestJson; } @@ -568,14 +570,14 @@ private Object performSavingActions(final String postURLForSavingsTransaction, f public Object closeSavingsAccountAndGetBackRequiredField(final Integer savingsID, String withdrawBalance, final String jsonAttributeToGetBack, final String closedOnDate) { - System.out.println("---------------------------------- CLOSE SAVINGS APPLICATION ----------------------------------"); + LOG.info("---------------------------------- CLOSE SAVINGS APPLICATION ----------------------------------"); return performSavingActions(createSavingsOperationURL(CLOSE_SAVINGS_COMMAND, savingsID), getCloseAccountJSON(withdrawBalance, closedOnDate), jsonAttributeToGetBack); } public Object closeSavingsAccountPostInterestAndGetBackRequiredField(final Integer savingsID, String withdrawBalance, final String jsonAttributeToGetBack, final String closedOnDate) { - System.out.println("---------------------------------- CLOSE SAVINGS APPLICATION ----------------------------------"); + LOG.info("---------------------------------- CLOSE SAVINGS APPLICATION ----------------------------------"); return performSavingActions(createSavingsOperationURL(CLOSE_SAVINGS_COMMAND, savingsID), getCloseAccountPostInterestJSON(withdrawBalance, closedOnDate), jsonAttributeToGetBack); } @@ -656,7 +658,7 @@ public static Integer openSavingsAccount(final RequestSpecification requestSpec, private static Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String minOpenningBalance) { - System.out.println("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------"); SavingsProductHelper savingsProductHelper = new SavingsProductHelper(); final String savingsProductJSON = savingsProductHelper // .withInterestCompoundingPeriodTypeAsDaily() // 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 4ec4eb4af72..e1b5f79b8ef 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 @@ -21,9 +21,11 @@ import com.google.gson.Gson; import java.util.HashMap; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SavingsApplicationTestBuilder { - + private final static Logger LOG = LoggerFactory.getLogger(SavingsApplicationTestBuilder.class); private static final String LOCALE = "en_GB"; private String submittedOnDate = ""; @@ -56,7 +58,7 @@ public String build(final String ID, final String savingsProductId, final String map.put("datatables", this.datatables); } String savingsApplicationJSON = new Gson().toJson(map); - System.out.println(savingsApplicationJSON); + LOG.info(savingsApplicationJSON); return savingsApplicationJSON; } 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 fc852b5ebec..01720bfaa9a 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 @@ -28,10 +28,12 @@ import java.util.Map; import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.accounting.Account; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings("unused") public class SavingsProductHelper { - + private final static Logger LOG = LoggerFactory.getLogger(SavingsProductHelper.class); private static final String SAVINGS_PRODUCT_URL = "/fineract-provider/api/v1/savingsproducts"; private static final String CREATE_SAVINGS_PRODUCT_URL = SAVINGS_PRODUCT_URL + "?" + Utils.TENANT_IDENTIFIER; @@ -139,7 +141,7 @@ public String build() { } String savingsProductCreateJson = new Gson().toJson(map); - System.out.println(savingsProductCreateJson); + LOG.info(savingsProductCreateJson); return savingsProductCreateJson; } @@ -275,7 +277,7 @@ public static Integer createSavingsProduct(final String savingsProductJSON, fina public static void verifySavingsProductCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedProductID) { - System.out.println("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); final String GET_SAVINGS_PRODUCT_URL = SAVINGS_PRODUCT_URL + "/" + generatedProductID + "?" + Utils.TENANT_IDENTIFIER; final Integer responseSavingsProductID = Utils.performServerGet(requestSpec, responseSpec, GET_SAVINGS_PRODUCT_URL, "id"); assertEquals("ERROR IN CREATING THE Savings Product", generatedProductID, responseSavingsProductID); 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 7dbdaaac46c..f484cfff047 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 @@ -24,52 +24,54 @@ import com.jayway.restassured.specification.ResponseSpecification; import java.util.HashMap; import org.apache.fineract.integrationtests.common.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings("rawtypes") public class SavingsStatusChecker { - + private final static Logger LOG = LoggerFactory.getLogger(SavingsStatusChecker.class); private static final String SAVINGS_ACCOUNT_URL = "/fineract-provider/api/v1/savingsaccounts"; public static void verifySavingsIsApproved(final HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS APPROVED ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS APPROVED ------------------------------------"); assertTrue("ERROR IN APPROVING SAVINGS APPLICATION", getStatus(savingsStatusHashMap, "approved")); - System.out.println("Savings Application Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsIsPending(final HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS PENDING ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS PENDING ------------------------------------"); assertTrue("SAVINGS ACCOUNT IS NOT IN PENDING STATE", getStatus(savingsStatusHashMap, "submittedAndPendingApproval")); - System.out.println("Savings Application Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsIsActive(final HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); assertTrue("ERROR IN ACTIVATING THE SAVINGS APPLICATION", getStatus(savingsStatusHashMap, "active")); - System.out.println("Savings Application Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsIsRejected(final HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS REJECTED ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS REJECTED ------------------------------------"); assertTrue("ERROR IN REJECTING THE SAVINGS APPLICATION", getStatus(savingsStatusHashMap, "rejected")); - System.out.println("Savings Application Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsIsWithdrawn(final HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS WITHDRAWN ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS WITHDRAWN ------------------------------------"); assertTrue("ERROR IN WITHDRAW THE SAVINGS APPLICATION", getStatus(savingsStatusHashMap, "withdrawnByApplicant")); - System.out.println("Savings Application Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsAccountIsClosed(final HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS CLOSED ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS CLOSED ------------------------------------"); assertTrue("ERROR IN CLOSING THE SAVINGS APPLICATION", getStatus(savingsStatusHashMap, "closed")); - System.out.println("Savings Application Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsAccountIsNotActive(final HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS INACTIVE ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS INACTIVE ------------------------------------"); assertTrue(getStatus(savingsStatusHashMap, "active")); - System.out.println("Savings Application Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Status:" + savingsStatusHashMap + "\n"); } public static HashMap getStatusOfSavings(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, @@ -89,52 +91,52 @@ private static boolean getStatus(final HashMap savingsStatusMap, final String na } public static void verifySavingsSubStatusInactive(HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap, "inactive")); - System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsSubStatusDormant(HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap, "dormant")); - System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsSubStatusEscheat(HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap, "escheat")); - System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsSubStatusNone(HashMap savingsStatusHashMap) { - System.out.println("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); + LOG.info("\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap, "none")); - System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsSubStatusblock(HashMap savingsStatusHashMap) { - System.out.println( + LOG.info( "\n-------------------------------------- VERIFYING SAVINGS ACCOUNT IS BLOCKED ------------------------------------"); assertTrue("block", getStatus(savingsStatusHashMap, "block")); - System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsSubStatusIsNone(HashMap savingsStatusHashMap) { - System.out.println("\n------------------------- VERIFYING SAVINGS ACCOUNT IS NOT BLOCKED FOR ANY TYPE OF TRANSACTIONS ---------------------------"); + LOG.info("\n------------------------- VERIFYING SAVINGS ACCOUNT IS NOT BLOCKED FOR ANY TYPE OF TRANSACTIONS ---------------------------"); assertTrue("none", getStatus(savingsStatusHashMap, "none")); - System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsSubStatusIsDebitBlocked(HashMap savingsStatusHashMap) { - System.out.println("\n--------------------- VERIFYING SAVINGS APPLICATION IS BLOCKED FOR DEBIT TRANSACTIONS ---------------------"); + LOG.info("\n--------------------- VERIFYING SAVINGS APPLICATION IS BLOCKED FOR DEBIT TRANSACTIONS ---------------------"); assertTrue("status is blockDebit", getStatus(savingsStatusHashMap, "blockDebit")); - System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); } public static void verifySavingsSubStatusIsCreditBlocked(HashMap savingsStatusHashMap) { - System.out.println("\n---------------------- VERIFYING SAVINGS APPLICATION IS BLOCKED FOR CREDIT TRANSACTIONS ---------------"); + LOG.info("\n---------------------- VERIFYING SAVINGS APPLICATION IS BLOCKED FOR CREDIT TRANSACTIONS ---------------"); assertTrue("blockCredit ", getStatus(savingsStatusHashMap, "blockCredit")); - System.out.println("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); + LOG.info("Savings Application Sub Status:" + savingsStatusHashMap + "\n"); } } \ No newline at end of file diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountHelper.java index f924c68e502..321af1c2dd0 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountHelper.java @@ -23,10 +23,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ShareAccountHelper { - + private final static Logger LOG = LoggerFactory.getLogger(ShareAccountHelper.class); private static final String LOCALE = "en_GB"; private String clientId ; @@ -96,7 +98,7 @@ public String build() { } String shareAccountCreateJson = new Gson().toJson(map); - System.out.println(shareAccountCreateJson); + LOG.info(shareAccountCreateJson); return shareAccountCreateJson; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountIntegrationTests.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountIntegrationTests.java index 836d1ce250b..1ac526f384b 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountIntegrationTests.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountIntegrationTests.java @@ -40,9 +40,11 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ShareAccountIntegrationTests { - + private final static Logger LOG = LoggerFactory.getLogger(ShareAccountIntegrationTests.class); private RequestSpecification requestSpec; private ResponseSpecification responseSpec; private ShareProductHelper shareProductHelper; @@ -59,21 +61,21 @@ public void setup() { public void testCreateShareProduct() { // This method will check create share product, get share product, // update share product. - System.out.println("------------------------------CREATING NEW SHARE PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW SHARE PRODUCT ---------------------------------------"); shareProductHelper = new ShareProductHelper(); final Integer shareProductId = createShareProduct(); Assert.assertNotNull(shareProductId); - System.out.println("------------------------------CREATING SHARE PRODUCT COMPLETE---------------------------------------"); + LOG.info("------------------------------CREATING SHARE PRODUCT COMPLETE---------------------------------------"); - System.out.println("------------------------------RETRIEVING SHARE PRODUCT---------------------------------------"); + LOG.info("------------------------------RETRIEVING SHARE PRODUCT---------------------------------------"); Map shareProductData = ShareProductTransactionHelper .retrieveShareProduct(shareProductId, requestSpec, responseSpec); Assert.assertNotNull(shareProductData); shareProductHelper.verifyShareProduct(shareProductData); - System.out.println("------------------------------RETRIEVING SHARE PRODUCT COMPLETE---------------------------------------"); + LOG.info("------------------------------RETRIEVING SHARE PRODUCT COMPLETE---------------------------------------"); - System.out.println("------------------------------UPDATING SHARE PRODUCT---------------------------------------"); + LOG.info("------------------------------UPDATING SHARE PRODUCT---------------------------------------"); Map shareProductDataForUpdate = new HashMap<>(); @@ -90,7 +92,7 @@ public void testCreateShareProduct() { String updatedSharesIssued = String.valueOf(updatedShareProductData.get("totalSharesIssued")); Assert.assertEquals("2000", updatedTotalShares); Assert.assertEquals("2000", updatedSharesIssued); - System.out.println("------------------------------UPDATING SHARE PRODUCT COMPLETE---------------------------------------"); + LOG.info("------------------------------UPDATING SHARE PRODUCT COMPLETE---------------------------------------"); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareProductHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareProductHelper.java index f6b82e831aa..2a46268e533 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareProductHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareProductHelper.java @@ -29,11 +29,13 @@ import org.apache.fineract.integrationtests.common.Utils; import org.joda.time.LocalDate; import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ShareProductHelper { - + private final static Logger LOG = LoggerFactory.getLogger(ShareProductHelper.class); private static final String NONE = "1"; private static final String CASH_BASED = "2"; private static final String LOCALE = "en_GB"; @@ -94,7 +96,7 @@ public String build() { } String shareProductCreateJson = new Gson().toJson(map); - System.out.println(shareProductCreateJson); + LOG.info(shareProductCreateJson); return shareProductCreateJson; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/system/AccountNumberPreferencesHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/system/AccountNumberPreferencesHelper.java index 11bc4d09ad2..6b14b19cb0d 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/system/AccountNumberPreferencesHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/system/AccountNumberPreferencesHelper.java @@ -23,9 +23,11 @@ import java.util.ArrayList; import java.util.HashMap; import org.apache.fineract.integrationtests.common.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class AccountNumberPreferencesHelper { - + private final static Logger LOG = LoggerFactory.getLogger(AccountNumberPreferencesHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -41,8 +43,7 @@ public AccountNumberPreferencesHelper( public Object createClientAccountNumberPreference( ResponseSpecification responseSpec, String jsonAttributeToGetBack) { - System.out - .println("---------------------------------CREATING CLIENT ACCOUNT NUMBER PREFERENCE------------------------------------------"); + LOG.info("---------------------------------CREATING CLIENT ACCOUNT NUMBER PREFERENCE------------------------------------------"); final String requestJSON = new AccountNumberPreferencesTestBuilder() .clientBuild(); @@ -56,8 +57,7 @@ public Object createClientAccountNumberPreference( public Object createLoanAccountNumberPreference( ResponseSpecification responseSpec, String jsonAttributeToGetBack) { - System.out - .println("---------------------------------CREATING LOAN ACCOUNT NUMBER PREFERENCE------------------------------------------"); + LOG.info("---------------------------------CREATING LOAN ACCOUNT NUMBER PREFERENCE------------------------------------------"); final String requestJSON = new AccountNumberPreferencesTestBuilder() .loanBuild(); @@ -70,8 +70,7 @@ public Object createLoanAccountNumberPreference( public Object createSavingsAccountNumberPreference( ResponseSpecification responseSpec, String jsonAttributeToGetBack) { - System.out - .println("---------------------------------CREATING SAVINGS ACCOUNT NUMBER PREFERENCE------------------------------------------"); + LOG.info("---------------------------------CREATING SAVINGS ACCOUNT NUMBER PREFERENCE------------------------------------------"); final String requestJSON = new AccountNumberPreferencesTestBuilder() .savingsBuild(); @@ -85,8 +84,7 @@ public Object createSavingsAccountNumberPreference( public Object createGroupsAccountNumberPreference( ResponseSpecification responseSpec, String jsonAttributeToGetBack) { - System.out - .println("---------------------------------CREATING GROUPS ACCOUNT NUMBER PREFERENCE------------------------------------------"); + LOG.info("---------------------------------CREATING GROUPS ACCOUNT NUMBER PREFERENCE------------------------------------------"); final String requestJSON = new AccountNumberPreferencesTestBuilder() .groupsBuild(); @@ -100,8 +98,7 @@ public Object createGroupsAccountNumberPreference( public Object createCenterAccountNumberPreference( ResponseSpecification responseSpec, String jsonAttributeToGetBack) { - System.out - .println("---------------------------------CREATING CENTER ACCOUNT NUMBER PREFERENCE------------------------------------------"); + LOG.info("---------------------------------CREATING CENTER ACCOUNT NUMBER PREFERENCE------------------------------------------"); final String requestJSON = new AccountNumberPreferencesTestBuilder() .centerBuild(); @@ -146,8 +143,7 @@ public HashMap deleteAccountNumberPreference( final Integer accountNumberFormatId, ResponseSpecification responseSpec, String jsonAttributeToGetBack) { - System.out - .println("---------------------------------DELETING ACCOUNT NUMBER PREFERENCE------------------------------------------"); + LOG.info("---------------------------------DELETING ACCOUNT NUMBER PREFERENCE------------------------------------------"); final String URL = ACCOUNT_NUMBER_FORMATS_REQUEST_URL + "/" + accountNumberFormatId + "?" + Utils.TENANT_IDENTIFIER; diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/system/DatatableHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/system/DatatableHelper.java index b97b3878a92..deb6f9f32b7 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/system/DatatableHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/system/DatatableHelper.java @@ -27,9 +27,11 @@ import java.util.HashMap; import java.util.List; import org.apache.fineract.integrationtests.common.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class DatatableHelper { - + private final static Logger LOG = LoggerFactory.getLogger(DatatableHelper.class); private final RequestSpecification requestSpec; private final ResponseSpecification responseSpec; @@ -58,7 +60,7 @@ public Integer deleteDatatableEntries(final String datatableName, final Integer public static void verifyDatatableCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String generatedDatatableName) { - System.out.println("------------------------------CHECK DATATABLE DETAILS------------------------------------\n"); + LOG.info("------------------------------CHECK DATATABLE DETAILS------------------------------------\n"); final String responseRegisteredTableName = Utils.performServerGet(requestSpec, responseSpec, DATATABLE_URL + "/" + generatedDatatableName + "?" + Utils.TENANT_IDENTIFIER, "registeredTableName"); assertEquals("ERROR IN CREATING THE DATATABLE", generatedDatatableName, responseRegisteredTableName); @@ -76,7 +78,7 @@ public static String getTestDatatableAsJSON(final String apptableName, final boo addDatatableColumns(datatableColumnsList, "Date of Approval", "Date", false, null); map.put("columns", datatableColumnsList); String requestJsonString = new Gson().toJson(map); - System.out.println("map : " + requestJsonString); + LOG.info("map : " + requestJsonString); return requestJsonString; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/loanaccount/guarantor/GuarantorTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/loanaccount/guarantor/GuarantorTest.java index 5702b55fa40..89476a74371 100755 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/loanaccount/guarantor/GuarantorTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/loanaccount/guarantor/GuarantorTest.java @@ -45,9 +45,11 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class GuarantorTest { - + private final static Logger LOG = LoggerFactory.getLogger(GuarantorTest.class); private ResponseSpecification responseSpec; private RequestSpecification requestSpec; private LoanTransactionHelper loanTransactionHelper; @@ -146,7 +148,7 @@ public void testGuarantor() { verifySavingsOnHoldBalance(externalSavigsId_2, null); Assert.assertNotNull(externalGuarantee_2); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); @@ -157,14 +159,14 @@ public void testGuarantor() { verifySavingsOnHoldBalance(externalSavigsId_1, external1_hold_funds); verifySavingsOnHoldBalance(externalSavigsId_2, external2_hold_funds); - System.out.println("-----------------------------------UNDO APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------UNDO APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.undoApproval(loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); verifySavingsOnHoldBalance(selfSavigsId, new Float(0)); verifySavingsOnHoldBalance(externalSavigsId_1, new Float(0)); verifySavingsOnHoldBalance(externalSavigsId_2, new Float(0)); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); @@ -172,7 +174,7 @@ public void testGuarantor() { verifySavingsOnHoldBalance(externalSavigsId_1, external1_hold_funds); verifySavingsOnHoldBalance(externalSavigsId_2, external2_hold_funds); - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); @@ -303,7 +305,7 @@ public void testGuarantor_UNDO_DISBURSAL() { Assert.assertNotNull(externalGuarantee_2); verifySavingsOnHoldBalance(externalSavigsId_2, null); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); @@ -314,14 +316,14 @@ public void testGuarantor_UNDO_DISBURSAL() { verifySavingsOnHoldBalance(externalSavigsId_1, external1_hold_funds); verifySavingsOnHoldBalance(externalSavigsId_2, external2_hold_funds); - System.out.println("-----------------------------------UNDO APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------UNDO APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.undoApproval(loanID); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); verifySavingsOnHoldBalance(selfSavigsId, new Float(0)); verifySavingsOnHoldBalance(externalSavigsId_1, new Float(0)); verifySavingsOnHoldBalance(externalSavigsId_2, new Float(0)); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); @@ -363,7 +365,7 @@ public void testGuarantor_UNDO_DISBURSAL() { } } - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); @@ -457,7 +459,7 @@ public void testGuarantor_RECOVER_GUARANTEES() { verifySavingsOnHoldBalance(externalSavigsId_1, null); Assert.assertNotNull(externalGuarantee_1); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); @@ -466,7 +468,7 @@ public void testGuarantor_RECOVER_GUARANTEES() { verifySavingsOnHoldBalance(selfSavigsId, self1_hold_funds); verifySavingsOnHoldBalance(externalSavigsId_1, external1_hold_funds); - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); @@ -530,7 +532,7 @@ public void testGuarantor_RECOVER_GUARANTEES_WITH_MORE_GUARANTEE() { verifySavingsOnHoldBalance(externalSavigsId_1, null); Assert.assertNotNull(externalGuarantee_1); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); @@ -539,7 +541,7 @@ public void testGuarantor_RECOVER_GUARANTEES_WITH_MORE_GUARANTEE() { verifySavingsOnHoldBalance(selfSavigsId, self1_hold_funds); verifySavingsOnHoldBalance(externalSavigsId_1, external1_hold_funds); - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); @@ -599,7 +601,7 @@ public void testGuarantor_WRITE_OFF_LOAN() { Assert.assertNotNull(externalGuarantee_1); verifySavingsOnHoldBalance(externalSavigsId_1, null); - System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------"); + LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); @@ -608,7 +610,7 @@ public void testGuarantor_WRITE_OFF_LOAN() { verifySavingsOnHoldBalance(selfSavigsId, self1_hold_funds); verifySavingsOnHoldBalance(externalSavigsId_1, external1_hold_funds); - System.out.println("-------------------------------DISBURSE LOAN-------------------------------------------"); + LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); @@ -660,7 +662,7 @@ private boolean checkForErrorCode(final ArrayList errorData, final Stri private Integer createLoanProductWithHoldFunds(final String mandatoryGuarantee, final String minimumGuaranteeFromGuarantor, final String minimumGuaranteeFromOwnFunds) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); LoanProductTestBuilder builder = new LoanProductTestBuilder().withPrincipal("10000.00").withNumberOfRepayments("4") .withRepaymentAfterEvery("1").withRepaymentTypeAsWeek().withinterestRatePerPeriod("2") .withInterestRateFrequencyTypeAsMonths().withAmortizationTypeAsEqualPrincipalPayment().withInterestTypeAsDecliningBalance() @@ -671,7 +673,7 @@ private Integer createLoanProductWithHoldFunds(final String mandatoryGuarantee, } private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID, final String disbursementDate) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal("10000.00") // .withLoanTermFrequency("4") // diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/loanaccount/guarantor/GuarantorTestBuilder.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/loanaccount/guarantor/GuarantorTestBuilder.java index f82ea9aeeff..61762c30d61 100755 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/loanaccount/guarantor/GuarantorTestBuilder.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/loanaccount/guarantor/GuarantorTestBuilder.java @@ -21,9 +21,11 @@ import com.google.gson.Gson; import java.util.HashMap; import org.apache.fineract.integrationtests.common.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class GuarantorTestBuilder { - + private final static Logger LOG = LoggerFactory.getLogger(GuarantorTestBuilder.class); private static final String GUARANTOR_TYPE_CUSTOMER = "1"; @SuppressWarnings("unused") private static final String GUARANTOR_TYPE_STAFF = "2"; @@ -57,7 +59,7 @@ public String build() { map.put("amount", guaranteeAmount); map.put("savingsId", savingsId); } - System.out.println("map : " + map); + LOG.info("map : " + map); return new Gson().toJson(map); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsDecliningBalanceHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsDecliningBalanceHelper.java index cfdb9bcca82..6ba18b881e0 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsDecliningBalanceHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsDecliningBalanceHelper.java @@ -30,12 +30,14 @@ import org.apache.fineract.integrationtests.common.accounting.Account; import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder; import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({"rawtypes", "unchecked"}) public class VariableInstallmentsDecliningBalanceHelper { - + private final static Logger LOG = LoggerFactory.getLogger(VariableInstallmentsDecliningBalanceHelper.class); public static String createLoanProductWithoutVaribleConfig(final boolean multiDisburseLoan, final String accountingRule, final Account... accounts) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); final String loanProductJSON = new LoanProductTestBuilder() // .withPrincipal("1,00,000.00") // .withNumberOfRepayments("4") // @@ -51,7 +53,7 @@ public static String createLoanProductWithoutVaribleConfig(final boolean multiDi } public static String createLoanProductWithVaribleConfig(final boolean multiDisburseLoan, final String accountingRule, final Account... accounts) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); final String loanProductJSON = new LoanProductTestBuilder() // .withPrincipal("1,00,000.00") // .withNumberOfRepayments("4") // @@ -69,7 +71,7 @@ public static String createLoanProductWithVaribleConfig(final boolean multiDisbu } public static String createLoanProductWithVaribleConfigwithEqualPrincipal(final boolean multiDisburseLoan, final String accountingRule, final Account... accounts) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); final String loanProductJSON = new LoanProductTestBuilder() // .withPrincipal("1,00,000.00") // .withNumberOfRepayments("4") // @@ -88,7 +90,7 @@ public static String createLoanProductWithVaribleConfigwithEqualPrincipal(final public static String applyForLoanApplication(final Integer clientID, final Integer loanProductID, List charges, final String savingsId, String principal) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) // .withLoanTermFrequency("4") // @@ -108,7 +110,7 @@ public static String applyForLoanApplication(final Integer clientID, final Integ public static String applyForLoanApplicationWithEqualPrincipal(final Integer clientID, final Integer loanProductID, List charges, final String savingsId, String principal) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) // .withLoanTermFrequency("4") // diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsFlatHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsFlatHelper.java index e39f6f1b5ef..c5a8ab21b07 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsFlatHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsFlatHelper.java @@ -30,12 +30,14 @@ import org.apache.fineract.integrationtests.common.accounting.Account; import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder; import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({"rawtypes", "unchecked"}) public class VariableInstallmentsFlatHelper { - + private final static Logger LOG = LoggerFactory.getLogger(VariableInstallmentsFlatHelper.class); public static String createLoanProductWithVaribleConfig(final boolean multiDisburseLoan, final String accountingRule, final Account... accounts) { - System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); + LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------"); final String loanProductJSON = new LoanProductTestBuilder() // .withPrincipal("1,00,000.00") // .withNumberOfRepayments("4") // @@ -55,7 +57,7 @@ public static String createLoanProductWithVaribleConfig(final boolean multiDisbu public static String applyForLoanApplication(final Integer clientID, final Integer loanProductID, List charges, final String savingsId, String principal) { - System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); + LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------"); final String loanApplicationJSON = new LoanApplicationTestBuilder() // .withPrincipal(principal) // .withLoanTermFrequency("4") // diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsIntegrationTest.java index 89ac2f24524..7c677913e15 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsIntegrationTest.java @@ -33,11 +33,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({"rawtypes", "unchecked"}) public class VariableInstallmentsIntegrationTest { - - + private final static Logger LOG = LoggerFactory.getLogger(VariableInstallmentsIntegrationTest.class); private static final String NONE = "1"; private RequestSpecification requestSpec; private ResponseSpecification responseSpec; @@ -56,7 +57,7 @@ public void setup() { public void testVariableLoanProductCreation() { final String json = VariableInstallmentsDecliningBalanceHelper.createLoanProductWithVaribleConfig(false, NONE); final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(json); - System.out.println("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------"); + LOG.info("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------"); Map loanProduct = (Map)loanTransactionHelper.getLoanProductDetail(requestSpec, responseSpec, loanProductID, "") ; Assert.assertTrue((Boolean)loanProduct.get("allowVariableInstallments")) ; Assert.assertEquals(new Integer(5), loanProduct.get("minimumGap")) ; @@ -68,7 +69,7 @@ public void testVariableLoanProductCreation() { public void testLoanProductCreation() { final String josn = VariableInstallmentsDecliningBalanceHelper.createLoanProductWithoutVaribleConfig(false, NONE); Integer loanProductID = this.loanTransactionHelper.getLoanProductId(josn); - System.out.println("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------"); + LOG.info("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------"); Map loanProduct = (Map)loanTransactionHelper.getLoanProductDetail(requestSpec, responseSpec, loanProductID, "") ; Assert.assertTrue(!(Boolean)loanProduct.get("allowVariableInstallments")) ; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/ApplicationExitUtil.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/ApplicationExitUtil.java index d83598d281c..7fc132887f8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/ApplicationExitUtil.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/ApplicationExitUtil.java @@ -22,10 +22,13 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.ConfigurableApplicationContext; public abstract class ApplicationExitUtil { + private final static Logger LOG = LoggerFactory.getLogger(ApplicationExitUtil.class); private ApplicationExitUtil() {} public static void waitForKeyPressToCleanlyExit(ConfigurableApplicationContext ctx) throws IOException { @@ -34,7 +37,7 @@ public static void waitForKeyPressToCleanlyExit(ConfigurableApplicationContext c // button).. In the case of MariaDB4j that's a problem because then the // mysqld won't be stopped, so: // (@see https://bugs.eclipse.org/bugs/show_bug.cgi?id=38016) - System.out.println("\nHit Enter to quit..."); + LOG.info("\nHit Enter to quit..."); // NOTE: In Eclipse, System.console() is not available.. so: // (@see https://bugs.eclipse.org/bugs/show_bug.cgi?id=122429) BufferedReader d = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8)); diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java index 4ab096d9ff5..87f893103e5 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java @@ -30,8 +30,8 @@ import com.jayway.restassured.specification.ResponseSpecification; import org.apache.commons.lang.StringUtils; import org.apache.http.conn.HttpHostConnectException; - - +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Util for RestAssured tests. This class here in src/test is copy/pasted :( @@ -47,6 +47,7 @@ public class Utils { private static final String LOGIN_URL = "/fineract-provider/api/v1/authentication?username=mifos&password=password&" + TENANT_IDENTIFIER; + private final static Logger LOG = LoggerFactory.getLogger(Utils.class); public static void initializeRESTAssured() { RestAssured.baseURI = "https://localhost"; RestAssured.port = 8443; @@ -55,7 +56,7 @@ public static void initializeRESTAssured() { public static String loginIntoServerAndGetBase64EncodedAuthenticationKey() { try { - System.out.println("-----------------------------------LOGIN-----------------------------------------"); + LOG.info("-----------------------------------LOGIN-----------------------------------------"); final String json = RestAssured.post(LOGIN_URL).asString(); assertThat("Failed to login into fineract platform", StringUtils.isBlank(json), is(false)); return JsonPath.with(json).get("base64EncodedAuthenticationKey"); diff --git a/fineract-provider/src/test/java/org/apache/fineract/mix/report/service/XBRLBuilderTest.java b/fineract-provider/src/test/java/org/apache/fineract/mix/report/service/XBRLBuilderTest.java index 4f0a83ff34c..66cd7d53ba9 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/mix/report/service/XBRLBuilderTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/mix/report/service/XBRLBuilderTest.java @@ -43,12 +43,14 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.runners.MockitoJUnitRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; @RunWith(MockitoJUnitRunner.class) public class XBRLBuilderTest { - + private final static Logger LOG = LoggerFactory.getLogger(XBRLBuilderTest.class); @Mock private NamespaceReadPlatformServiceImpl readNamespaceService; @InjectMocks @@ -72,7 +74,7 @@ public void shouldCorrectlyBuildMap() { when(data1.getName()).thenReturn("Assets"); map.put(data1, new BigDecimal(10000)); final String result = this.xbrlBuilder.build(map, Date.valueOf("2005-11-11"), Date.valueOf("2013-07-17"), "USD"); - System.out.println(result); + LOG.info(result); NodeList nodes = null; try { nodes = diff --git a/fineract-provider/src/test/java/org/apache/fineract/notification/Listener.java b/fineract-provider/src/test/java/org/apache/fineract/notification/Listener.java index 7c9fff7c2af..c40827bb24e 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/notification/Listener.java +++ b/fineract-provider/src/test/java/org/apache/fineract/notification/Listener.java @@ -22,13 +22,15 @@ import javax.jms.Message; import javax.jms.Session; import javax.jms.TextMessage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.jms.listener.SessionAwareMessageListener; public class Listener implements SessionAwareMessageListener { - + private final static Logger LOG = LoggerFactory.getLogger(Listener.class); @Override public void onMessage(Message message, Session session) throws JMSException { TextMessage msg = (TextMessage) message; - System.out.println("Received: " + msg.getText()); + LOG.debug("Received: {}", msg.getText()); } } diff --git a/fineract-provider/src/test/java/org/apache/fineract/notification/SenderTest.java b/fineract-provider/src/test/java/org/apache/fineract/notification/SenderTest.java index 6176b9e35c0..26d2356440d 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/notification/SenderTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/notification/SenderTest.java @@ -25,6 +25,8 @@ import org.apache.fineract.notification.data.NotificationData; import org.junit.Test; import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jms.core.JmsTemplate; import org.springframework.jms.core.MessageCreator; @@ -36,6 +38,7 @@ }) @RunWith(SpringJUnit4ClassRunner.class) public class SenderTest { + private final static Logger LOG = LoggerFactory.getLogger(SenderTest.class); @Autowired private JmsTemplate jmsTemplate; @@ -68,7 +71,7 @@ public void notificationCreation() { jmsTemplate.send(mockQueue, new MessageCreator() { @Override public Message createMessage(Session session) throws JMSException { - System.out.println("Message send successfully"); + LOG.info("Message send successfully"); return session.createObjectMessage(notificationData); } });