FINERACT-1021 - Update to JUnit 5

This commit is contained in:
xurror
2020-06-14 12:52:18 +02:00
committed by Michael Vorburger ⛑️
parent 2aa01b93b4
commit f2624b584c
120 changed files with 2599 additions and 2504 deletions
+1 -1
View File
@@ -311,7 +311,7 @@ If your PR is failing to pass our CI build due to a test failure, then:
1. If you suspect it is because of a "flaky" test, and not due to a change in your PR, then please do not simply wait for an active maintainer to come and help you, but instead be a proactive contributor to the project - see next steps. Do understand that we may not review PRs that are not green - it is the contributor's (that's you!) responsability to get a proposed PR to pass the build, not primarily the maintainers.
1. Search for the name of the failed test on https://issues.apache.org/jira/, e.g. for `AccountingScenarioIntegrationTest` you would find [FINERACT-899](https://issues.apache.org/jira/browse/FINERACT-899).
1. If you happen to read in such bugs that tests were just recently fixed, or ignored, then rebase your PR to pick up that change.
1. If you find previous comments "proving" that the same test has arbitrarily failed in at least 3 past PRs, then please do yourself raise a small separate new PR proposing to add an `@Ignore // TODO FINERACT-123` to the respective unstable test (e.g. [#774](https://github.com/apache/fineract/pull/774)) with the commit message mentioning said JIRA, as always. (Please do NOT just `@Ignore` any existing tests mixed in as part of your larger PR.)
1. If you find previous comments "proving" that the same test has arbitrarily failed in at least 3 past PRs, then please do yourself raise a small separate new PR proposing to add an `@Disabled // TODO FINERACT-123` to the respective unstable test (e.g. [#774](https://github.com/apache/fineract/pull/774)) with the commit message mentioning said JIRA, as always. (Please do NOT just `@Disabled` any existing tests mixed in as part of your larger PR.)
1. If there is no existing JIRA for the test, then first please evaluate whether the failure couldn't be a (perhaps strange) impact of the change you are proposing after all. If it's not, then please raise a new JIRA to document the suspected Flaky Test, and link it to [FINERACT-850](https://issues.apache.org/jira/browse/FINERACT-850). This will allow the next person coming along hitting the same test failure to easily find it, and eventually propose to ignore the unstable test.
1. Then (only) Close and Reopen your PR, which will cause a new build, to see if it passes.
1. Of course, we very much appreciate you then jumping onto any such bugs and helping us figure out how to fix all ignored tests!
+1 -1
View File
@@ -105,8 +105,8 @@ dependencyManagement {
dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
dependency 'org.apache.activemq:activemq-broker:5.15.13'
dependency 'org.apache.bval:org.apache.bval.bundle:2.0.3'
dependency 'junit:junit:4.13' // TODO FINERACT-1018??
dependency 'org.mockito:mockito-core:3.3.3'
dependency 'org.mockito:mockito-junit-jupiter:3.3.3'
dependency 'io.github.classgraph:classgraph:4.8.86'
dependency 'org.awaitility:awaitility:4.0.3'
dependency 'com.github.spotbugs:spotbugs-annotations:4.0.4'
+3 -3
View File
@@ -117,9 +117,8 @@ dependencies {
// testCompile dependencies are ONLY used in src/test and/or src/integrationTest, not src/main.
// Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly!
//
testImplementation( 'junit:junit',
'org.junit.platform:junit-platform-runner', // FINERACT-943
'org.mockito:mockito-core',
testImplementation( 'org.mockito:mockito-core',
'org.mockito:mockito-junit-jupiter',
'io.github.classgraph:classgraph',
'org.awaitility:awaitility'
)
@@ -129,5 +128,6 @@ dependencies {
}
testImplementation ('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'com.jayway.jsonpath', module: 'json-path'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
@@ -40,9 +40,9 @@ import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.system.AccountNumberPreferencesHelper;
import org.apache.fineract.integrationtests.common.system.CodeHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -88,7 +88,7 @@ public class AccountNumberPreferencesTest {
private Integer centerId;
private String groupAccountNo;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -159,7 +159,7 @@ public class AccountNumberPreferencesTest {
HashMap<String, Object> deletionError = this.accountNumberPreferencesHelper.deleteAccountNumberPreference(10,
this.responseNotFoundError, "");
Assert.assertEquals("error.msg.resource.not.found", deletionError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
Assertions.assertEquals("error.msg.resource.not.found", deletionError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
private void validateDefaultAccountNumberGeneration() {
@@ -216,7 +216,7 @@ public class AccountNumberPreferencesTest {
HashMap<String, Object> creationError = this.accountNumberPreferencesHelper.createAccountNumberPreferenceWithInvalidData(
this.responseForbiddenError, accountType, prefixType, "");
Assert.assertEquals("error.msg.account.number.format.duplicate.account.type",
Assertions.assertEquals("error.msg.account.number.format.duplicate.account.type",
creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
@@ -231,11 +231,11 @@ public class AccountNumberPreferencesTest {
if (creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).equals(
"validation.msg.accountNumberFormat.accountType.is.not.within.expected.range")) {
Assert.assertEquals("validation.msg.accountNumberFormat.accountType.is.not.within.expected.range",
Assertions.assertEquals("validation.msg.accountNumberFormat.accountType.is.not.within.expected.range",
creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
} else if (creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).equals(
"validation.msg.accountNumberFormat.prefixType.is.not.one.of.expected.enumerations")) {
Assert.assertEquals("validation.msg.accountNumberFormat.prefixType.is.not.one.of.expected.enumerations",
Assertions.assertEquals("validation.msg.accountNumberFormat.prefixType.is.not.one.of.expected.enumerations",
creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
}
@@ -257,13 +257,13 @@ public class AccountNumberPreferencesTest {
HashMap<String, Object> updationError = this.accountNumberPreferencesHelper.updateAccountNumberPreference(9999, "101",
this.responseNotFoundError, "");
if (updationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).equals("error.msg.resource.not.found")) {
Assert.assertEquals("error.msg.resource.not.found", updationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
Assertions.assertEquals("error.msg.resource.not.found", updationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
/* Invalid Prefix Type */
HashMap<String, Object> updationError1 = this.accountNumberPreferencesHelper.updateAccountNumberPreference(
this.clientAccountNumberPreferenceId, "103", this.responseValidationError, "");
Assert.assertEquals("validation.msg.validation.errors.exist", updationError1.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
Assertions.assertEquals("validation.msg.validation.errors.exist", updationError1.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
@@ -309,8 +309,8 @@ public class AccountNumberPreferencesTest {
String name = "CenterCreation" + new Timestamp(new java.util.Date().getTime());
this.centerId = CenterHelper.createCenter(name, officeId, requestSpec, responseSpec);
CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec);
Assert.assertNotNull(center);
Assert.assertTrue(center.getName().equals(name));
Assertions.assertNotNull(center);
Assertions.assertTrue(center.getName().equals(name));
if (isAccountPreferenceSetUp) {
String centerPrefixName = (String) this.accountNumberPreferencesHelper.getAccountNumberPreference(
@@ -329,7 +329,7 @@ public class AccountNumberPreferencesTest {
private void createAndValidateClientWithoutAccountPreference() {
this.clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(this.clientId);
Assertions.assertNotNull(this.clientId);
String clientAccountNo = (String) ClientHelper.getClient(requestSpec, responseSpec, this.clientId.toString(), "accountNo");
validateAccountNumberLengthAndStartsWithPrefix(clientAccountNo, null);
}
@@ -356,14 +356,14 @@ public class AccountNumberPreferencesTest {
this.clientId = ClientHelper.createClientForAccountPreference(this.requestSpec, this.responseSpec, this.clientCodeValueId,
"clientId");
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
clientAccountNo = (String) ClientHelper.getClient(this.requestSpec, this.responseSpec, this.clientId.toString(), "accountNo");
this.validateAccountNumberLengthAndStartsWithPrefix(clientAccountNo, this.clientCodeValueName);
} else if (clientPrefixName.equals(this.officeName)) {
this.clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
clientAccountNo = (String) ClientHelper.getClient(requestSpec, responseSpec, this.clientId.toString(), "accountNo");
String officeName = (String) ClientHelper.getClient(requestSpec, responseSpec, this.clientId.toString(), "officeName");
this.validateAccountNumberLengthAndStartsWithPrefix(clientAccountNo, officeName);
@@ -373,10 +373,10 @@ public class AccountNumberPreferencesTest {
private void validateAccountNumberLengthAndStartsWithPrefix(final String accountNumber, String prefix) {
if (prefix != null) {
prefix = prefix.substring(0, Math.min(prefix.length(), 10));
Assert.assertEquals(accountNumber.length(), prefix.length() + 9);
Assert.assertTrue(accountNumber.startsWith(prefix));
Assertions.assertEquals(accountNumber.length(), prefix.length() + 9);
Assertions.assertTrue(accountNumber.startsWith(prefix));
} else {
Assert.assertEquals(9, accountNumber.length());
Assertions.assertEquals(9, accountNumber.length());
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -45,10 +45,10 @@ import org.apache.fineract.integrationtests.common.savings.AccountTransferHelper
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -87,7 +87,7 @@ public class AccountTransferTest {
private Integer financialActivityAccountId;
private Account liabilityTransferAccount;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -102,13 +102,13 @@ public class AccountTransferTest {
/** Setup liability transfer account **/
/** Create a Liability and an Asset Transfer Account **/
liabilityTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(liabilityTransferAccount);
Assertions.assertNotNull(liabilityTransferAccount);
/*** Create A Financial Activity to Account Mapping **/
financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
FinancialActivityAccountsTest.LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount.getAccountID(),
responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId);
Assertions.assertNotNull(financialActivityAccountId);
} else {
for (HashMap financialActivity : financialActivities) {
HashMap financialActivityData = (HashMap) financialActivity.get("financialActivityData");
@@ -125,12 +125,12 @@ public class AccountTransferTest {
/**
* Delete the Liability transfer account
*/
@After
@AfterEach
public void tearDown() {
Integer deletedFinancialActivityAccountId = financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
}
@Test
@@ -145,20 +145,20 @@ public class AccountTransferTest {
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
Integer toOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(toOfficeId);
Assertions.assertNotNull(toOfficeId);
// Creating Savings Account to which fund to be Transferred
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(toOfficeId));
Assert.assertNotNull(toClientID);
Assertions.assertNotNull(toClientID);
final Integer toSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, assetAccount,
incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(toSavingsProductID);
Assertions.assertNotNull(toSavingsProductID);
final Integer toSavingsID = this.savingsAccountHelper.applyForSavingsApplication(toClientID, toSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(toSavingsProductID);
Assertions.assertNotNull(toSavingsProductID);
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsID);
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
@@ -172,20 +172,20 @@ public class AccountTransferTest {
final HashMap toSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(fromOfficeId);
Assertions.assertNotNull(fromOfficeId);
// Creating Savings Account from which the Fund has to be Transferred
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(fromOfficeId));
Assert.assertNotNull(fromClientID);
Assertions.assertNotNull(fromClientID);
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
assetAccount, incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(fromSavingsProductID);
Assertions.assertNotNull(fromSavingsProductID);
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(fromSavingsID);
Assertions.assertNotNull(fromSavingsID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
@@ -208,12 +208,12 @@ public class AccountTransferTest {
toSavingsBalance += Float.valueOf(ACCOUNT_TRANSFER_AMOUNT);
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance,
fromSavingsSummaryAfter.get("accountBalance"));
assertEquals(fromSavingsBalance, fromSavingsSummaryAfter.get("accountBalance"),
"Verifying From Savings Account Balance after Account Transfer");
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
assertEquals("Verifying To Savings Account Balance after Account Transfer", toSavingsBalance,
toSavingsSummaryAfter.get("accountBalance"));
assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
"Verifying To Savings Account Balance after Account Transfer");
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT),
JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] office2LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT),
@@ -244,21 +244,21 @@ public class AccountTransferTest {
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
Integer toOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(toOfficeId);
Assertions.assertNotNull(toOfficeId);
// Creating Loan Account to which fund to be Transferred
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(toOfficeId));
Assert.assertNotNull(toClientID);
Assertions.assertNotNull(toClientID);
Account toTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(toTransferAccount);
Assertions.assertNotNull(toTransferAccount);
final Integer toLoanProductID = createLoanProduct(loanAssetAccount, loanIncomeAccount, loanExpenseAccount, overpaymentAccount);
Assert.assertNotNull(toLoanProductID);
Assertions.assertNotNull(toLoanProductID);
final Integer toLoanID = applyForLoanApplication(toClientID, toLoanProductID);
Assert.assertNotNull(toLoanID);
Assertions.assertNotNull(toLoanID);
HashMap toLoanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, toLoanID);
LoanStatusChecker.verifyLoanIsPending(toLoanStatusHashMap);
@@ -270,20 +270,20 @@ public class AccountTransferTest {
LoanStatusChecker.verifyLoanIsActive(toLoanStatusHashMap);
Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(fromOfficeId);
Assertions.assertNotNull(fromOfficeId);
// Creating Savings Account from which the Fund has to be Transferred
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(fromOfficeId));
Assert.assertNotNull(fromClientID);
Assertions.assertNotNull(fromClientID);
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
assetAccount, incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(fromSavingsProductID);
Assertions.assertNotNull(fromSavingsProductID);
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(fromSavingsID);
Assertions.assertNotNull(fromSavingsID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
@@ -304,12 +304,12 @@ public class AccountTransferTest {
fromSavingsBalance -= TRANSFER_AMOUNT_ADJUST;
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance,
fromSavingsSummaryAfter.get("accountBalance"));
assertEquals(fromSavingsBalance, fromSavingsSummaryAfter.get("accountBalance"),
"Verifying From Savings Account Balance after Account Transfer");
HashMap toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, toLoanID);
assertEquals("Verifying To Loan Repayment Amount after Account Transfer", TRANSFER_AMOUNT_ADJUST,
toLoanSummaryAfter.get("totalRepayment"));
assertEquals(TRANSFER_AMOUNT_ADJUST, toLoanSummaryAfter.get("totalRepayment"),
"Verifying To Loan Repayment Amount after Account Transfer");
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
JournalEntry.TransactionType.CREDIT) };
@@ -340,20 +340,20 @@ public class AccountTransferTest {
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
Integer toOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(toOfficeId);
Assertions.assertNotNull(toOfficeId);
// Creating Loan Account to which fund to be Transferred
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(toOfficeId));
Assert.assertNotNull(toClientID);
Assertions.assertNotNull(toClientID);
final Integer toSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, assetAccount,
incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(toSavingsProductID);
Assertions.assertNotNull(toSavingsProductID);
final Integer toSavingsID = this.savingsAccountHelper.applyForSavingsApplication(toClientID, toSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(toSavingsID);
Assertions.assertNotNull(toSavingsID);
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsID);
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
@@ -365,18 +365,18 @@ public class AccountTransferTest {
SavingsStatusChecker.verifySavingsIsActive(toSavingsStatusHashMap);
Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(fromOfficeId);
Assertions.assertNotNull(fromOfficeId);
// Creating Savings Account from which the Fund has to be Transferred
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(fromOfficeId));
Assert.assertNotNull(fromClientID);
Assertions.assertNotNull(fromClientID);
final Integer loanProductID = createLoanProduct(loanAssetAccount, loanIncomeAccount, loanExpenseAccount, overpaymentAccount);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(fromClientID, loanProductID);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -389,11 +389,11 @@ public class AccountTransferTest {
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
assetAccount, incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(fromSavingsProductID);
Assertions.assertNotNull(fromSavingsProductID);
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(fromSavingsID);
Assertions.assertNotNull(fromSavingsID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
@@ -416,8 +416,8 @@ public class AccountTransferTest {
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
// Verifying fromSavings Account Balance after Account Transfer
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance,
fromSavingsSummaryAfter.get("accountBalance"));
assertEquals(fromSavingsBalance, fromSavingsSummaryAfter.get("accountBalance"),
"Verifying From Savings Account Balance after Account Transfer");
Float toSavingsBalance = Float.valueOf(MINIMUM_OPENING_BALANCE);
@@ -429,8 +429,8 @@ public class AccountTransferTest {
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
// Verifying toSavings Account Balance after Account Transfer
assertEquals("Verifying From Savings Account Balance after Account Transfer", toSavingsBalance,
toSavingsSummaryAfter.get("accountBalance"));
assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
"Verifying From Savings Account Balance after Account Transfer");
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
JournalEntry.TransactionType.CREDIT) };
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -60,9 +60,9 @@ import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.Days;
import org.joda.time.LocalDate;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -109,7 +109,7 @@ public class AccountingScenarioIntegrationTest {
private SchedulerJobHelper schedulerJobHelper;
private PeriodicAccrualAccountingHelper periodicAccrualAccountingHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -282,7 +282,7 @@ public class AccountingScenarioIntegrationTest {
CommonConstants.RESPONSE_RESOURCE_ID);
Float balance = SP_BALANCE + SP_DEPOSIT_AMOUNT;
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsID);
assertEquals("Verifying Balance after Deposit", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying Balance after Deposit");
LOG.info("----------------------Verifying Journal Entry after the Transaction Deposit----------------------------");
final JournalEntry[] assetAccountFirstTransactionEntry = { new JournalEntry(this.SP_DEPOSIT_AMOUNT,
@@ -298,7 +298,7 @@ public class AccountingScenarioIntegrationTest {
CommonConstants.RESPONSE_RESOURCE_ID);
balance -= SP_WITHDRAWAL_AMOUNT;
summary = this.savingsAccountHelper.getSavingsSummary(savingsID);
assertEquals("Verifying Balance after Withdrawal", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying Balance after Withdrawal");
LOG.info("-------------------Verifying Journal Entry after the Transaction Withdrawal----------------------");
final JournalEntry[] assetAccountSecondTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT,
@@ -312,11 +312,11 @@ public class AccountingScenarioIntegrationTest {
// Third Transaction-Add Charges for Withdrawal Fee
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalChargeId);
Assertions.assertNotNull(withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsID, withdrawalChargeId, false);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsID);
Assert.assertEquals(1, chargesPendingState.size());
Assertions.assertEquals(1, chargesPendingState.size());
HashMap savingsChargeForPay = chargesPendingState.get(0);
HashMap paidCharge = this.savingsAccountHelper.getSavingsCharge(savingsID, (Integer) savingsChargeForPay.get("id"));
Float chargeAmount = (Float) paidCharge.get("amount");
@@ -339,7 +339,7 @@ public class AccountingScenarioIntegrationTest {
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.TRANSACTION_DATE, incomeAccountThirdTransactionEntry);
// Verifying Balance after applying Charge for Withdrawal Fee
assertEquals("Verifying Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying Balance");
}
@Test
@@ -376,15 +376,15 @@ public class AccountingScenarioIntegrationTest {
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, assetAccount, incomeAccount, expenseAccount,
liabilityAccount);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, FixedDepositTest.WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -407,7 +407,7 @@ public class AccountingScenarioIntegrationTest {
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, ACTIVATION_DATE, liablilityAccountInitialEntry);
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -454,15 +454,15 @@ public class AccountingScenarioIntegrationTest {
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
Integer recurringDepositProductId = createRecurringDepositProduct(VALID_FROM, VALID_TO, assetAccount, liabilityAccount,
incomeAccount, expenseAccount);
Assert.assertNotNull(recurringDepositProductId);
Assertions.assertNotNull(recurringDepositProductId);
Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(),
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, RecurringDepositTest.WHOLE_TERM, EXPECTED_FIRST_DEPOSIT_ON_DATE);
Assert.assertNotNull(recurringDepositAccountId);
Assertions.assertNotNull(recurringDepositAccountId);
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
@@ -482,7 +482,7 @@ public class AccountingScenarioIntegrationTest {
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE);
Assert.assertNotNull(depositTransactionId);
Assertions.assertNotNull(depositTransactionId);
// Checking initial Journal entries after Activation.
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
@@ -493,7 +493,7 @@ public class AccountingScenarioIntegrationTest {
Integer interestPostingTransactionId = this.recurringDepositAccountHelper
.postInterestForRecurringDeposit(recurringDepositAccountId);
Assert.assertNotNull(interestPostingTransactionId);
Assertions.assertNotNull(interestPostingTransactionId);
HashMap accountSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -19,13 +19,13 @@
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import io.restassured.response.Response;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class ActuatorIntegrationTest {
@@ -24,15 +24,15 @@ import io.restassured.http.ContentType;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class ApiDocsTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -36,9 +36,9 @@ import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* Test class for
@@ -62,9 +62,9 @@ public class BatchApiTest {
/**
* Sets up the essential settings for the TEST like contentType,
* expectedStatusCode. It uses the '@Before' annotation provided by jUnit.
* expectedStatusCode. It uses the '@BeforeEach' annotation provided by jUnit.
*/
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
@@ -92,7 +92,7 @@ public class BatchApiTest {
// Verify that only 501 is returned as the status code
for (BatchResponse resp : response) {
Assert.assertEquals("Verify Status code 501", (long) 501, (long) resp.getStatusCode());
Assertions.assertEquals((long) 501, (long) resp.getStatusCode(), "Verify Status code 501");
}
}
@@ -112,7 +112,7 @@ public class BatchApiTest {
// Verify that a 200 response is returned as the status code
for (BatchResponse resp : response) {
Assert.assertEquals("Verify Status code 200", (long) 200, (long) resp.getStatusCode());
Assertions.assertEquals((long) 200, (long) resp.getStatusCode(), "Verify Status code 200");
}
}
@@ -155,8 +155,8 @@ public class BatchApiTest {
BatchHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, "TestExtId12");
// Asserts that all the transactions have been successfully rolled back
Assert.assertEquals(1, response.size());
Assert.assertEquals("Verify Status code 400", (long) 400, (long) response.get(0).getStatusCode());
Assertions.assertEquals(1, response.size());
Assertions.assertEquals((long) 400, (long) response.get(0).getStatusCode(), "Verify Status code 400");
}
/**
@@ -189,8 +189,8 @@ public class BatchApiTest {
final JsonObject changes = new FromJsonHelper().parse(response.get(1).getBody()).getAsJsonObject().get("changes").getAsJsonObject();
// Asserts the client information is successfully updated
Assert.assertEquals("Verify Firstname", "TestFirstName", changes.get("firstname").getAsString());
Assert.assertEquals("Verify Lastname", "TestLastName", changes.get("lastname").getAsString());
Assertions.assertEquals("Verify Firstname", "TestFirstName", changes.get("firstname").getAsString());
Assertions.assertEquals("Verify Lastname", "TestLastName", changes.get("lastname").getAsString());
}
/**
@@ -240,7 +240,7 @@ public class BatchApiTest {
// Get the clientId parameter from createClient Response
final JsonElement clientId = new FromJsonHelper().parse(response.get(0).getBody()).getAsJsonObject().get("clientId");
Assert.assertEquals("Verify Status Code 200" + clientId.getAsString(), 200L, (long) response.get(1).getStatusCode());
Assertions.assertEquals(200L, (long) response.get(1).getStatusCode(), "Verify Status Code 200" + clientId.getAsString());
}
/**
@@ -282,7 +282,7 @@ public class BatchApiTest {
final List<BatchResponse> response = BatchHelper.postBatchRequestsWithoutEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest);
Assert.assertEquals("Verify Status Code 200", 200L, (long) response.get(1).getStatusCode());
Assertions.assertEquals(200L, (long) response.get(1).getStatusCode(), "Verify Status Code 200");
}
/**
@@ -334,7 +334,7 @@ public class BatchApiTest {
final List<BatchResponse> response = BatchHelper.postBatchRequestsWithoutEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest);
Assert.assertEquals("Verify Status Code 200 for Create Loan Charge", 200L, (long) response.get(3).getStatusCode());
Assertions.assertEquals(200L, (long) response.get(3).getStatusCode(), "Verify Status Code 200 for Create Loan Charge");
}
/**
@@ -397,8 +397,8 @@ public class BatchApiTest {
final List<BatchResponse> response = BatchHelper.postBatchRequestsWithoutEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest);
Assert.assertEquals("Verify Status Code 200 for Repayment", 200L, (long) response.get(5).getStatusCode());
Assert.assertEquals("Verify Status Code 200 for Repayment", 200L, (long) response.get(6).getStatusCode());
Assertions.assertEquals(200L, (long) response.get(5).getStatusCode(), "Verify Status Code 200 for Repayment");
Assertions.assertEquals(200L, (long) response.get(6).getStatusCode(), "Verify Status Code 200 for Repayment");
}
/**
@@ -427,8 +427,8 @@ public class BatchApiTest {
final List<BatchResponse> response = BatchHelper.postBatchRequestsWithoutEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest);
Assert.assertEquals("Verify Status Code 200 for Create Client", 200L, (long) response.get(0).getStatusCode());
Assert.assertEquals("Verify Status Code 200 for Activate Client", 200L, (long) response.get(1).getStatusCode());
Assertions.assertEquals(200L, (long) response.get(0).getStatusCode(), "Verify Status Code 200 for Create Client");
Assertions.assertEquals(200L, (long) response.get(1).getStatusCode(), "Verify Status Code 200 for Activate Client");
}
/**
@@ -482,8 +482,8 @@ public class BatchApiTest {
final List<BatchResponse> response = BatchHelper.postBatchRequestsWithoutEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest);
Assert.assertEquals("Verify Status Code 200 for Approve Loan", 200L, (long) response.get(3).getStatusCode());
Assert.assertEquals("Verify Status Code 200 for Disburse Loan", 200L, (long) response.get(4).getStatusCode());
Assertions.assertEquals(200L, (long) response.get(3).getStatusCode(), "Verify Status Code 200 for Approve Loan");
Assertions.assertEquals(200L, (long) response.get(4).getStatusCode(), "Verify Status Code 200 for Disburse Loan");
}
/**
@@ -527,9 +527,9 @@ public class BatchApiTest {
final List<BatchResponse> response = BatchHelper.postBatchRequestsWithEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest);
Assert.assertEquals("Verify Status Code 200 for create client", 200L, (long) response.get(0).getStatusCode());
Assert.assertEquals("Verify Status Code 200 for apply Loan", 200L, (long) response.get(1).getStatusCode());
Assert.assertEquals("Verify Status Code 200 for approve Loan", 200L, (long) response.get(2).getStatusCode());
Assert.assertEquals("Verify Status Code 200 for disburse Loan", 200L, (long) response.get(3).getStatusCode());
Assertions.assertEquals(200L, (long) response.get(0).getStatusCode(), "Verify Status Code 200 for create client");
Assertions.assertEquals(200L, (long) response.get(1).getStatusCode(), "Verify Status Code 200 for apply Loan");
Assertions.assertEquals(200L, (long) response.get(2).getStatusCode(), "Verify Status Code 200 for approve Loan");
Assertions.assertEquals(200L, (long) response.get(3).getStatusCode(), "Verify Status Code 200 for disburse Loan");
}
}
@@ -33,9 +33,9 @@ import org.apache.fineract.integrationtests.common.GroupHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,9 +58,9 @@ public class BatchRequestsIntegrationTest {
/**
* Sets up the essential settings for the TEST like contentType,
* expectedStatusCode. It uses the '@Before' annotation provided by jUnit.
* expectedStatusCode. It uses the '@BeforeEach' annotation provided by jUnit.
*/
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
@@ -135,7 +135,7 @@ public class BatchRequestsIntegrationTest {
// Verify that each loan has been applied successfully
for (BatchResponse res : response) {
Assert.assertEquals("Verify Status Code 200", 200L, (long) res.getStatusCode());
Assertions.assertEquals(200L, (long) res.getStatusCode(), "Verify Status Code 200");
}
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import io.restassured.builder.RequestSpecBuilder;
@@ -35,9 +35,9 @@ import org.apache.fineract.integrationtests.common.CenterHelper;
import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,7 +46,7 @@ public class CenterIntegrationTest {
private RequestSpecification requestSpec;
private ResponseSpecification responseSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -62,20 +62,20 @@ public class CenterIntegrationTest {
int resourceId = CenterHelper.createCenter(name, officeId, requestSpec, responseSpec);
CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec);
Assert.assertNotNull(center);
Assert.assertTrue(center.getName().equals(name));
Assert.assertTrue(center.getOfficeId() == officeId);
Assert.assertTrue(center.isActive() == false);
Assertions.assertNotNull(center);
Assertions.assertTrue(center.getName().equals(name));
Assertions.assertTrue(center.getOfficeId() == officeId);
Assertions.assertTrue(center.isActive() == false);
// Test retrieval by listing all centers
int id = CenterHelper.listCenters(requestSpec, responseSpec).get(0).getId();
Assert.assertTrue(id > 0);
Assertions.assertTrue(id > 0);
CenterDomain retrievedCenter = CenterHelper.retrieveByID(id, requestSpec, responseSpec);
Assert.assertNotNull(retrievedCenter);
Assert.assertNotNull(retrievedCenter.getName());
Assert.assertNotNull(retrievedCenter.getHierarchy());
Assert.assertNotNull(retrievedCenter.getOfficeName());
Assertions.assertNotNull(retrievedCenter);
Assertions.assertNotNull(retrievedCenter.getName());
Assertions.assertNotNull(retrievedCenter.getHierarchy());
Assertions.assertNotNull(retrievedCenter.getOfficeName());
}
@@ -90,13 +90,13 @@ public class CenterIntegrationTest {
int resourceId = CenterHelper.createCenter(name, officeId, externalId, staffId, groupMembers, requestSpec, responseSpec);
CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec);
Assert.assertNotNull(center);
Assert.assertTrue(center.getName().equals(name));
Assert.assertTrue(center.getOfficeId() == officeId);
Assert.assertTrue(center.getExternalId().equals(externalId));
Assert.assertTrue(center.getStaffId() == staffId);
Assert.assertTrue(center.isActive() == false);
Assert.assertArrayEquals(center.getGroupMembers(), groupMembers);
Assertions.assertNotNull(center);
Assertions.assertTrue(center.getName().equals(name));
Assertions.assertTrue(center.getOfficeId() == officeId);
Assertions.assertTrue(center.getExternalId().equals(externalId));
Assertions.assertTrue(center.getStaffId() == staffId);
Assertions.assertTrue(center.isActive() == false);
Assertions.assertArrayEquals(center.getGroupMembers(), groupMembers);
}
@Test
@@ -104,9 +104,9 @@ public class CenterIntegrationTest {
ArrayList<CenterDomain> paginatedList = CenterHelper.paginatedListCenters(requestSpec, responseSpec);
ArrayList<CenterDomain> list = CenterHelper.listCenters(requestSpec, responseSpec);
Assert.assertNotNull(paginatedList);
Assert.assertNotNull(list);
Assert.assertTrue(Arrays.equals(paginatedList.toArray(new CenterDomain[paginatedList.size()]),
Assertions.assertNotNull(paginatedList);
Assertions.assertNotNull(list);
Assertions.assertTrue(Arrays.equals(paginatedList.toArray(new CenterDomain[paginatedList.size()]),
list.toArray(new CenterDomain[list.size()])));
}
@@ -116,7 +116,7 @@ public class CenterIntegrationTest {
int id = arr.get(arr.size() - 1).getId() + 1;
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(404).build();
CenterDomain center = CenterHelper.retrieveByID(id, requestSpec, responseSpec);
Assert.assertNotNull(center);
Assertions.assertNotNull(center);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@@ -137,7 +137,7 @@ public class CenterIntegrationTest {
int[] associateResponse = CenterHelper.associateGroups(resourceId, associateGroupMembers, requestSpec, responseSpec);
Arrays.sort(associateResponse);
Arrays.sort(associateGroupMembers);
Assert.assertArrayEquals(associateResponse, associateGroupMembers);
Assertions.assertArrayEquals(associateResponse, associateGroupMembers);
int[] newGroupMembers = new int[5];
for (int i = 0; i < 5; i++) {
@@ -153,17 +153,17 @@ public class CenterIntegrationTest {
request.put("externalId", newExternalId);
request.put("staffId", newStaffId);
HashMap response = CenterHelper.updateCenter(resourceId, request, requestSpec, responseSpec);
Assert.assertNotNull(response);
Assert.assertEquals(newName, response.get("name"));
Assert.assertEquals(newExternalId, response.get("externalId"));
Assert.assertEquals(Integer.valueOf(newStaffId), Integer.valueOf(response.get("staffId").toString()));
Assertions.assertNotNull(response);
Assertions.assertEquals(newName, response.get("name"));
Assertions.assertEquals(newExternalId, response.get("externalId"));
Assertions.assertEquals(Integer.valueOf(newStaffId), Integer.valueOf(response.get("staffId").toString()));
CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec);
Assert.assertNotNull(center);
Assert.assertEquals(newName, center.getName());
Assert.assertEquals(newExternalId, center.getExternalId());
Assert.assertEquals((Integer)newStaffId, center.getStaffId());
Assert.assertArrayEquals(newGroupMembers, center.getGroupMembers());
Assertions.assertNotNull(center);
Assertions.assertEquals(newName, center.getName());
Assertions.assertEquals(newExternalId, center.getExternalId());
Assertions.assertEquals((Integer)newStaffId, center.getStaffId());
Assertions.assertArrayEquals(newGroupMembers, center.getGroupMembers());
}
@Test
@@ -175,7 +175,7 @@ public class CenterIntegrationTest {
CenterHelper.deleteCenter(resourceId, requestSpec, responseSpec);
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(404).build();
CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec);
Assert.assertNotNull(center);
Assertions.assertNotNull(center);
}
private int[] generateGroupMembers(int size, int officeId) {
@@ -201,21 +201,21 @@ public class CenterIntegrationTest {
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
LOG.info("--------------creating first staff with id------------- {}" , staffId);
Assert.assertNotNull(staffId);
Assertions.assertNotNull(staffId);
final int centerWithStaffId = CenterHelper.createCenterWithStaffId(this.requestSpec, this.responseSpec, staffId);
final CenterDomain center = CenterHelper.retrieveByID(centerWithStaffId, requestSpec, responseSpec);
Assert.assertNotNull(center);
Assert.assertTrue(center.getId() == centerWithStaffId);
Assert.assertTrue(center.getStaffId().intValue() == staffId);
Assert.assertTrue(center.isActive() == true);
Assertions.assertNotNull(center);
Assertions.assertTrue(center.getId() == centerWithStaffId);
Assertions.assertTrue(center.getStaffId().intValue() == staffId);
Assertions.assertTrue(center.isActive() == true);
}
@Test
public void testAssignStaffToCenter() {
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
LOG.info("--------------creating first staff with id------------- {}" , staffId);
Assert.assertNotNull(staffId);
Assertions.assertNotNull(staffId);
final Integer groupID = CenterHelper.createCenter(this.requestSpec, this.responseSpec);
CenterHelper.verifyCenterCreatedOnServer(this.requestSpec, this.responseSpec, groupID);
@@ -223,12 +223,12 @@ public class CenterIntegrationTest {
final HashMap assignStaffToCenterResponseMap = (HashMap) CenterHelper.assignStaff(this.requestSpec,
this.responseSpec, groupID.toString(),
staffId.longValue());
assertEquals("Verify assigned staff id is the same as id sent", assignStaffToCenterResponseMap.get("staffId"), staffId);
assertEquals(assignStaffToCenterResponseMap.get("staffId"), staffId, "Verify assigned staff id is the same as id sent");
final CenterDomain center = CenterHelper.retrieveByID(groupID, requestSpec, responseSpec);
Assert.assertNotNull(center);
Assert.assertTrue(center.getId().intValue() == groupID);
Assert.assertTrue(center.getStaffId().intValue() == staffId);
Assertions.assertNotNull(center);
Assertions.assertTrue(center.getId().intValue() == groupID);
Assertions.assertTrue(center.getStaffId().intValue() == staffId);
}
@@ -236,7 +236,7 @@ public class CenterIntegrationTest {
public void testUnassignStaffToCenter() {
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
LOG.info("--------------creating first staff with id------------- {}" , staffId);
Assert.assertNotNull(staffId);
Assertions.assertNotNull(staffId);
final Integer groupID = CenterHelper.createCenter(this.requestSpec, this.responseSpec);
CenterHelper.verifyCenterCreatedOnServer(this.requestSpec, this.responseSpec, groupID);
@@ -244,20 +244,20 @@ public class CenterIntegrationTest {
final HashMap assignStaffToCenterResponseMap = (HashMap) CenterHelper.assignStaff(this.requestSpec,
this.responseSpec, groupID.toString(),
staffId.longValue());
assertEquals("Verify assigned staff id is the same as id sent", assignStaffToCenterResponseMap.get("staffId"), staffId);
assertEquals(assignStaffToCenterResponseMap.get("staffId"), staffId, "Verify assigned staff id is the same as id sent");
final CenterDomain centerWithStaffAssigned = CenterHelper.retrieveByID(groupID, requestSpec, responseSpec);
Assert.assertNotNull(centerWithStaffAssigned);
Assert.assertTrue(centerWithStaffAssigned.getId().intValue() == groupID);
Assert.assertTrue(centerWithStaffAssigned.getStaffId().intValue() == staffId);
Assertions.assertNotNull(centerWithStaffAssigned);
Assertions.assertTrue(centerWithStaffAssigned.getId().intValue() == groupID);
Assertions.assertTrue(centerWithStaffAssigned.getStaffId().intValue() == staffId);
final HashMap unassignStaffToCenterResponseMap = (HashMap) CenterHelper.unassignStaff(this.requestSpec,
this.responseSpec, groupID.toString(),
staffId.longValue());
assertEquals("Verify staffId is null after unassigning ", unassignStaffToCenterResponseMap.get("staffId"), null);
assertEquals(unassignStaffToCenterResponseMap.get("staffId"), null, "Verify staffId is null after unassigning ");
final CenterDomain centerWithStaffUnssigned = CenterHelper.retrieveByID(groupID, requestSpec, responseSpec);
Assert.assertNotNull(centerWithStaffUnssigned);
Assert.assertTrue(centerWithStaffUnssigned.getId().intValue() == groupID);
Assert.assertTrue(centerWithStaffUnssigned.getStaffId() == null);
Assertions.assertNotNull(centerWithStaffUnssigned);
Assertions.assertTrue(centerWithStaffUnssigned.getId().intValue() == groupID);
Assertions.assertTrue(centerWithStaffUnssigned.getStaffId() == null);
}
@@ -27,9 +27,9 @@ import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@SuppressWarnings({ "rawtypes" })
public class ChargesTest {
@@ -37,7 +37,7 @@ public class ChargesTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -50,19 +50,19 @@ public class ChargesTest {
// Retrieving all Charges
ArrayList<HashMap> allChargesData = ChargesHelper.getCharges(this.requestSpec, this.responseSpec);
Assert.assertNotNull(allChargesData);
Assertions.assertNotNull(allChargesData);
// Testing Creation, Updation and Deletion of Disbursement Charge
final Integer disbursementChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanDisbursementJSON());
Assert.assertNotNull(disbursementChargeId);
Assertions.assertNotNull(disbursementChargeId);
// Updating Charge Amount
HashMap changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeJSON());
HashMap chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
Assertions.assertEquals(chargeDataAfterChanges.get("amount"), changes.get("amount"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
@@ -70,10 +70,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
HashMap chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargePaymentMode"), "Verifying Charge after Modification");
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
@@ -81,7 +81,7 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
@@ -89,22 +89,22 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
Integer chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, disbursementChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", disbursementChargeId, chargeIdAfterDeletion);
Assertions.assertEquals(disbursementChargeId, chargeIdAfterDeletion, "Verifying Charge ID after deletion");
// Testing Creation, Updation and Deletion of Specified due date Charge
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON());
Assert.assertNotNull(specifiedDueDateChargeId);
Assertions.assertNotNull(specifiedDueDateChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
Assertions.assertEquals(chargeDataAfterChanges.get("amount"), changes.get("amount"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
@@ -112,10 +112,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargePaymentMode"), "Verifying Charge after Modification");
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
@@ -123,7 +123,7 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
@@ -131,10 +131,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, specifiedDueDateChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", specifiedDueDateChargeId, chargeIdAfterDeletion);
Assertions.assertEquals(specifiedDueDateChargeId, chargeIdAfterDeletion, "Verifying Charge ID after deletion");
// Testing Creation, Updation and Deletion of Installment Fee Charge
final Integer installmentFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
@@ -145,7 +145,7 @@ public class ChargesTest {
ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
Assertions.assertEquals(chargeDataAfterChanges.get("amount"), changes.get("amount"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
@@ -153,10 +153,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargePaymentMode"), "Verifying Charge after Modification");
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
@@ -164,7 +164,7 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
@@ -172,22 +172,22 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, installmentFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", installmentFeeChargeId, chargeIdAfterDeletion);
Assertions.assertEquals(installmentFeeChargeId, chargeIdAfterDeletion, "Verifying Charge ID after deletion");
// Testing Creation, Updation and Deletion of Overdue Installment Fee
// Charge
final Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanOverdueFeeJSON());
Assert.assertNotNull(overdueFeeChargeId);
Assertions.assertNotNull(overdueFeeChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId, ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
Assertions.assertEquals(chargeDataAfterChanges.get("amount"), changes.get("amount"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON());
@@ -195,10 +195,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargePaymentMode"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargePaymentMode"), "Verifying Charge after Modification");
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
@@ -206,7 +206,7 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON());
@@ -214,7 +214,7 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeFeeFrequencyAsYearsJSON());
@@ -222,10 +222,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("feeFrequency");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("feeFrequency"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("feeFrequency"), "Verifying Charge after Modification");
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, overdueFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", overdueFeeChargeId, chargeIdAfterDeletion);
Assertions.assertEquals(overdueFeeChargeId, chargeIdAfterDeletion, "Verifying Charge ID after deletion");
}
@Test
@@ -234,37 +234,37 @@ public class ChargesTest {
// Testing Creation, Updation and Deletion of Specified due date Charge
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsSpecifiedDueDateJSON());
Assert.assertNotNull(specifiedDueDateChargeId);
Assertions.assertNotNull(specifiedDueDateChargeId);
// Updating Charge Amount
HashMap changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeJSON());
HashMap chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
Assertions.assertEquals(chargeDataAfterChanges.get("amount"), changes.get("amount"), "Verifying Charge after Modification");
Integer chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, specifiedDueDateChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", specifiedDueDateChargeId, chargeIdAfterDeletion);
Assertions.assertEquals(specifiedDueDateChargeId, chargeIdAfterDeletion, "Verifying Charge ID after deletion");
// Testing Creation, Updation and Deletion of Savings Activation Charge
final Integer savingsActivationChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsActivationFeeJSON());
Assert.assertNotNull(savingsActivationChargeId);
Assertions.assertNotNull(savingsActivationChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, savingsActivationChargeId,
ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, savingsActivationChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
Assertions.assertEquals(chargeDataAfterChanges.get("amount"), changes.get("amount"), "Verifying Charge after Modification");
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, savingsActivationChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", savingsActivationChargeId, chargeIdAfterDeletion);
Assertions.assertEquals(savingsActivationChargeId, chargeIdAfterDeletion, "Verifying Charge ID after deletion");
// Testing Creation, Updation and Deletion of Charge for Withdrawal Fee
final Integer withdrawalFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalFeeChargeId);
Assertions.assertNotNull(withdrawalFeeChargeId);
// Updating Charge-Calculation-Type to Withdrawal-Fee
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, withdrawalFeeChargeId,
@@ -273,52 +273,52 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, withdrawalFeeChargeId);
HashMap chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType");
Assert.assertEquals("Verifying Charge after Modification", chargeChangedData.get("id"), changes.get("chargeCalculationType"));
Assertions.assertEquals(chargeChangedData.get("id"), changes.get("chargeCalculationType"), "Verifying Charge after Modification");
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, withdrawalFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", withdrawalFeeChargeId, chargeIdAfterDeletion);
Assertions.assertEquals(withdrawalFeeChargeId, chargeIdAfterDeletion, "Verifying Charge ID after deletion");
// Testing Creation, Updation and Deletion of Charge for Annual Fee
final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(annualFeeChargeId);
Assertions.assertNotNull(annualFeeChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, annualFeeChargeId, ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, annualFeeChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
Assertions.assertEquals(chargeDataAfterChanges.get("amount"), changes.get("amount"), "Verifying Charge after Modification");
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, annualFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", annualFeeChargeId, chargeIdAfterDeletion);
Assertions.assertEquals(annualFeeChargeId, chargeIdAfterDeletion, "Verifying Charge ID after deletion");
// Testing Creation, Updation and Deletion of Charge for Monthly Fee
final Integer monthlyFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsMonthlyFeeJSON());
Assert.assertNotNull(monthlyFeeChargeId);
Assertions.assertNotNull(monthlyFeeChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, monthlyFeeChargeId, ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, monthlyFeeChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
Assertions.assertEquals(chargeDataAfterChanges.get("amount"), changes.get("amount"), "Verifying Charge after Modification");
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, monthlyFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", monthlyFeeChargeId, chargeIdAfterDeletion);
Assertions.assertEquals(monthlyFeeChargeId, chargeIdAfterDeletion, "Verifying Charge ID after deletion");
// Testing Creation, Updation and Deletion of Charge for Overdraft Fee
final Integer overdraftFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsOverdraftFeeJSON());
Assert.assertNotNull(overdraftFeeChargeId);
Assertions.assertNotNull(overdraftFeeChargeId);
// Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdraftFeeChargeId,
ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdraftFeeChargeId);
Assert.assertEquals("Verifying Charge after Modification", chargeDataAfterChanges.get("amount"), changes.get("amount"));
Assertions.assertEquals(chargeDataAfterChanges.get("amount"), changes.get("amount"), "Verifying Charge after Modification");
chargeIdAfterDeletion = ChargesHelper.deleteCharge(this.responseSpec, this.requestSpec, overdraftFeeChargeId);
Assert.assertEquals("Verifying Charge ID after deletion", overdraftFeeChargeId, chargeIdAfterDeletion);
Assertions.assertEquals(overdraftFeeChargeId, chargeIdAfterDeletion, "Verifying Charge ID after deletion");
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.JsonObject;
import io.restassured.builder.RequestSpecBuilder;
@@ -55,9 +55,9 @@ import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.LocalDate;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -88,7 +88,7 @@ public class ClientLoanIntegrationTest {
private SavingsAccountHelper savingsAccountHelper;
private AccountTransferHelper accountTransferHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -136,7 +136,7 @@ public class ClientLoanIntegrationTest {
addCharges(charges, interestPercentage, "1", null);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -222,7 +222,7 @@ public class ClientLoanIntegrationTest {
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
disbursementDetail = loanSchedule.get(0);
Assert.assertEquals(0, loanCharges.size());
Assertions.assertEquals(0, loanCharges.size());
validateNumberForEqual("0.0", String.valueOf(disbursementDetail.get("feeChargesDue")));
}
@@ -247,7 +247,7 @@ public class ClientLoanIntegrationTest {
addCharges(charges, interestPercentage, "1", null);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -311,7 +311,7 @@ public class ClientLoanIntegrationTest {
addCharges(charges, interestPercentage, "1", "29 September 2011");
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -397,7 +397,7 @@ public class ClientLoanIntegrationTest {
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
firstInstallment = loanSchedule.get(1);
Assert.assertEquals(0, loanCharges.size());
Assertions.assertEquals(0, loanCharges.size());
validateNumberForEqual("0", String.valueOf(firstInstallment.get("feeChargesDue")));
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
@@ -477,7 +477,7 @@ public class ClientLoanIntegrationTest {
addCharges(charges, interestPercentage, "1", "29 September 2011");
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -699,7 +699,7 @@ public class ClientLoanIntegrationTest {
loanSchedule.remove(0);
for (HashMap installment : loanSchedule) {
validateNumberForEqualExcludePrecission("150", String.valueOf(installment.get("feeChargesDue")));
if (waivePeriodnum == installment.get("period")) {
if (waivePeriodnum.equals(installment.get("period"))) {
validateNumberForEqualExcludePrecission("100.0",
String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("50.0", String.valueOf(installment.get("feeChargesWaived")));
@@ -722,11 +722,11 @@ public class ClientLoanIntegrationTest {
loanSchedule.remove(0);
for (HashMap installment : loanSchedule) {
validateNumberForEqualExcludePrecission("150", String.valueOf(installment.get("feeChargesDue")));
if (payPeriodnum == installment.get("period")) {
if (payPeriodnum.equals(installment.get("period"))) {
validateNumberForEqualExcludePrecission("50.0",
String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("100.0", String.valueOf(installment.get("feeChargesPaid")));
} else if (waivePeriodnum == installment.get("period")) {
} else if (waivePeriodnum.equals(installment.get("period"))) {
validateNumberForEqualExcludePrecission("100.0",
String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("50.0", String.valueOf(installment.get("feeChargesWaived")));
@@ -756,7 +756,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplication(clientID, loanProductID, null, savingsId.toString(),
"12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -768,7 +768,7 @@ public class ClientLoanIntegrationTest {
HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
// DISBURSE
loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings(SavingsAccountHelper.TRANSACTION_DATE,
@@ -778,7 +778,7 @@ public class ClientLoanIntegrationTest {
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf("12000");
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
@@ -786,7 +786,7 @@ public class ClientLoanIntegrationTest {
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
}
@@ -803,7 +803,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, null, null, "45,000.00",
tranches);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -847,7 +847,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, null, savingsId.toString(),
"45,000.00", tranches);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -859,7 +859,7 @@ public class ClientLoanIntegrationTest {
HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
// DISBURSE first Tranche
loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings("1 March 2014", loanID);
@@ -868,7 +868,7 @@ public class ClientLoanIntegrationTest {
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf("25000");
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
// DISBURSE Second Tranche
loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings("23 April 2014", loanID);
@@ -877,7 +877,7 @@ public class ClientLoanIntegrationTest {
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf("25000") + Float.valueOf("20000");
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
@@ -885,20 +885,20 @@ public class ClientLoanIntegrationTest {
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
}
private void validateCharge(Integer amountPercentage, final List<HashMap> loanCharges, final String amount,
final String outstanding, String amountPaid, String amountWaived) {
HashMap chargeDetail = getloanCharge(amountPercentage, loanCharges);
Assert.assertTrue(Float.valueOf(amount)
Assertions.assertTrue(Float.valueOf(amount)
.compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountOrPercentage")))) == 0);
Assert.assertTrue(Float.valueOf(outstanding)
Assertions.assertTrue(Float.valueOf(outstanding)
.compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountOutstanding")))) == 0);
Assert.assertTrue(Float.valueOf(amountPaid)
Assertions.assertTrue(Float.valueOf(amountPaid)
.compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountPaid")))) == 0);
Assert.assertTrue(Float.valueOf(amountWaived)
Assertions.assertTrue(Float.valueOf(amountWaived)
.compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountWaived")))) == 0);
}
@@ -906,28 +906,28 @@ public class ClientLoanIntegrationTest {
final String amount, final String outstanding, String amountPaid, String amountWaived) {
DecimalFormat twoDForm = new DecimalFormat("#");
HashMap chargeDetail = getloanCharge(amountPercentage, loanCharges);
Assert.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amount))).compareTo(Float
Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amount))).compareTo(Float
.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountOrPercentage")))))) == 0);
Assert.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(outstanding))).compareTo(Float
Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(outstanding))).compareTo(Float
.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountOutstanding")))))) == 0);
Assert.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amountPaid))).compareTo(
Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amountPaid))).compareTo(
Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountPaid")))))) == 0);
Assert.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amountWaived))).compareTo(
Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amountWaived))).compareTo(
Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountWaived")))))) == 0);
}
public void validateNumberForEqual(String val, String val2) {
Assert.assertTrue(Float.valueOf(val).compareTo(Float.valueOf(val2)) == 0);
Assertions.assertTrue(Float.valueOf(val).compareTo(Float.valueOf(val2)) == 0);
}
public void validateNumberForEqualWithMsg(String msg, String val, String val2) {
Assert.assertTrue(msg + "expected " + val + " but was " + val2,
Float.valueOf(val).compareTo(Float.valueOf(val2)) == 0);
Assertions.assertTrue(Float.valueOf(val).compareTo(Float.valueOf(val2)) == 0,
msg + "expected " + val + " but was " + val2);
}
public void validateNumberForEqualExcludePrecission(String val, String val2) {
DecimalFormat twoDForm = new DecimalFormat("#");
Assert.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(val)))
Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(val)))
.compareTo(Float.valueOf(twoDForm.format(Float.valueOf(val2)))) == 0);
}
@@ -1122,101 +1122,140 @@ public class ClientLoanIntegrationTest {
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"));
assertEquals("Checking for Principal Due for 1st Month", Float.valueOf("2911.49"),
loanSchedule.get(1).get("principalOriginalDue"));
assertEquals("Checking for Interest Due for 1st Month", Float.valueOf("240.00"),
loanSchedule.get(1).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2011, 10, 20)),
loanSchedule.get(1).get("dueDate"),
"Checking for Due Date for 1st Month");
assertEquals(Float.valueOf("2911.49"),
loanSchedule.get(1).get("principalOriginalDue"),
"Checking for Principal Due for 1st Month");
assertEquals(Float.valueOf("240.00"),
loanSchedule.get(1).get("interestOriginalDue"),
"Checking for Interest Due for 1st Month");
assertEquals("Checking for Due Date for 2nd Month", new ArrayList<>(Arrays.asList(2011, 11, 20)),
loanSchedule.get(2).get("dueDate"));
assertEquals("Checking for Principal Due for 2nd Month", Float.valueOf("2969.72"),
loanSchedule.get(2).get("principalDue"));
assertEquals("Checking for Interest Due for 2nd Month", Float.valueOf("181.77"),
loanSchedule.get(2).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2011, 11, 20)),
loanSchedule.get(2).get("dueDate"),
"Checking for Due Date for 2nd Month");
assertEquals(Float.valueOf("2969.72"),
loanSchedule.get(2).get("principalDue"),
"Checking for Principal Due for 2nd Month");
assertEquals(Float.valueOf("181.77"),
loanSchedule.get(2).get("interestOriginalDue"),
"Checking for Interest Due for 2nd Month");
assertEquals("Checking for Due Date for 3rd Month", new ArrayList<>(Arrays.asList(2011, 12, 20)),
loanSchedule.get(3).get("dueDate"));
assertEquals("Checking for Principal Due for 3rd Month", Float.valueOf("3029.11"),
loanSchedule.get(3).get("principalDue"));
assertEquals("Checking for Interest Due for 3rd Month", Float.valueOf("122.38"),
loanSchedule.get(3).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2011, 12, 20)),
loanSchedule.get(3).get("dueDate"),
"Checking for Due Date for 3rd Month");
assertEquals(Float.valueOf("3029.11"),
loanSchedule.get(3).get("principalDue"),
"Checking for Principal Due for 3rd Month");
assertEquals(Float.valueOf("122.38"),
loanSchedule.get(3).get("interestOriginalDue"),
"Checking for Interest Due for 3rd Month");
assertEquals("Checking for Due Date for 4th Month", new ArrayList<>(Arrays.asList(2012, 1, 20)),
loanSchedule.get(4).get("dueDate"));
assertEquals("Checking for Principal Due for 4th Month", Float.valueOf("3089.68"),
loanSchedule.get(4).get("principalDue"));
assertEquals("Checking for Interest Due for 4th Month", Float.valueOf("61.79"),
loanSchedule.get(4).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2012, 1, 20)),
loanSchedule.get(4).get("dueDate"),
"Checking for Due Date for 4th Month");
assertEquals(Float.valueOf("3089.68"),
loanSchedule.get(4).get("principalDue"),
"Checking for Principal Due for 4th Month");
assertEquals(Float.valueOf("61.79"),
loanSchedule.get(4).get("interestOriginalDue"),
"Checking for Interest Due for 4th Month");
}
private void verifyLoanRepaymentScheduleForEqualPrincipal(final ArrayList<HashMap> loanSchedule) {
LOG.info(
"--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2014, 7, 2)),
loanSchedule.get(1).get("dueDate"));
assertEquals("Checking for Principal Due for 1st Month", Float.valueOf("416700"),
loanSchedule.get(1).get("principalOriginalDue"));
assertEquals("Checking for Interest Due for 1st Month", Float.valueOf("200000"),
loanSchedule.get(1).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 7, 2)),
loanSchedule.get(1).get("dueDate"),
"Checking for Due Date for 1st Month");
assertEquals(Float.valueOf("416700"),
loanSchedule.get(1).get("principalOriginalDue"),
"Checking for Principal Due for 1st Month");
assertEquals(Float.valueOf("200000"),
loanSchedule.get(1).get("interestOriginalDue"),
"Checking for Interest Due for 1st Month");
assertEquals("Checking for Due Date for 2nd Month", new ArrayList<>(Arrays.asList(2014, 8, 2)),
loanSchedule.get(2).get("dueDate"));
assertEquals("Checking for Principal Due for 2nd Month", Float.valueOf("416700"),
loanSchedule.get(2).get("principalDue"));
assertEquals("Checking for Interest Due for 2nd Month", Float.valueOf("191700"),
loanSchedule.get(2).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 8, 2)),
loanSchedule.get(2).get("dueDate"),
"Checking for Due Date for 2nd Month");
assertEquals(Float.valueOf("416700"),
loanSchedule.get(2).get("principalDue"),
"Checking for Principal Due for 2nd Month");
assertEquals(Float.valueOf("191700"),
loanSchedule.get(2).get("interestOriginalDue"),
"Checking for Interest Due for 2nd Month");
assertEquals("Checking for Due Date for 3rd Month", new ArrayList<>(Arrays.asList(2014, 9, 2)),
loanSchedule.get(3).get("dueDate"));
assertEquals("Checking for Principal Due for 3rd Month", Float.valueOf("416700"),
loanSchedule.get(3).get("principalDue"));
assertEquals("Checking for Interest Due for 3rd Month", Float.valueOf("183300"),
loanSchedule.get(3).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 9, 2)),
loanSchedule.get(3).get("dueDate"),
"Checking for Due Date for 3rd Month");
assertEquals(Float.valueOf("416700"),
loanSchedule.get(3).get("principalDue"),
"Checking for Principal Due for 3rd Month");
assertEquals(Float.valueOf("183300"),
loanSchedule.get(3).get("interestOriginalDue"),
"Checking for Interest Due for 3rd Month");
assertEquals("Checking for Due Date for 4th Month", new ArrayList<>(Arrays.asList(2014, 10, 2)),
loanSchedule.get(4).get("dueDate"));
assertEquals("Checking for Principal Due for 4th Month", Float.valueOf("416700"),
loanSchedule.get(4).get("principalDue"));
assertEquals("Checking for Interest Due for 4th Month", Float.valueOf("175000"),
loanSchedule.get(4).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 10, 2)),
loanSchedule.get(4).get("dueDate"),
"Checking for Due Date for 4th Month");
assertEquals(Float.valueOf("416700"),
loanSchedule.get(4).get("principalDue"),
"Checking for Principal Due for 4th Month");
assertEquals(Float.valueOf("175000"),
loanSchedule.get(4).get("interestOriginalDue"),
"Checking for Interest Due for 4th Month");
assertEquals("Checking for Due Date for 5th Month", new ArrayList<>(Arrays.asList(2014, 11, 2)),
loanSchedule.get(5).get("dueDate"));
assertEquals("Checking for Principal Due for 5th Month", Float.valueOf("416700"),
loanSchedule.get(5).get("principalDue"));
assertEquals("Checking for Interest Due for 5th Month", Float.valueOf("166700"),
loanSchedule.get(5).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 11, 2)),
loanSchedule.get(5).get("dueDate"),
"Checking for Due Date for 5th Month");
assertEquals(Float.valueOf("416700"),
loanSchedule.get(5).get("principalDue"),
"Checking for Principal Due for 5th Month");
assertEquals(Float.valueOf("166700"),
loanSchedule.get(5).get("interestOriginalDue"),
"Checking for Interest Due for 5th Month");
assertEquals("Checking for Due Date for 6th Month", new ArrayList<>(Arrays.asList(2014, 12, 2)),
loanSchedule.get(6).get("dueDate"));
assertEquals("Checking for Principal Due for 6th Month", Float.valueOf("416700"),
loanSchedule.get(6).get("principalDue"));
assertEquals("Checking for Interest Due for 6th Month", Float.valueOf("158300"),
loanSchedule.get(6).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 12, 2)),
loanSchedule.get(6).get("dueDate"),
"Checking for Due Date for 6th Month");
assertEquals(Float.valueOf("416700"),
loanSchedule.get(6).get("principalDue"),
"Checking for Principal Due for 6th Month");
assertEquals(Float.valueOf("158300"),
loanSchedule.get(6).get("interestOriginalDue"),
"Checking for Interest Due for 6th Month");
assertEquals("Checking for Due Date for 10th Month", new ArrayList<>(Arrays.asList(2015, 4, 2)),
loanSchedule.get(10).get("dueDate"));
assertEquals("Checking for Principal Due for 10th Month", Float.valueOf("416700"),
loanSchedule.get(10).get("principalDue"));
assertEquals("Checking for Interest Due for 10th Month", Float.valueOf("125000"),
loanSchedule.get(10).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2015, 4, 2)),
loanSchedule.get(10).get("dueDate"),
"Checking for Due Date for 10th Month");
assertEquals(Float.valueOf("416700"),
loanSchedule.get(10).get("principalDue"),
"Checking for Principal Due for 10th Month");
assertEquals(Float.valueOf("125000"),
loanSchedule.get(10).get("interestOriginalDue"),
"Checking for Interest Due for 10th Month");
assertEquals("Checking for Due Date for 20th Month", new ArrayList<>(Arrays.asList(2016, 2, 2)),
loanSchedule.get(20).get("dueDate"));
assertEquals("Checking for Principal Due for 20th Month", Float.valueOf("416700"),
loanSchedule.get(20).get("principalDue"));
assertEquals("Checking for Interest Due for 20th Month", Float.valueOf("41700"),
loanSchedule.get(20).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2016, 2, 2)),
loanSchedule.get(20).get("dueDate"),
"Checking for Due Date for 20th Month");
assertEquals(Float.valueOf("416700"),
loanSchedule.get(20).get("principalDue"),
"Checking for Principal Due for 20th Month");
assertEquals(Float.valueOf("41700"),
loanSchedule.get(20).get("interestOriginalDue"),
"Checking for Interest Due for 20th Month");
assertEquals("Checking for Due Date for 24th Month", new ArrayList<>(Arrays.asList(2016, 6, 2)),
loanSchedule.get(24).get("dueDate"));
assertEquals("Checking for Principal Due for 24th Month", Float.valueOf("415900"),
loanSchedule.get(24).get("principalDue"));
assertEquals("Checking for Interest Due for 24th Month", Float.valueOf("8300"),
loanSchedule.get(24).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2016, 6, 2)),
loanSchedule.get(24).get("dueDate"),
"Checking for Due Date for 24th Month");
assertEquals(Float.valueOf("415900"),
loanSchedule.get(24).get("principalDue"),
"Checking for Principal Due for 24th Month");
assertEquals(Float.valueOf("8300"),
loanSchedule.get(24).get("interestOriginalDue"),
"Checking for Interest Due for 24th Month");
}
@@ -1224,75 +1263,99 @@ public class ClientLoanIntegrationTest {
LOG.info(
"--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2014, 7, 2)),
loanSchedule.get(1).get("dueDate"));
validateNumberForEqualWithMsg("Checking for Principal Due for 1st Month", "0.0",
String.valueOf(loanSchedule.get(1).get("principalOriginalDue")));
assertEquals("Checking for Interest Due for 1st Month", Float.valueOf("200000"),
loanSchedule.get(1).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 7, 2)),
loanSchedule.get(1).get("dueDate"),
"Checking for Due Date for 1st Month");
validateNumberForEqualWithMsg(String.valueOf(loanSchedule.get(1).get("principalOriginalDue")),
"Checking for Principal Due for 1st Month", "0.0");
assertEquals(Float.valueOf("200000"),
loanSchedule.get(1).get("interestOriginalDue"),
"Checking for Interest Due for 1st Month");
assertEquals("Checking for Due Date for 2nd Month", new ArrayList<>(Arrays.asList(2014, 8, 2)),
loanSchedule.get(2).get("dueDate"));
validateNumberForEqualWithMsg("Checking for Principal Due for 2nd Month", "0.0",
String.valueOf(loanSchedule.get(2).get("principalOriginalDue")));
assertEquals("Checking for Interest Due for 2nd Month", Float.valueOf("200000"),
loanSchedule.get(2).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 8, 2)),
loanSchedule.get(2).get("dueDate"),
"Checking for Due Date for 2nd Month");
validateNumberForEqualWithMsg("0.0", String.valueOf(loanSchedule.get(2).get("principalOriginalDue")),
"Checking for Principal Due for 2nd Month");
assertEquals(Float.valueOf("200000"),
loanSchedule.get(2).get("interestOriginalDue"),
"Checking for Interest Due for 2nd Month");
assertEquals("Checking for Due Date for 3rd Month", new ArrayList<>(Arrays.asList(2014, 9, 2)),
loanSchedule.get(3).get("dueDate"));
validateNumberForEqualWithMsg("Checking for Principal Due for 3rd Month", "0.0",
String.valueOf(loanSchedule.get(3).get("principalDue")));
assertEquals("Checking for Interest Due for 3rd Month", Float.valueOf("200000"),
loanSchedule.get(3).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 9, 2)),
loanSchedule.get(3).get("dueDate"),
"Checking for Due Date for 3rd Month");
validateNumberForEqualWithMsg("0.0", String.valueOf(loanSchedule.get(3).get("principalDue")),
"Checking for Principal Due for 3rd Month");
assertEquals(Float.valueOf("200000"), loanSchedule.get(3).get("interestOriginalDue"),
"Checking for Interest Due for 3rd Month");
assertEquals("Checking for Due Date for 4th Month", new ArrayList<>(Arrays.asList(2014, 10, 2)),
loanSchedule.get(4).get("dueDate"));
validateNumberForEqualWithMsg("Checking for Principal Due for 4th Month", "0",
String.valueOf(loanSchedule.get(4).get("principalDue")));
assertEquals("Checking for Interest Due for 4th Month", Float.valueOf("200000"),
loanSchedule.get(4).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 10, 2)),
loanSchedule.get(4).get("dueDate"),
"Checking for Due Date for 4th Month");
validateNumberForEqualWithMsg("0", String.valueOf(loanSchedule.get(4).get("principalDue")),
"Checking for Principal Due for 4th Month");
assertEquals(Float.valueOf("200000"),
loanSchedule.get(4).get("interestOriginalDue"),
"Checking for Interest Due for 4th Month");
assertEquals("Checking for Due Date for 5th Month", new ArrayList<>(Arrays.asList(2014, 11, 2)),
loanSchedule.get(5).get("dueDate"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 11, 2)),
loanSchedule.get(5).get("dueDate"),
"Checking for Due Date for 5th Month");
validateNumberForEqualWithMsg("Checking for Principal Due for 5th Month", "0",
String.valueOf(loanSchedule.get(5).get("principalDue")));
assertEquals("Checking for Interest Due for 5th Month", Float.valueOf("200000"),
loanSchedule.get(5).get("interestOriginalDue"));
assertEquals(Float.valueOf("200000"),
loanSchedule.get(5).get("interestOriginalDue"),
"Checking for Interest Due for 5th Month");
assertEquals("Checking for Due Date for 6th Month", new ArrayList<>(Arrays.asList(2014, 12, 2)),
loanSchedule.get(6).get("dueDate"));
assertEquals("Checking for Principal Due for 6th Month", Float.valueOf("526300"),
loanSchedule.get(6).get("principalDue"));
assertEquals("Checking for Interest Due for 6th Month", Float.valueOf("200000"),
loanSchedule.get(6).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2014, 12, 2)),
loanSchedule.get(6).get("dueDate"),
"Checking for Due Date for 6th Month");
assertEquals(Float.valueOf("526300"),
loanSchedule.get(6).get("principalDue"),
"Checking for Principal Due for 6th Month");
assertEquals(Float.valueOf("200000"),
loanSchedule.get(6).get("interestOriginalDue"),
"Checking for Interest Due for 6th Month");
assertEquals("Checking for Due Date for 7th Month", new ArrayList<>(Arrays.asList(2015, 1, 2)),
loanSchedule.get(7).get("dueDate"));
assertEquals("Checking for Principal Due for 7th Month", Float.valueOf("526300"),
loanSchedule.get(7).get("principalDue"));
assertEquals("Checking for Interest Due for 7th Month", Float.valueOf("189500"),
loanSchedule.get(7).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2015, 1, 2)),
loanSchedule.get(7).get("dueDate"),
"Checking for Due Date for 7th Month");
assertEquals(Float.valueOf("526300"),
loanSchedule.get(7).get("principalDue"),
"Checking for Principal Due for 7th Month");
assertEquals(Float.valueOf("189500"),
loanSchedule.get(7).get("interestOriginalDue"),
"Checking for Interest Due for 7th Month");
assertEquals("Checking for Due Date for 10th Month", new ArrayList<>(Arrays.asList(2015, 4, 2)),
loanSchedule.get(10).get("dueDate"));
assertEquals("Checking for Principal Due for 10th Month", Float.valueOf("526300"),
loanSchedule.get(10).get("principalDue"));
assertEquals("Checking for Interest Due for 10th Month", Float.valueOf("157900"),
loanSchedule.get(10).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2015, 4, 2)),
loanSchedule.get(10).get("dueDate"),
"Checking for Due Date for 10th Month");
assertEquals(Float.valueOf("526300"),
loanSchedule.get(10).get("principalDue"),
"Checking for Principal Due for 10th Month");
assertEquals(Float.valueOf("157900"),
loanSchedule.get(10).get("interestOriginalDue"),
"Checking for Interest Due for 10th Month");
assertEquals("Checking for Due Date for 20th Month", new ArrayList<>(Arrays.asList(2016, 2, 2)),
loanSchedule.get(20).get("dueDate"));
assertEquals("Checking for Principal Due for 20th Month", Float.valueOf("526300"),
loanSchedule.get(20).get("principalDue"));
assertEquals("Checking for Interest Due for 20th Month", Float.valueOf("52600"),
loanSchedule.get(20).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2016, 2, 2)),
loanSchedule.get(20).get("dueDate"),
"Checking for Due Date for 20th Month");
assertEquals(Float.valueOf("526300"),
loanSchedule.get(20).get("principalDue"),
"Checking for Principal Due for 20th Month");
assertEquals(Float.valueOf("52600"),
loanSchedule.get(20).get("interestOriginalDue"),
"Checking for Interest Due for 20th Month");
assertEquals("Checking for Due Date for 24th Month", new ArrayList<>(Arrays.asList(2016, 6, 2)),
loanSchedule.get(24).get("dueDate"));
assertEquals("Checking for Principal Due for 24th Month", Float.valueOf("526600"),
loanSchedule.get(24).get("principalDue"));
assertEquals("Checking for Interest Due for 24th Month", Float.valueOf("10500"),
loanSchedule.get(24).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2016, 6, 2)),
loanSchedule.get(24).get("dueDate"),
"Checking for Due Date for 24th Month");
assertEquals(Float.valueOf("526600"),
loanSchedule.get(24).get("principalDue"),
"Checking for Principal Due for 24th Month");
assertEquals(Float.valueOf("10500"),
loanSchedule.get(24).get("interestOriginalDue"),
"Checking for Interest Due for 24th Month");
}
@@ -1384,7 +1447,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount,
overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -1572,7 +1635,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount,
overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -1763,7 +1826,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount,
overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -1950,7 +2013,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -2156,7 +2219,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -2356,7 +2419,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -2561,7 +2624,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -2763,7 +2826,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -2970,7 +3033,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3183,7 +3246,7 @@ public class ClientLoanIntegrationTest {
* Create loan product with RBI strategy
*/
final Integer loanProductID = createLoanProduct("100", "0", LoanProductTestBuilder.RBI_INDIA_STRATEGY);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
/***
* Apply for loan application and verify loan status
@@ -3192,7 +3255,7 @@ public class ClientLoanIntegrationTest {
final String principal = "12,000.00";
final Integer loanID = applyForLoanApplicationWithPaymentStrategy(clientID, loanProductID, null, savingsId,
principal, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3342,7 +3405,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0));
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3451,7 +3514,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0));
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3535,7 +3598,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3632,7 +3695,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0));
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3768,7 +3831,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3902,7 +3965,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, REST_START_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3978,7 +4041,7 @@ public class ClientLoanIntegrationTest {
Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanOverdueFeeJSONWithCalculattionTypePercentage("10"));
Assert.assertNotNull(overdueFeeChargeId);
Assertions.assertNotNull(overdueFeeChargeId);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
@@ -3997,7 +4060,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, REST_START_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, null);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4107,7 +4170,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0));
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4218,7 +4281,7 @@ public class ClientLoanIntegrationTest {
LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY,
new ArrayList<HashMap>(0));
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4305,7 +4368,7 @@ public class ClientLoanIntegrationTest {
LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY,
new ArrayList<HashMap>(0));
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4356,7 +4419,7 @@ public class ClientLoanIntegrationTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -7);
loanSummary = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
dates = (List) loanSummary.get("overdueSinceDate");
Assert.assertNull(dates);
Assertions.assertNull(dates);
}
@@ -4395,7 +4458,7 @@ public class ClientLoanIntegrationTest {
LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0), "1",
null);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4597,8 +4660,8 @@ public class ClientLoanIntegrationTest {
LOG.info(
"--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
for (Map<String, Object> values : expectedvalues) {
assertEquals("Checking for Due Date for installment " + index, values.get("dueDate"),
loanSchedule.get(index).get("dueDate"));
assertEquals(values.get("dueDate"), loanSchedule.get(index).get("dueDate"),
"Checking for Due Date for installment " + index);
validateNumberForEqualWithMsg("Checking for Principal Due for installment " + index,
String.valueOf(values.get("principalDue")),
String.valueOf(loanSchedule.get(index).get("principalDue")));
@@ -4643,7 +4706,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED,
assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
/***
* Apply for loan application and verify loan status
@@ -4660,7 +4723,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges,
savingsId, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4809,7 +4872,7 @@ public class ClientLoanIntegrationTest {
ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);// ,
// LoanProductTestBuilder.EQUAL_INSTALLMENTS,
// LoanProductTestBuilder.FLAT_BALANCE);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
/***
* Apply for loan application and verify loan status
@@ -4826,7 +4889,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges,
savingsId, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4959,15 +5022,15 @@ public class ClientLoanIntegrationTest {
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID, savingsProductID, savingsId,
ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertTrue(modifications.containsKey("submittedOnDate"));
Assertions.assertTrue(modifications.containsKey("submittedOnDate"));
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec,
savingsId);
@@ -4990,7 +5053,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED,
assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
/***
* Apply for loan application and verify loan status
@@ -5007,7 +5070,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges,
null, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -5105,8 +5168,8 @@ public class ClientLoanIntegrationTest {
toSavingsBalance += TRANSFER_AMOUNT;
// Verifying toSavings Account Balance after Account Transfer
assertEquals("Verifying From Savings Account Balance after Account Transfer", toSavingsBalance,
toSavingsSummaryAfter.get("accountBalance"));
assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
"Verifying From Savings Account Balance after Account Transfer");
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now,
new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.CREDIT),
@@ -5136,8 +5199,8 @@ public class ClientLoanIntegrationTest {
toSavingsBalance += TRANSFER_AMOUNT;
// Verifying toSavings Account Balance after Account Transfer
assertEquals("Verifying From Savings Account Balance after Account Transfer", toSavingsBalance,
toSavingsSummaryAfter.get("accountBalance"));
assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
"Verifying From Savings Account Balance after Account Transfer");
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now,
new JournalEntry(Float.valueOf("2000"), JournalEntry.TransactionType.CREDIT),
@@ -5233,7 +5296,7 @@ public class ClientLoanIntegrationTest {
addCharges(charges, flatAmountChargeTwo, "100", "15 December 2011");
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "10,000.00");
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.HashMap;
import org.slf4j.Logger;
@@ -26,9 +26,9 @@ import io.restassured.specification.ResponseSpecification;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class ClientTest {
@@ -36,7 +36,7 @@ public class ClientTest {
private RequestSpecification requestSpec;
private ClientHelper clientHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -49,7 +49,7 @@ public class ClientTest {
public void testClientStatus() {
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientIsActive(status);
@@ -82,7 +82,7 @@ public class ClientTest {
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientAsPerson(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientIsActive(status);
@@ -115,7 +115,7 @@ public class ClientTest {
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientAsEntity(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientIsActive(status);
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -34,9 +34,9 @@ import java.util.Locale;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@SuppressWarnings({ "unused" })
public class ClientUndoRejectAndWithdrawalIntegrationTest {
@@ -49,7 +49,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
private RequestSpecification requestSpec;
private ClientHelper clientHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -66,7 +66,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -90,7 +90,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -119,7 +119,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -149,7 +149,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -179,7 +179,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -204,7 +204,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -233,7 +233,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -262,7 +262,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -295,7 +295,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
@@ -320,7 +320,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId));
@@ -35,8 +35,8 @@ 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.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -50,7 +50,7 @@ public class ConcurrencyIntegrationTest {
final int MYTHREADS = 30;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -28,9 +28,9 @@ import java.util.Collections;
import org.apache.fineract.integrationtests.common.CurrenciesHelper;
import org.apache.fineract.integrationtests.common.CurrencyDomain;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@SuppressWarnings({ "unused", "rawtypes" })
public class CurrenciesTest {
@@ -38,7 +38,7 @@ public class CurrenciesTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -52,13 +52,13 @@ public class CurrenciesTest {
CurrencyDomain currency = CurrenciesHelper.getCurrencybyCode(requestSpec, responseSpec, "USD");
CurrencyDomain usd = CurrencyDomain.create("USD", "US Dollar", 2, "$", "currency.USD", "US Dollar ($)").build();
Assert.assertTrue(currency.getDecimalPlaces() >= 0);
Assert.assertNotNull(currency.getName());
Assert.assertNotNull(currency.getDisplaySymbol());
Assert.assertNotNull(currency.getDisplayLabel());
Assert.assertNotNull(currency.getNameCode());
Assertions.assertTrue(currency.getDecimalPlaces() >= 0);
Assertions.assertNotNull(currency.getName());
Assertions.assertNotNull(currency.getDisplaySymbol());
Assertions.assertNotNull(currency.getDisplayLabel());
Assertions.assertNotNull(currency.getNameCode());
Assert.assertEquals(usd, currency);
Assertions.assertEquals(usd, currency);
}
@Test
@@ -76,9 +76,9 @@ public class CurrenciesTest {
ArrayList<String> currenciesOutput = CurrenciesHelper.updateSelectedCurrencies(this.requestSpec, this.responseSpec,
currenciestoUpdate);
Assert.assertNotNull(currenciesOutput);
Assertions.assertNotNull(currenciesOutput);
Assert.assertEquals("Verifying Do Outputed Currencies Match after Updation", currenciestoUpdate, currenciesOutput);
Assertions.assertEquals(currenciestoUpdate, currenciesOutput, "Verifying Do Outputed Currencies Match after Updation");
// Test that output matches updation
ArrayList<CurrencyDomain> currenciesBeforeUpdate = new ArrayList<CurrencyDomain>();
@@ -88,8 +88,8 @@ public class CurrenciesTest {
Collections.sort(currenciesBeforeUpdate);
ArrayList<CurrencyDomain> currenciesAfterUpdate = CurrenciesHelper.getSelectedCurrencies(requestSpec, responseSpec);
Assert.assertNotNull(currenciesAfterUpdate);
Assertions.assertNotNull(currenciesAfterUpdate);
Assert.assertEquals("Verifying Do Selected Currencies Match after Updation", currenciesBeforeUpdate, currenciesAfterUpdate);
Assertions.assertEquals(currenciesBeforeUpdate, currenciesAfterUpdate, "Verifying Do Selected Currencies Match after Updation");
}
}
@@ -25,7 +25,7 @@ import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
public class CurrencyIntegrationTest {
@@ -34,7 +34,7 @@ public class CurrencyIntegrationTest {
private SavingsAccountHelper savingsAccountHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,8 +18,8 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -40,17 +40,17 @@ import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Tests loan schedule change based on group meeting changes and loan
* rescheduling
**/
@SuppressWarnings({ "rawtypes" })
@Ignore
@Disabled
public class DisbursalAndRepaymentScheduleTest {
private ResponseSpecification responseSpec;
@@ -71,7 +71,7 @@ public class DisbursalAndRepaymentScheduleTest {
private final SimpleDateFormat dateFormatterStandard = new SimpleDateFormat("dd MMMM yyyy");
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
}
@@ -148,7 +148,7 @@ public class DisbursalAndRepaymentScheduleTest {
this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
// Test for loan account is created
Assert.assertNotNull(this.loanId);
Assertions.assertNotNull(this.loanId);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
this.loanId);
@@ -185,8 +185,8 @@ public class DisbursalAndRepaymentScheduleTest {
dueDateCalendar.setFirstDayOfWeek(Calendar.MONDAY);
dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
(Integer) dueDateLoanSchedule.get(2));
assertEquals("AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY", 3,
dueDateCalendar.get(Calendar.DAY_OF_WEEK));
assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
"AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY");
// system.out.println("---------------------------------CREATING LOAN RESCHEDULE
// REQUEST------------------------------------------");
@@ -205,8 +205,8 @@ public class DisbursalAndRepaymentScheduleTest {
dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
(Integer) dueDateLoanSchedule.get(2));
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));
assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
"AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY, EVEN AFTER LOAN RESCHEDULE REQUEST WAS SENT");
// system.out.println("Successfully created loan reschedule request (ID: " +
// this.loanRescheduleRequestId + ")");
@@ -229,8 +229,8 @@ public class DisbursalAndRepaymentScheduleTest {
dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
(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));
assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
"AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY, EVEN AFTER RESCHEDULE");
// system.out.println("Successfully changed group meeting date (CAELNDAR ID: " +
// this.groupCalendarId
// + ") and rescheduled loan (RESCHEDULE ID: " + this.loanRescheduleRequestId +
@@ -308,7 +308,7 @@ public class DisbursalAndRepaymentScheduleTest {
this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
// Test for loan account is created
Assert.assertNotNull(this.loanId);
Assertions.assertNotNull(this.loanId);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
this.loanId);
@@ -346,8 +346,8 @@ public class DisbursalAndRepaymentScheduleTest {
expectedMaturityCalendar.set((Integer) expectedMaturityDate.get(0),
(Integer) expectedMaturityDate.get(1) - 1, (Integer) expectedMaturityDate.get(2));
assertEquals("AFTER MEETING CHANGE DATE THE EXPECTED MATURITY SHOULD BE ON TUESDAY", 3,
expectedMaturityCalendar.get(Calendar.DAY_OF_WEEK));
assertEquals(3, expectedMaturityCalendar.get(Calendar.DAY_OF_WEEK),
"AFTER MEETING CHANGE DATE THE EXPECTED MATURITY SHOULD BE ON TUESDAY");
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec,
this.responseSpecForStatusCode403);
@@ -27,9 +27,9 @@ import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ExternalServicesConfigurationHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,7 +41,7 @@ public class ExternalServicesConfigurationTest {
private ExternalServicesConfigurationHelper externalServicesConfigurationHelper;
private ResponseSpecification httpStatusForidden;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -59,7 +59,7 @@ public class ExternalServicesConfigurationTest {
String configName = "s3_access_key";
ArrayList<HashMap> externalServicesConfig = this.externalServicesConfigurationHelper
.getExternalServicesConfigurationByServiceName(requestSpec, responseSpec, "S3");
Assert.assertNotNull(externalServicesConfig);
Assertions.assertNotNull(externalServicesConfig);
for (Integer configIndex = 0; configIndex < externalServicesConfig.size(); configIndex++) {
String name = (String) externalServicesConfig.get(configIndex).get("name");
String value = null;
@@ -72,12 +72,12 @@ public class ExternalServicesConfigurationTest {
LOG.info( "{} : {}",name, value);
HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
responseSpec, "S3", name, newValue);
Assert.assertNotNull(arrayListValue.get("value"));
Assert.assertEquals(arrayListValue.get("value"), newValue);
Assertions.assertNotNull(arrayListValue.get("value"));
Assertions.assertEquals(arrayListValue.get("value"), newValue);
HashMap arrayListValue1 = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
responseSpec, "S3", name, value);
Assert.assertNotNull(arrayListValue1.get("value"));
Assert.assertEquals(arrayListValue1.get("value"), value);
Assertions.assertNotNull(arrayListValue1.get("value"));
Assertions.assertEquals(arrayListValue1.get("value"), value);
}
}
@@ -87,7 +87,7 @@ public class ExternalServicesConfigurationTest {
configName = "username";
externalServicesConfig = this.externalServicesConfigurationHelper.getExternalServicesConfigurationByServiceName(requestSpec,
responseSpec, "SMTP");
Assert.assertNotNull(externalServicesConfig);
Assertions.assertNotNull(externalServicesConfig);
for (Integer configIndex = 0; configIndex < externalServicesConfig.size(); configIndex++) {
String name = (String) externalServicesConfig.get(configIndex).get("name");
String value = null;
@@ -100,12 +100,12 @@ public class ExternalServicesConfigurationTest {
LOG.info("{} : {}",name,value);
HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
responseSpec, "SMTP", name, newValue);
Assert.assertNotNull(arrayListValue.get("value"));
Assert.assertEquals(arrayListValue.get("value"), newValue);
Assertions.assertNotNull(arrayListValue.get("value"));
Assertions.assertEquals(arrayListValue.get("value"), newValue);
HashMap arrayListValue1 = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
responseSpec, "SMTP", name, value);
Assert.assertNotNull(arrayListValue1.get("value"));
Assert.assertEquals(arrayListValue1.get("value"), value);
Assertions.assertNotNull(arrayListValue1.get("value"));
Assertions.assertEquals(arrayListValue1.get("value"), value);
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -35,10 +35,10 @@ import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@SuppressWarnings("rawtypes")
public class FinancialActivityAccountsTest {
@@ -53,7 +53,7 @@ public class FinancialActivityAccountsTest {
private final Integer assetTransferFinancialActivityId = FinancialActivity.ASSET_TRANSFER.getValue();
public static final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID = FinancialActivity.LIABILITY_TRANSFER.getValue();
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -73,14 +73,14 @@ public class FinancialActivityAccountsTest {
/** Create a Liability and an Asset Transfer Account **/
Account liabilityTransferAccount = accountHelper.createLiabilityAccount();
Account assetTransferAccount = accountHelper.createAssetAccount();
Assert.assertNotNull(assetTransferAccount);
Assert.assertNotNull(liabilityTransferAccount);
Assertions.assertNotNull(assetTransferAccount);
Assertions.assertNotNull(liabilityTransferAccount);
/*** Create A Financial Activity to Account Mapping **/
Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount.getAccountID(), responseSpec,
CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId);
Assertions.assertNotNull(financialActivityAccountId);
/***
* Fetch Created Financial Activity to Account Mapping and validate
@@ -93,12 +93,12 @@ public class FinancialActivityAccountsTest {
* changes
**/
Account newLiabilityTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(newLiabilityTransferAccount);
Assertions.assertNotNull(newLiabilityTransferAccount);
HashMap changes = (HashMap) financialActivityAccountHelper.updateFinancialActivityAccount(financialActivityAccountId,
LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, newLiabilityTransferAccount.getAccountID(), responseSpec,
CommonConstants.RESPONSE_CHANGES);
Assert.assertEquals(newLiabilityTransferAccount.getAccountID(), changes.get("glAccountId"));
Assertions.assertEquals(newLiabilityTransferAccount.getAccountID(), changes.get("glAccountId"));
/** Validate update works correctly **/
assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID,
@@ -131,8 +131,8 @@ public class FinancialActivityAccountsTest {
/** Should be able to delete a Financial Activity to Account Mapping **/
Integer deletedFinancialActivityAccountId = financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
/*** Trying to fetch a Deleted Account Mapping should give me a 404 **/
financialActivityAccountHelper.getFinancialActivityAccount(deletedFinancialActivityAccountId, responseSpecForResourceNotFoundError);
@@ -140,22 +140,22 @@ public class FinancialActivityAccountsTest {
private void assertFinancialActivityAccountCreation(Integer financialActivityAccountId, Integer financialActivityId, Account glAccount) {
HashMap mappingDetails = financialActivityAccountHelper.getFinancialActivityAccount(financialActivityAccountId, responseSpec);
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
Assertions.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assertions.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
}
/**
* Delete the Financial activities
*/
@After
@AfterEach
public void tearDown() {
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
for (HashMap financialActivity : financialActivities) {
Integer financialActivityAccountId = (Integer) financialActivity.get("id");
Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
}
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -56,10 +56,10 @@ import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.DateTime;
import org.joda.time.Months;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -105,7 +105,7 @@ public class FixedDepositTest {
// digits. A proper solution would be to implement the exact interest calculation in this test,
// and then to compare the exact results
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -160,7 +160,7 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
@@ -168,14 +168,14 @@ public class FixedDepositTest {
final String accountingRule = CASH_BASED;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount,
incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
/***
* Apply for FD account with created product and verify status
*/
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -210,13 +210,13 @@ public class FixedDepositTest {
* Update interest earned of FD account
*/
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
/***
* Post interest and verify the account summary
*/
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -234,7 +234,7 @@ public class FixedDepositTest {
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId);
Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -296,7 +296,7 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
@@ -305,14 +305,14 @@ public class FixedDepositTest {
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
Integer fixedDepositProductId = createFixedDepositProductWithWithHoldTax(VALID_FROM, VALID_TO, String.valueOf(taxGroupId),
accountingRule, assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
/***
* Apply for FD account with created product and verify status
*/
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
SUBMITTED_ON_DATE, WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -347,17 +347,17 @@ public class FixedDepositTest {
* Update interest earned of FD account
*/
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
/***
* Post interest and verify the account summary
*/
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
Assert.assertNull(accountSummary.get("totalWithholdTax"));
Assertions.assertNull(accountSummary.get("totalWithholdTax"));
/***
* Verify journal entries transactions for interest posting transaction
@@ -372,7 +372,7 @@ public class FixedDepositTest {
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId);
Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -386,7 +386,7 @@ public class FixedDepositTest {
Float maturityAmount = Float.valueOf(accountDetails.get("maturityAmount").toString());
HashMap summary = (HashMap) accountDetails.get("summary");
Assert.assertNotNull(summary.get("totalWithholdTax"));
Assertions.assertNotNull(summary.get("totalWithholdTax"));
Float withHoldTax = (Float) summary.get("totalWithholdTax");
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
@@ -441,7 +441,7 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(closedOn.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
@@ -450,14 +450,14 @@ public class FixedDepositTest {
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
Integer fixedDepositProductId = createFixedDepositProductWithWithHoldTax(VALID_FROM, VALID_TO, String.valueOf(taxGroupId),
accountingRule, assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
/***
* Apply for FD account with created product and verify status
*/
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
SUBMITTED_ON_DATE, WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -492,17 +492,17 @@ public class FixedDepositTest {
* Update interest earned of FD account
*/
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
/***
* Post interest and verify the account summary
*/
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
accountSummary.get("totalInterestPosted");
Assert.assertNull(accountSummary.get("totalWithholdTax"));
Assertions.assertNull(accountSummary.get("totalWithholdTax"));
/***
* FD account verify whether account is matured
@@ -516,7 +516,7 @@ public class FixedDepositTest {
fixedDepositAccountId);
HashMap summary = (HashMap) accountDetails.get("summary");
Assert.assertNotNull(summary.get("totalWithholdTax"));
Assertions.assertNotNull(summary.get("totalWithholdTax"));
Float withHoldTax = (Float) summary.get("totalWithholdTax");
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
JournalEntry.TransactionType.CREDIT));
@@ -651,21 +651,21 @@ public class FixedDepositTest {
final String ACTIVATION_DATE = "01 March 2015";
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
*/
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, chartToUse);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
/***
* Apply for FD account with created product and verify status
*/
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM, depositAmount, depositPeriod);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -685,7 +685,7 @@ public class FixedDepositTest {
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositDetails(fixedDepositAccountId);
Assert.assertEquals(interestRate, accountSummary.get("nominalAnnualInterestRate"));
Assertions.assertEquals(interestRate, accountSummary.get("nominalAnnualInterestRate"));
}
/***
@@ -732,7 +732,7 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
/***
* Create Savings product with CashBased accounting enabled
@@ -740,10 +740,10 @@ public class FixedDepositTest {
final String accountingRule = CASH_BASED;
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, accountingRule,
assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientId, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -759,11 +759,11 @@ public class FixedDepositTest {
*/
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount,
incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -792,13 +792,13 @@ public class FixedDepositTest {
* Update interest earned of FD account
*/
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
/***
* Post interest and verify the account summary
*/
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -827,7 +827,7 @@ public class FixedDepositTest {
*/
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_TRANSFER_TO_SAVINGS, savingsId, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId);
Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -852,7 +852,7 @@ public class FixedDepositTest {
Float balanceAfter = (Float) savingsSummaryAfter.get("accountBalance");
Float expectedSavingsBalance = balanceBefore + prematurityAmount;
Assert.assertEquals("Verifying Savings Account Balance after Premature Closure", expectedSavingsBalance, balanceAfter);
Assertions.assertEquals(expectedSavingsBalance, balanceAfter, "Verifying Savings Account Balance after Premature Closure");
}
@@ -903,7 +903,7 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
@@ -911,11 +911,11 @@ public class FixedDepositTest {
final String accountingRule = CASH_BASED;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount,
incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -941,10 +941,10 @@ public class FixedDepositTest {
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, ACTIVATION_DATE, liablilityAccountInitialEntry);
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest);
Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -988,11 +988,11 @@ public class FixedDepositTest {
String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
this.fixedDepositProductHelper.retrieveAllFixedDepositProducts(this.requestSpec,
this.responseSpec);
@@ -1001,13 +1001,13 @@ public class FixedDepositTest {
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
todaysDate.add(Calendar.DATE, -1);
SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateFixedDepositAccount(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), VALID_FROM, VALID_TO, WHOLE_TERM, SUBMITTED_ON_DATE);
Assert.assertTrue(modificationsHashMap.containsKey("submittedOnDate"));
Assertions.assertTrue(modificationsHashMap.containsKey("submittedOnDate"));
}
@@ -1032,15 +1032,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1075,15 +1075,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1116,15 +1116,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1155,22 +1155,22 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
fixedDepositAccountId = (Integer) this.fixedDepositAccountHelper.deleteFixedDepositApplication(fixedDepositAccountId, "resourceId");
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
}
@Test
@@ -1198,15 +1198,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1238,7 +1238,7 @@ public class FixedDepositTest {
principal = (float) Math.floor(principal);
maturityAmount = (float) Math.floor(maturityAmount);
LOG.info("{}",principal.toString());
Assert.assertEquals("Verifying Maturity amount for Fixed Deposit Account", principal, maturityAmount);
Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Fixed Deposit Account");
}
@Test
@@ -1266,15 +1266,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360,
@@ -1310,7 +1310,7 @@ public class FixedDepositTest {
principal = (float) Math.floor(principal);
maturityAmount = (float) Math.floor(maturityAmount);
LOG.info("{}",principal.toString());
Assert.assertEquals("Verifying Maturity amount for Fixed Deposit Account", principal, maturityAmount);
Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Fixed Deposit Account");
}
@Test
@@ -1342,15 +1342,15 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1399,7 +1399,7 @@ public class FixedDepositTest {
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId);
Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1411,7 +1411,7 @@ public class FixedDepositTest {
principal = (float) Math.floor(principal);
Float maturityAmount = (float) Math.floor((Float) fixedDepositAccountData.get("maturityAmount"));
Assert.assertEquals("Verifying Pre-Closure maturity amount", principal, maturityAmount);
Assertions.assertEquals(principal, maturityAmount, "Verifying Pre-Closure maturity amount");
}
@@ -1444,15 +1444,15 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360,
@@ -1505,7 +1505,7 @@ public class FixedDepositTest {
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId);
Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1517,7 +1517,7 @@ public class FixedDepositTest {
principal = (float) Math.floor(principal);
Float maturityAmount = (float) Math.floor((Float) fixedDepositAccountData.get("maturityAmount"));
Assert.assertEquals("Verifying Pre-Closure maturity amount", principal, maturityAmount);
Assertions.assertEquals(principal, maturityAmount, "Verifying Pre-Closure maturity amount");
}
@@ -1550,15 +1550,15 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
TILL_PREMATURE_WITHDRAWAL);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1616,7 +1616,7 @@ public class FixedDepositTest {
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId);
Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1628,7 +1628,7 @@ public class FixedDepositTest {
Double expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((float) fixedDepositAccountData.get("maturityAmount"));
Assert.assertEquals("Verifying Pre-Closure maturity amount", expectedPrematureAmount, maturityAmount);
Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount");
}
@@ -1661,15 +1661,15 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
TILL_PREMATURE_WITHDRAWAL);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360,
@@ -1731,7 +1731,7 @@ public class FixedDepositTest {
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId);
Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1743,7 +1743,7 @@ public class FixedDepositTest {
Float expectedPrematureAmount = (float) Math.floor(principal);
Float maturityAmount = (float) Math.floor((Float) fixedDepositAccountData.get("maturityAmount"));
Assert.assertEquals("Verifying Pre-Closure maturity amount", expectedPrematureAmount, maturityAmount);
Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount");
}
@@ -1772,15 +1772,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_365,
@@ -1817,7 +1817,7 @@ public class FixedDepositTest {
principal = (float) Math.floor(principal);
maturityAmount = (float) Math.floor(maturityAmount);
LOG.info("{}",principal.toString());
Assert.assertEquals("Verifying Maturity amount for Fixed Deposit Account", principal, maturityAmount);
Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Fixed Deposit Account");
}
@@ -1847,15 +1847,15 @@ public class FixedDepositTest {
LOG.info("Submitted Date: {}" , SUBMITTED_ON_DATE);
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360,
@@ -1892,7 +1892,7 @@ public class FixedDepositTest {
principal = new BigDecimal(principal).setScale(0, RoundingMode.FLOOR).floatValue();
maturityAmount = new BigDecimal(maturityAmount).setScale(0, RoundingMode.FLOOR).floatValue();
LOG.info("{}",principal.toString());
Assert.assertEquals("Verifying Maturity amount for Fixed Deposit Account", principal, maturityAmount);
Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Fixed Deposit Account");
}
@@ -1927,15 +1927,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_365,
@@ -1975,7 +1975,7 @@ public class FixedDepositTest {
Double expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount"));
Assert.assertEquals("Verifying Maturity amount", expectedPrematureAmount, maturityAmount);
Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Maturity amount");
}
@@ -2010,15 +2010,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360,
@@ -2058,7 +2058,7 @@ public class FixedDepositTest {
Double expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount"));
Assert.assertEquals("Verifying Maturity amount", expectedPrematureAmount, maturityAmount);
Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Maturity amount");
}
@@ -2094,15 +2094,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_365,
@@ -2139,7 +2139,7 @@ public class FixedDepositTest {
Double expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount"));
Assert.assertEquals("Verifying Pre-Closure maturity amount", expectedPrematureAmount, maturityAmount);
Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount");
}
@@ -2175,15 +2175,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360,
@@ -2220,7 +2220,7 @@ public class FixedDepositTest {
Double expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount"));
Assert.assertEquals("Verifying Pre-Closure maturity amount", expectedPrematureAmount, maturityAmount);
Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount");
}
@@ -2256,15 +2256,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_365,
@@ -2301,7 +2301,7 @@ public class FixedDepositTest {
Double expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount"));
Assert.assertEquals("Verifying Pre-Closure maturity amount", expectedPrematureAmount, maturityAmount);
Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount");
}
@Test
@@ -2336,15 +2336,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360,
@@ -2381,7 +2381,7 @@ public class FixedDepositTest {
Double expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount"));
Assert.assertEquals("Verifying Pre-Closure maturity amount", expectedPrematureAmount, maturityAmount);
Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount");
}
/***
@@ -2425,7 +2425,7 @@ public class FixedDepositTest {
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
@@ -2433,7 +2433,7 @@ public class FixedDepositTest {
final String accountingRule = CASH_BASED;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount,
incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
/***
* Set maturityInstructionId as re-invest principal+interest
@@ -2446,7 +2446,7 @@ public class FixedDepositTest {
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM, maturityInstructionId);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -2507,7 +2507,7 @@ public class FixedDepositTest {
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
/***
* Create FD product with CashBased accounting enabled
@@ -2515,7 +2515,7 @@ public class FixedDepositTest {
final String accountingRule = CASH_BASED;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount,
incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
/***
* Set maturityInstructionId as re-invest principal
@@ -2528,7 +2528,7 @@ public class FixedDepositTest {
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM, maturityInstructionId);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -2700,7 +2700,7 @@ public class FixedDepositTest {
Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping.getAccountID(), this.responseSpec,
CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId);
Assertions.assertNotNull(financialActivityAccountId);
assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping);
return liabilityAccountForMapping;
}
@@ -2708,8 +2708,8 @@ public class FixedDepositTest {
private void assertFinancialActivityAccountCreation(Integer financialActivityAccountId, Integer financialActivityId, Account glAccount) {
HashMap mappingDetails = this.financialActivityAccountHelper.getFinancialActivityAccount(financialActivityAccountId,
this.responseSpec);
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
Assertions.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assertions.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
}
private Integer createTaxGroup(final String percentage, final Account liabilityAccountForTax){
@@ -2721,15 +2721,15 @@ public class FixedDepositTest {
/**
* Delete the Liability transfer account
*/
@After
@AfterEach
public void tearDown() {
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
for (HashMap financialActivity : financialActivities) {
Integer financialActivityAccountId = (Integer) financialActivity.get("id");
Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
}
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -35,10 +35,10 @@ import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,7 +52,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
private SavingsProductHelper savingsProductHelper;
private SavingsAccountHelper savingsAccountHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -67,7 +67,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
// client activation, savings activation and 1st transaction date
final String startDate = "01 December 2013";
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, startDate);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
// Configuring global config flags
configureInterestPosting(true, 4);
@@ -97,10 +97,10 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
private Integer createSavingsAccount(final Integer clientID, final String startDate) {
final Integer savingsProductID = createSavingsProduct();
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplicationOnDate(clientID, savingsProductID,
ACCOUNT_TYPE_INDIVIDUAL, startDate);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = this.savingsAccountHelper.approveSavingsOnDate(savingsId, startDate);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavingsAccount(savingsId, startDate);
@@ -110,15 +110,15 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
private void configureInterestPosting(final Boolean periodEndEnable, final Integer financialYearBeginningMonth) {
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
Assert.assertNotNull(globalConfig);
Assertions.assertNotNull(globalConfig);
// Updating flag for interest posting at period end
Integer periodEndConfigId = (Integer) globalConfig.get(10).get("id");
Assert.assertNotNull(periodEndConfigId);
Assertions.assertNotNull(periodEndConfigId);
HashMap periodEndConfigData = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
periodEndConfigId.toString());
Assert.assertNotNull(periodEndConfigData);
Assertions.assertNotNull(periodEndConfigData);
Boolean enabled = (Boolean) globalConfig.get(10).get("enabled");
@@ -129,15 +129,15 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
// Updating value for financial year beginning month
Integer financialYearBeginningConfigId = (Integer) globalConfig.get(11).get("id");
Assert.assertNotNull(financialYearBeginningConfigId);
Assertions.assertNotNull(financialYearBeginningConfigId);
HashMap financialYearBeginningConfigData = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec,
this.responseSpec, financialYearBeginningConfigId.toString());
Assert.assertNotNull(financialYearBeginningConfigData);
Assertions.assertNotNull(financialYearBeginningConfigData);
financialYearBeginningConfigId = GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
financialYearBeginningConfigId.toString(), financialYearBeginningMonth.toString());
Assert.assertNotNull(financialYearBeginningConfigId);
Assertions.assertNotNull(financialYearBeginningConfigId);
}
private Integer createSavingsProduct() {
@@ -147,7 +147,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
}
// Reset configuration fields
@After
@AfterEach
public void tearDown() {
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
@@ -21,7 +21,7 @@ package org.apache.fineract.integrationtests;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.hasItem;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
@@ -35,9 +35,9 @@ import java.util.List;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.funds.FundsHelper;
import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* Funds Integration Test for checking Funds Application.
@@ -47,7 +47,7 @@ public class FundsIntegrationTest {
private ResponseSpecification statusOkResponseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -64,7 +64,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
}
@Test
@@ -77,7 +77,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(400).build();
final Long fundID = createFund(jsonData, this.requestSpec, responseSpec);
Assert.assertNull(fundID);
Assertions.assertNull(fundID);
}
@Test
@@ -89,7 +89,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
}
@Test
@@ -101,7 +101,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
FundsHelper fh2 = FundsHelper
.create(fh.getName())
@@ -111,7 +111,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(403).build();
final Long fundID2 = createFund(jsonData, this.requestSpec, responseSpec);
Assert.assertNull(fundID2);
Assertions.assertNull(fundID2);
}
@Test
@@ -123,7 +123,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
FundsHelper fh2 = FundsHelper
.create(Utils.randomNameGenerator("", 10))
@@ -133,7 +133,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(403).build();
final Long fundID2 = createFund(jsonData, this.requestSpec, responseSpec);
Assert.assertNull(fundID2);
Assertions.assertNull(fundID2);
}
@Test
@@ -146,7 +146,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(400).build();
final Long fundID = createFund(jsonData, this.requestSpec, responseSpec);
Assert.assertNull(fundID);
Assertions.assertNull(fundID);
}
@Test
@@ -159,7 +159,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(400).build();
final Long fundID = createFund(jsonData, this.requestSpec, responseSpec);
Assert.assertNull(fundID);
Assertions.assertNull(fundID);
}
@Test
@@ -171,7 +171,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
jsonData = FundsResourceHandler.retrieveFund(fundID, this.requestSpec, this.statusOkResponseSpec);
FundsHelper fh2 = FundsHelper.fromJSON(jsonData);
@@ -188,11 +188,11 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
List<FundsHelper> fhList = FundsResourceHandler.retrieveAllFunds(this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fhList);
Assertions.assertNotNull(fhList);
assertThat(fhList.size(), greaterThanOrEqualTo(1));
assertThat(fhList, hasItem(fh));
}
@@ -214,14 +214,14 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
String newName = Utils.randomNameGenerator("", 10);
String newExternalId = Utils.randomNameGenerator("fund-", 5);
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, newExternalId, this.requestSpec, this.statusOkResponseSpec);
Assert.assertEquals(newName, fh2.getName());
Assert.assertEquals(newExternalId, fh2.getExternalId());
Assertions.assertEquals(newName, fh2.getName());
Assertions.assertEquals(newExternalId, fh2.getExternalId());
}
@Test
@@ -231,7 +231,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(404).build();
FundsHelper fh = FundsResourceHandler.updateFund(Long.MAX_VALUE, newName, newExternalId, this.requestSpec,
responseSpec);
Assert.assertNull(fh);
Assertions.assertNull(fh);
}
@Test
@@ -243,7 +243,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
String newName = Utils.randomNameGenerator("", 120);
String newExternalId = Utils.randomNameGenerator("fund-", 5);
@@ -251,7 +251,7 @@ public class FundsIntegrationTest {
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, newExternalId, this.requestSpec,
responseSpec);
Assert.assertNull(fh2);
Assertions.assertNull(fh2);
}
@Test
@@ -263,12 +263,12 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
String newExternalId = Utils.randomNameGenerator("fund-", 5);
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, null, newExternalId, this.requestSpec, this.statusOkResponseSpec);
Assert.assertEquals(newExternalId, fh2.getExternalId());
Assertions.assertEquals(newExternalId, fh2.getExternalId());
}
@Test
@@ -280,7 +280,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
String newName = Utils.randomNameGenerator("", 10);
String newExternalId = Utils.randomNameGenerator("fund-", 120);
@@ -288,7 +288,7 @@ public class FundsIntegrationTest {
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, newExternalId, this.requestSpec,
responseSpec);
Assert.assertNull(fh2);
Assertions.assertNull(fh2);
}
@Test
@@ -300,12 +300,12 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
String newName = Utils.randomNameGenerator("", 10);
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, null, this.requestSpec, this.statusOkResponseSpec);
Assert.assertEquals(newName, fh2.getName());
Assertions.assertEquals(newName, fh2.getName());
}
@Test
@@ -317,20 +317,20 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID);
Assertions.assertNotNull(fundID);
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, null, null, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNull(fh2.getName());
Assert.assertNull(fh2.getExternalId());
Assertions.assertNull(fh2.getName());
Assertions.assertNull(fh2.getExternalId());
// assert that there was no change in
// the name and external ID of the fund
jsonData = FundsResourceHandler.retrieveFund(fundID, this.requestSpec, this.statusOkResponseSpec);
FundsHelper fh3 = new Gson().fromJson(jsonData, FundsHelper.class);
Assert.assertEquals(fh.getName(), fh3.getName());
Assert.assertEquals(fh.getExternalId(), fh3.getExternalId());
Assertions.assertEquals(fh.getName(), fh3.getName());
Assertions.assertEquals(fh.getExternalId(), fh3.getExternalId());
}
private Long createFund(final String fundJSON,
@@ -27,10 +27,10 @@ import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
@@ -39,7 +39,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
private RequestSpecification requestSpec;
private GlobalConfigurationHelper globalConfigurationHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -47,7 +47,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
}
@After
@AfterEach
public void tearDown() {
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
@@ -61,7 +61,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
// Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper
.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
Assert.assertNotNull(globalConfig);
Assertions.assertNotNull(globalConfig);
String configName = "interest-charged-from-date-same-as-disbursal-date";
boolean newBooleanValue = true;
@@ -74,7 +74,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
Integer updateConfigId = this.globalConfigurationHelper
.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
configId.toString(), newBooleanValue);
Assert.assertNotNull(updateConfigId);
Assertions.assertNotNull(updateConfigId);
break;
}
}
@@ -28,10 +28,10 @@ import java.util.HashMap;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@SuppressWarnings({ "rawtypes", "unchecked", "static-access" })
public class GlobalConfigurationTest {
@@ -41,7 +41,7 @@ public class GlobalConfigurationTest {
private GlobalConfigurationHelper globalConfigurationHelper;
private ResponseSpecification httpStatusForidden;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -50,7 +50,7 @@ public class GlobalConfigurationTest {
this.httpStatusForidden = new ResponseSpecBuilder().expectStatusCode(403).build();
}
@After
@AfterEach
public void tearDown() {
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
@@ -63,30 +63,30 @@ public class GlobalConfigurationTest {
// Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
this.responseSpec);
Assert.assertNotNull(globalConfig);
Assertions.assertNotNull(globalConfig);
String configName = "penalty-wait-period";
for (Integer configIndex = 0; configIndex < globalConfig.size() - 1; configIndex++) {
if (globalConfig.get(configIndex).get("name").equals(configName)) {
Integer configId = (Integer) globalConfig.get(configIndex).get("id");
Assert.assertNotNull(configId);
Assertions.assertNotNull(configId);
HashMap configDataBefore = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
configId.toString());
Assert.assertNotNull(configDataBefore);
Assertions.assertNotNull(configDataBefore);
Integer value = (Integer) configDataBefore.get("value") + 1;
// Updating Value for penalty-wait-period Global Configuration
configId = this.globalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
configId.toString(), value.toString());
Assert.assertNotNull(configId);
Assertions.assertNotNull(configId);
HashMap configDataAfter = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
configId.toString());
// Verifying Value for penalty-wait-period after Updation
Assert.assertEquals("Verifying Global Config Value after Updation", value, configDataAfter.get("value"));
Assertions.assertEquals(value, configDataAfter.get("value"), "Verifying Global Config Value after Updation");
// Updating Enabled Flag for penalty-wait-period Global
// Configuration
@@ -105,7 +105,7 @@ public class GlobalConfigurationTest {
configId.toString());
// Verifying Enabled Flag for penalty-wait-period after Updation
Assert.assertEquals("Verifying Enabled Flag Global Config after Updation", enabled, configDataAfter.get("enabled"));
Assertions.assertEquals(enabled, configDataAfter.get("enabled"), "Verifying Enabled Flag Global Config after Updation");
break;
}
}
@@ -118,13 +118,13 @@ public class GlobalConfigurationTest {
// Retrieving Is Cache Enabled Global Configuration details
ArrayList<HashMap> isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec,
this.responseSpec);
Assert.assertNotNull(isCacheGlobalConfig);
Assertions.assertNotNull(isCacheGlobalConfig);
for (Integer cacheType = 0; cacheType <= isCacheGlobalConfig.size() - 1; cacheType++) {
// Retrieving Is Cache Enabled Global Configuration details
isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec, this.responseSpec);
Assert.assertNotNull(isCacheGlobalConfig);
Assertions.assertNotNull(isCacheGlobalConfig);
HashMap cacheTypeAsHashMap = (HashMap) isCacheGlobalConfig.get(cacheType).get("cacheType");
Integer cacheTypeId = (Integer) cacheTypeAsHashMap.get("id");
@@ -139,7 +139,7 @@ public class GlobalConfigurationTest {
HashMap changes = this.globalConfigurationHelper.updateIsCacheEnabledForGlobalConfiguration(this.requestSpec,
this.responseSpec, cacheTypeId.toString());
Assert.assertEquals("Verifying Is Cache Enabled Global Config after Updation", cacheTypeId, changes.get("cacheType"));
Assertions.assertEquals(cacheTypeId, changes.get("cacheType"), "Verifying Is Cache Enabled Global Config after Updation");
}
}
@@ -149,7 +149,7 @@ public class GlobalConfigurationTest {
// Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper
.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
Assert.assertNotNull(globalConfig);
Assertions.assertNotNull(globalConfig);
String configName = "force-password-reset-days";
String newValue = "0";
@@ -159,7 +159,7 @@ public class GlobalConfigurationTest {
if (globalConfig.get(configIndex).get("name").equals(configName)) {
Integer configId = (Integer) globalConfig.get(configIndex).get(
"id");
Assert.assertNotNull(configId);
Assertions.assertNotNull(configId);
/*
* Update force-password-reset-days with value as 0 and Enable
@@ -172,10 +172,10 @@ public class GlobalConfigurationTest {
CommonConstants.RESPONSE_ERROR);
HashMap hash = (HashMap) error.get(0);
Assert.assertEquals(
"Force Password Reset days value must be greater than zero.",
Assertions.assertEquals(
"error.msg.password.reset.days.value.must.be.greater.than.zero",
hash.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
hash.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE),
"Force Password Reset days value must be greater than zero.");
/*
* Update force-password-reset-days with value as 50 and Enable
@@ -185,14 +185,14 @@ public class GlobalConfigurationTest {
.updatePasswordResetDaysForGlobalConfiguration(
this.requestSpec, this.responseSpec, configId,
"50", newBooleanValue, "changes");
Assert.assertNotNull(updateSuccess);
Assertions.assertNotNull(updateSuccess);
/* Update with value as 0 and Enable as false - success case */
final HashMap updateSuccess1 = (HashMap) this.globalConfigurationHelper
.updatePasswordResetDaysForGlobalConfiguration(
this.requestSpec, this.responseSpec, configId,
newValue, "false", "changes");
Assert.assertNotNull(updateSuccess1);
Assertions.assertNotNull(updateSuccess1);
/* Update without sending value and Enable as true - failure case*/
ArrayList failure = (ArrayList) this.globalConfigurationHelper
@@ -200,10 +200,10 @@ public class GlobalConfigurationTest {
this.requestSpec, this.httpStatusForidden, configId,
null, newBooleanValue, CommonConstants.RESPONSE_ERROR);
HashMap failureHash = (HashMap) failure.get(0);
Assert.assertEquals(
"Force Password Reset days value must be greater than zero.",
Assertions.assertEquals(
"error.msg.password.reset.days.value.must.be.greater.than.zero",
failureHash.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
failureHash.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE),
"Force Password Reset days value must be greater than zero.");
break;
}
@@ -218,7 +218,7 @@ public class GlobalConfigurationTest {
Integer updateConfigId = this.globalConfigurationHelper
.updateValueForGlobalConfiguration(this.requestSpec,
this.responseSpec, configId, newValue);
Assert.assertNotNull(updateConfigId);
Assertions.assertNotNull(updateConfigId);
break;
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -38,9 +38,9 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -55,7 +55,7 @@ public class GroupLoanIntegrationTest {
private LoanTransactionHelper loanTransactionHelper;
private final static Logger LOG = LoggerFactory.getLogger(GroupLoanIntegrationTest.class);
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -125,16 +125,16 @@ public class GroupLoanIntegrationTest {
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final Integer loanProductID = createLoanProduct();
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
HashMap<String,Integer> glim = applyForGlimApplication(clientID, groupID, loanProductID);
LOG.info("Glim Loan Application: {} ", glim);
@@ -146,7 +146,7 @@ public class GroupLoanIntegrationTest {
LOG.info("LoanId: {} ", loanId);
final List<String> retrievedGlimId=GroupHelper.verifyRetrieveGlimAccountsByGroupId(this.requestSpec, this.responseSpec, groupID);
Assert.assertNotNull(retrievedGlimId.toString());
Assertions.assertNotNull(retrievedGlimId.toString());
}
@Test
@@ -154,16 +154,16 @@ public class GroupLoanIntegrationTest {
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final Integer loanProductID = createLoanProduct();
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
HashMap<String,Integer> glim = applyForGlimApplication(clientID, groupID, loanProductID);
LOG.info("Glim Loan Application: {} ", glim);
@@ -175,7 +175,7 @@ public class GroupLoanIntegrationTest {
LOG.info("LoanId: {} ", loanId);
final List<String> retrievedGlimAccountId=GroupHelper.verifyRetrieveGlimAccountsByGlimId(this.requestSpec, this.responseSpec, glimId);
Assert.assertNotNull(retrievedGlimAccountId);
Assertions.assertNotNull(retrievedGlimAccountId);
}
private Map<String, Object> approvalFormData(final Integer loanId, final String approvedOnDate) {
@@ -247,24 +247,26 @@ public class GroupLoanIntegrationTest {
private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
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"));
assertEquals("Checking for Principal Due for 1st Month", Float.valueOf("2911.49"), loanSchedule.get(1).get("principalOriginalDue"));
assertEquals("Checking for Interest Due for 1st Month", Float.valueOf("240.00"), loanSchedule.get(1).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2011, 10, 20)), loanSchedule.get(1).get("dueDate"),
"Checking for Due Date for 1st Month");
assertEquals(Float.valueOf("2911.49"), loanSchedule.get(1).get("principalOriginalDue"),
"Checking for Principal Due for 1st Month");
assertEquals(Float.valueOf("240.00"), loanSchedule.get(1).get("interestOriginalDue"),
"Checking for Interest Due for 1st Month");
assertEquals("Checking for Due Date for 2nd Month", new ArrayList<>(Arrays.asList(2011, 11, 20)),
loanSchedule.get(2).get("dueDate"));
assertEquals("Checking for Principal Due for 2nd Month", Float.valueOf("2969.72"), loanSchedule.get(2).get("principalDue"));
assertEquals("Checking for Interest Due for 2nd Month", Float.valueOf("181.77"), loanSchedule.get(2).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2011, 11, 20)), loanSchedule.get(2).get("dueDate"),
"Checking for Due Date for 2nd Month");
assertEquals(Float.valueOf("2969.72"), loanSchedule.get(2).get("principalDue"), "Checking for Principal Due for 2nd Month");
assertEquals(Float.valueOf("181.77"), loanSchedule.get(2).get("interestOriginalDue"), "Checking for Interest Due for 2nd Month");
assertEquals("Checking for Due Date for 3rd Month", new ArrayList<>(Arrays.asList(2011, 12, 20)),
loanSchedule.get(3).get("dueDate"));
assertEquals("Checking for Principal Due for 3rd Month", Float.valueOf("3029.11"), loanSchedule.get(3).get("principalDue"));
assertEquals("Checking for Interest Due for 3rd Month", Float.valueOf("122.38"), loanSchedule.get(3).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2011, 12, 20)), loanSchedule.get(3).get("dueDate"),
"Checking for Due Date for 3rd Month");
assertEquals(Float.valueOf("3029.11"), loanSchedule.get(3).get("principalDue"), "Checking for Principal Due for 3rd Month");
assertEquals(Float.valueOf("122.38"), loanSchedule.get(3).get("interestOriginalDue"), "Checking for Interest Due for 3rd Month");
assertEquals("Checking for Due Date for 4th Month", new ArrayList<>(Arrays.asList(2012, 1, 20)),
loanSchedule.get(4).get("dueDate"));
assertEquals("Checking for Principal Due for 4th Month", Float.valueOf("3089.68"), loanSchedule.get(4).get("principalDue"));
assertEquals("Checking for Interest Due for 4th Month", Float.valueOf("61.79"), loanSchedule.get(4).get("interestOriginalDue"));
assertEquals(new ArrayList<>(Arrays.asList(2012, 1, 20)), loanSchedule.get(4).get("dueDate"),
"Checking for Due Date for 4th Month");
assertEquals(Float.valueOf("3089.68"), loanSchedule.get(4).get("principalDue"), "Checking for Principal Due for 4th Month");
assertEquals(Float.valueOf("61.79"), loanSchedule.get(4).get("interestOriginalDue"), "Checking for Interest Due for 4th Month");
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -44,9 +44,9 @@ import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.LocalDate;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -67,7 +67,7 @@ public class GroupSavingsIntegrationTest {
private SavingsAccountHelper savingsAccountHelper;
private final static Logger LOG = LoggerFactory.getLogger(GroupSavingsIntegrationTest.class);
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -80,26 +80,26 @@ public class GroupSavingsIntegrationTest {
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(groupID, savingsProductID, savingsId, ACCOUNT_TYPE_GROUP);
Assert.assertTrue(modifications.containsKey("submittedOnDate"));
Assertions.assertTrue(modifications.containsKey("submittedOnDate"));
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -117,7 +117,7 @@ public class GroupSavingsIntegrationTest {
this.savingsAccountHelper.postInterestForSavings(savingsId);
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Assert.assertFalse(summaryBefore.equals(summary));
Assertions.assertFalse(summaryBefore.equals(summary));
final Object savingsInterest = this.savingsAccountHelper.getSavingsInterest(savingsId);
@@ -131,23 +131,23 @@ public class GroupSavingsIntegrationTest {
final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, errorResponse);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = "1000.0";
final String enforceMinRequiredBalance = "true";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -182,23 +182,23 @@ public class GroupSavingsIntegrationTest {
new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -232,20 +232,20 @@ public class GroupSavingsIntegrationTest {
new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
List<Map<String, Object>> clientArray = new ArrayList<>();
clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013"));
@@ -282,27 +282,27 @@ public class GroupSavingsIntegrationTest {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
List<Map<String, Object>> clientArray = new ArrayList<>();
clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013"));
LOG.info("client Array : {} ", clientArray);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
String name = PaymentTypeHelper.randomNameGenerator("P_T", 5);
String description = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15);
@@ -310,7 +310,7 @@ public class GroupSavingsIntegrationTest {
Integer position = 1;
Integer paymentTypeId = PaymentTypeHelper.createPaymentType(requestSpec, responseSpec, name, description, isCashPayment, position);
Assert.assertNotNull(paymentTypeId);
Assertions.assertNotNull(paymentTypeId);
List<Map<String, Object>> savingsArray = new ArrayList<>();
final Integer transactionAmount=2500;
@@ -326,7 +326,7 @@ public class GroupSavingsIntegrationTest {
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final Integer depositId = this.savingsAccountHelper.depositGsimApplication(savingsId, savingsArray);
Assert.assertNotNull(depositId);
Assertions.assertNotNull(depositId);
}
@@ -338,20 +338,20 @@ public class GroupSavingsIntegrationTest {
final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, errorResponse);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = "1000.0";
final String enforceMinRequiredBalance = "true";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
List<Map<String, Object>> clientArray = new ArrayList<>();
clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013"));
@@ -385,20 +385,20 @@ public class GroupSavingsIntegrationTest {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = "1000.0";
final String enforceMinRequiredBalance = "true";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
List<Map<String, Object>> clientArray = new ArrayList<>();
clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013"));
@@ -407,7 +407,7 @@ public class GroupSavingsIntegrationTest {
HashMap savingsStatusHashMap = this.savingsAccountHelper.updateGsimApplication(gsimID, clientID, groupID, savingsProductID);
LOG.info("savingsStatusHashMap: {} ",savingsStatusHashMap);
Assert.assertTrue(savingsStatusHashMap.containsKey("savingsId"));
Assertions.assertTrue(savingsStatusHashMap.containsKey("savingsId"));
}
@@ -418,27 +418,27 @@ public class GroupSavingsIntegrationTest {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = "1000.0";
final String enforceMinRequiredBalance = "true";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
List<Map<String, Object>> clientArray = new ArrayList<>();
clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013"));
final Integer gsimID = this.savingsAccountHelper.applyForGsimApplication(clientArray);
final List<String> retrievedGsimId=GroupHelper.verifyRetrieveGsimAccounts(this.requestSpec, this.responseSpec, groupID);
Assert.assertNotNull(retrievedGsimId.toString());
Assertions.assertNotNull(retrievedGsimId.toString());
}
@SuppressWarnings("unchecked")
@@ -451,23 +451,23 @@ public class GroupSavingsIntegrationTest {
new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -502,23 +502,23 @@ public class GroupSavingsIntegrationTest {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -536,23 +536,23 @@ public class GroupSavingsIntegrationTest {
new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -575,39 +575,39 @@ public class GroupSavingsIntegrationTest {
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals("Verifying Deposit Amount", Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"));
assertEquals("Verifying Balance after Deposit", balance, depositTransaction.get("runningBalance"));
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT);
assertEquals("Verifying Withdrawal Amount", Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"));
assertEquals("Verifying Balance after Withdrawal", balance, withdrawTransaction.get("runningBalance"));
assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
Integer newWithdrawTransactionId = this.savingsAccountHelper.updateSavingsAccountTransaction(savingsId, withdrawTransactionId,
WITHDRAW_AMOUNT_ADJUSTED);
HashMap newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, newWithdrawTransactionId);
balance = balance + Float.valueOf(WITHDRAW_AMOUNT) - Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals("Verifying adjusted Amount", Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount"));
assertEquals("Verifying Balance after adjust", balance, newWithdrawTransaction.get("runningBalance"));
assertEquals(Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount"), "Verifying adjusted Amount");
assertEquals(balance, newWithdrawTransaction.get("runningBalance"), "Verifying Balance after adjust");
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals("Verifying Adjusted Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying Adjusted Balance");
withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
Assert.assertTrue((Boolean) withdrawTransaction.get("reversed"));
Assertions.assertTrue((Boolean) withdrawTransaction.get("reversed"));
this.savingsAccountHelper.undoSavingsAccountTransaction(savingsId, newWithdrawTransactionId);
newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
Assert.assertTrue((Boolean) newWithdrawTransaction.get("reversed"));
Assertions.assertTrue((Boolean) newWithdrawTransaction.get("reversed"));
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
balance += Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals("Verifying Balance After Undo Transaction", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying Balance After Undo Transaction");
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR);
@@ -640,44 +640,44 @@ public class GroupSavingsIntegrationTest {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID);
Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalChargeId);
Assertions.assertNotNull(withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId, false);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size());
Assertions.assertEquals(1, chargesPendingState.size());
Integer savingsChargeId = (Integer) chargesPendingState.get(0).get("id");
HashMap chargeChanges = this.savingsAccountHelper.updateCharges(savingsChargeId, savingsId);
Assert.assertTrue(chargeChanges.containsKey("amount"));
Assertions.assertTrue(chargeChanges.containsKey("amount"));
Integer deletedChargeId = this.savingsAccountHelper.deleteCharge(savingsChargeId, savingsId);
assertEquals(savingsChargeId, deletedChargeId);
chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertTrue(chargesPendingState == null || chargesPendingState.size() == 0);
Assertions.assertTrue(chargesPendingState == null || chargesPendingState.size() == 0);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
@@ -686,14 +686,14 @@ public class GroupSavingsIntegrationTest {
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final Integer chargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(chargeId);
Assertions.assertNotNull(chargeId);
ArrayList<HashMap> charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertTrue(charges == null || charges.size() == 0);
Assertions.assertTrue(charges == null || charges.size() == 0);
this.savingsAccountHelper.addChargesForSavings(savingsId, chargeId, true);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, charges.size());
Assertions.assertEquals(1, charges.size());
HashMap savingsChargeForPay = charges.get(0);
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.DATE_FORMAT, Locale.US);
@@ -710,11 +710,11 @@ public class GroupSavingsIntegrationTest {
final Integer monthlyFeechargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsMonthlyFeeJSON());
Assert.assertNotNull(monthlyFeechargeId);
Assertions.assertNotNull(monthlyFeechargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId, true);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(2, charges.size());
Assertions.assertEquals(2, charges.size());
HashMap savingsChargeForWaive = charges.get(1);
this.savingsAccountHelper.waiveCharge((Integer) savingsChargeForWaive.get("id"), savingsId);
@@ -728,11 +728,11 @@ public class GroupSavingsIntegrationTest {
assertEquals(totalWaiveAmount.floatValue(), waiveCharge.get("amountWaived"));
final Integer weeklyFeeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsWeeklyFeeJSON());
Assert.assertNotNull(weeklyFeeId);
Assertions.assertNotNull(weeklyFeeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, weeklyFeeId, true);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(3, charges.size());
Assertions.assertEquals(3, charges.size());
savingsChargeForPay = charges.get(2);
cal = Calendar.getInstance();
@@ -744,7 +744,7 @@ public class GroupSavingsIntegrationTest {
// Depositing huge amount as scheduler job deducts the fee amount
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, "100000",
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(depositTransactionId);
Assertions.assertNotNull(depositTransactionId);
this.savingsAccountHelper.payCharge((Integer) savingsChargeForPay.get("id"), savingsId,
((Float) savingsChargeForPay.get("amount")).toString(), sdf.format(cal.getTime()));
@@ -18,8 +18,8 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -34,9 +34,9 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -54,7 +54,7 @@ public class GroupTest {
private final String numberOfRepayments = "5";
private final String interestRatePerPeriod = "18";
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -110,21 +110,21 @@ public class GroupTest {
// create staff
Integer createStaffId1 = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
LOG.info("--------------creating first staff with id------------- {}" , createStaffId1);
Assert.assertNotNull(createStaffId1);
Assertions.assertNotNull(createStaffId1);
Integer createStaffId2 = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
LOG.info("--------------creating second staff with id------------- {}" , createStaffId2);
Assert.assertNotNull(createStaffId2);
Assertions.assertNotNull(createStaffId2);
// assign staff "createStaffId1" to group
HashMap assignStaffGroupId = (HashMap) GroupHelper.assignStaff(this.requestSpec, this.responseSpec, groupID.toString(),
createStaffId1.longValue());
assertEquals("Verify assigned staff id is the same as id sent", assignStaffGroupId.get("staffId"), createStaffId1);
assertEquals(assignStaffGroupId.get("staffId"), createStaffId1, "Verify assigned staff id is the same as id sent");
// assign staff "createStaffId2" to client
final HashMap assignStaffToClientChanges = (HashMap) ClientHelper.assignStaffToClient(this.requestSpec, this.responseSpec,
clientID.toString(), createStaffId2.toString());
assertEquals("Verify assigned staff id is the same as id sent", assignStaffToClientChanges.get("staffId"), createStaffId2);
assertEquals(assignStaffToClientChanges.get("staffId"), createStaffId2, "Verify assigned staff id is the same as id sent");
final Integer loanProductId = this.createLoanProduct();
@@ -139,13 +139,13 @@ public class GroupTest {
// assert if client staff officer has change Note client was assigned
// staff with createStaffId2
assertNotEquals("Verify if client stuff has changed", assignStaffAndInheritStaffForClientAccounts.get("staffId"), createStaffId2);
assertEquals("Verify if client inherited staff assigned above", assignStaffAndInheritStaffForClientAccounts.get("staffId"),
getClientStaffId);
assertNotEquals(assignStaffAndInheritStaffForClientAccounts.get("staffId"), createStaffId2, "Verify if client stuff has changed");
assertEquals(assignStaffAndInheritStaffForClientAccounts.get("staffId"), getClientStaffId,
"Verify if client inherited staff assigned above");
// assert if clients loan officer has changed
final Integer loanOfficerId = this.loanTransactionHelper.getLoanOfficerId(loanId.toString());
assertEquals("Verify if client loan inherited staff", assignStaffAndInheritStaffForClientAccounts.get("staffId"), loanOfficerId);
assertEquals(assignStaffAndInheritStaffForClientAccounts.get("staffId"), loanOfficerId, "Verify if client loan inherited staff");
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;
import io.restassured.RestAssured;
import io.restassured.builder.RequestSpecBuilder;
@@ -33,9 +33,9 @@ import org.apache.fineract.integrationtests.common.HookHelper;
import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.http.conn.HttpHostConnectException;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -47,7 +47,7 @@ public class HookIntegrationTest {
private HookHelper hookHelper;
private OfficeHelper officeHelper;
@Before
@BeforeEach
public void setUp() throws Exception {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -77,8 +77,8 @@ public class HookIntegrationTest {
try {
final String json = RestAssured.get(payloadURL.replace("?", "")).asString();
final Integer notificationOfficeId = JsonPath.with(json).get("officeId");
Assert.assertEquals("Equality check for created officeId and hook received payload officeId", createdOfficeID,
notificationOfficeId);
Assertions.assertEquals(createdOfficeID, notificationOfficeId,
"Equality check for created officeId and hook received payload officeId");
LOG.info("Notification Office Id - {}" , notificationOfficeId);
i = 6;
} catch (Exception e) {
@@ -102,7 +102,7 @@ public class HookIntegrationTest {
final String updateURL = "http://localhost";
Long hookId = this.hookHelper.createHook(payloadURL).longValue();
Assert.assertNotNull(hookId);
Assertions.assertNotNull(hookId);
this.hookHelper.verifyHookCreatedOnServer(hookId);
LOG.info("---------------------SUCCESSFULLY CREATED AND VERIFIED HOOK------------------------- {}",hookId);
this.hookHelper.updateHook(updateURL, hookId);
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -35,8 +35,8 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,7 +49,7 @@ public class LoanApplicationApprovalTest {
private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -32,9 +32,9 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,7 +46,7 @@ public class LoanApplicationUndoLastTrancheTest {
private LoanTransactionHelper loanTransactionHelper;
private LoanApplicationApprovalTest loanApplicationApprovalTest;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -125,7 +125,7 @@ public class LoanApplicationUndoLastTrancheTest {
}
private void validateDisbursedAmount(Float disbursedAmount) {
Assert.assertEquals(Float.valueOf("1000.0"), disbursedAmount);
Assertions.assertEquals(Float.valueOf("1000.0"), disbursedAmount);
}
@@ -32,9 +32,9 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,7 +46,7 @@ public class LoanDisbursalDateValidationTest {
private LoanTransactionHelper loanTransactionHelper;
private ResponseSpecification responseForbiddenError;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -94,8 +94,8 @@ public class LoanDisbursalDateValidationTest {
@SuppressWarnings("unchecked")
List<HashMap> disbursalError = (List<HashMap>) this.loanTransactionHelper.disburseLoan(disbursalDate, loanID, this.responseForbiddenError);
Assert.assertEquals("error.msg.actual.disbursement.date.does.not.match.with.expected.disbursal.date",
disbursalError.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
Assertions.assertEquals(disbursalError.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE),
"error.msg.actual.disbursement.date.does.not.match.with.expected.disbursal.date");
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -37,8 +37,8 @@ import org.apache.fineract.integrationtests.common.loans.LoanDisbursementTestBui
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -55,7 +55,7 @@ public class LoanDisbursementDetailsIntegrationTest {
final String proposedAmount = "5000";
final String approvalAmount = "5000";
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -38,8 +38,8 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,7 +52,7 @@ public class LoanRepaymentRescheduleAtDisbursementTest {
private LoanApplicationApprovalTest loanApplicationApprovalTest;
private ResponseSpecification generalResponseSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,8 +18,8 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -34,8 +34,8 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,7 +59,7 @@ public class LoanRescheduleRequestTest {
private String interestRatePerPeriod = "18";
private String dateString = "4 September 2014";
@Before
@BeforeEach
public void initialize() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -19,7 +19,7 @@
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import io.restassured.builder.RequestSpecBuilder;
@@ -49,9 +49,9 @@ import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -63,7 +63,7 @@ public class LoanReschedulingWithinCenterTest {
private ResponseSpecification generalResponseSpec;
private LoanApplicationApprovalTest loanApplicationApprovalTest;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -90,9 +90,9 @@ public class LoanReschedulingWithinCenterTest {
responseSpec);
CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec);
Integer groupId = groupMembers[0];
Assert.assertNotNull(center);
Assert.assertTrue(center.getStaffId() == staffId);
Assert.assertTrue(center.isActive() == true);
Assertions.assertNotNull(center);
Assertions.assertTrue(center.getStaffId() == staffId);
Assertions.assertTrue(center.isActive() == true);
Integer calendarId = createCalendarMeeting(centerId);
@@ -122,7 +122,7 @@ public class LoanReschedulingWithinCenterTest {
recalculationRestFrequencyDate, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0), null);
// Test for loan account is created
Assert.assertNotNull(loanId);
Assertions.assertNotNull(loanId);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanId);
// Test for loan account is created, can be approved
@@ -201,9 +201,9 @@ public class LoanReschedulingWithinCenterTest {
responseSpec);
CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec);
Integer groupId = groupMembers[0];
Assert.assertNotNull(center);
Assert.assertTrue(center.getStaffId() == staffId);
Assert.assertTrue(center.isActive() == true);
Assertions.assertNotNull(center);
Assertions.assertTrue(center.getStaffId() == staffId);
Assertions.assertTrue(center.isActive() == true);
Integer calendarId = createCalendarMeeting(centerId);
@@ -30,9 +30,9 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -62,7 +62,7 @@ public class LoanWithWaiveInterestAndWriteOffIntegrationTest {
private final String INTEREST_VALUE_AMOUNT = "40.00";
private LoanTransactionHelper loanTransactionHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -170,22 +170,22 @@ public class LoanWithWaiveInterestAndWriteOffIntegrationTest {
this.loanTransactionHelper.makeRepayment("1 January 2011", repayment_with_interest, loanID);
HashMap toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID);
Assert.assertTrue("Checking for Principal paid ",
Float.valueOf("500.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("principalPaid")))) == 0);
Assert.assertTrue("Checking for interestPaid paid ",
Float.valueOf("180.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("interestPaid")))) == 0);
Assert.assertTrue("Checking for total paid ",
Float.valueOf("680.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("totalRepayment")))) == 0);
Assertions.assertTrue(Float.valueOf("500.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("principalPaid")))) == 0,
"Checking for Principal paid ");
Assertions.assertTrue(Float.valueOf("180.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("interestPaid")))) == 0,
"Checking for interestPaid paid ");
Assertions.assertTrue(Float.valueOf("680.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("totalRepayment")))) == 0,
"Checking for total paid ");
// WRITE OFF LOAN AND CHECK ACCOUNT IS CLOSED
LoanStatusChecker.verifyLoanAccountIsClosed(this.loanTransactionHelper.writeOffLoan("1 January 2011", loanID));
toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID);
Assert.assertTrue("Checking for Principal written off ",
Float.valueOf("4000.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("principalWrittenOff")))) == 0);
Assert.assertTrue("Checking for interestPaid written off ",
Float.valueOf("1440.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("interestWrittenOff")))) == 0);
Assert.assertTrue("Checking for total written off ",
Float.valueOf("5440.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("totalWrittenOff")))) == 0);
Assertions.assertTrue(Float.valueOf("4000.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("principalWrittenOff")))) == 0,
"Checking for Principal written off ");
Assertions.assertTrue(Float.valueOf("1440.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("interestWrittenOff")))) == 0,
"Checking for interestPaid written off ");
Assertions.assertTrue(Float.valueOf("5440.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("totalWrittenOff")))) == 0,
"Checking for total written off ");
}
@@ -30,8 +30,8 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@SuppressWarnings("rawtypes")
public class LoanWithdrawnByApplicantIntegrationTest {
@@ -40,7 +40,7 @@ public class LoanWithdrawnByApplicantIntegrationTest {
private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -36,9 +36,9 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* Test the creation, approval and rejection of a loan reschedule request
@@ -60,7 +60,7 @@ public class MinimumDaysBetweenDisbursalAndFirstRepaymentTest {
private final String interestRatePerPeriod = "18";
private final String groupActivationDate = "1 August 2014";
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
}
@@ -95,7 +95,7 @@ public class MinimumDaysBetweenDisbursalAndFirstRepaymentTest {
this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
// Test for loan account is created
Assert.assertNotNull(this.loanId);
Assertions.assertNotNull(this.loanId);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -26,9 +26,9 @@ import io.restassured.specification.ResponseSpecification;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.NotificationHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -37,7 +37,7 @@ public class NotificationApiTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setUp() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -51,6 +51,6 @@ public class NotificationApiTest {
HashMap<String, Object> response = (HashMap<String, Object>) NotificationHelper.getNotifications(this.requestSpec,
this.responseSpec, "");
LOG.info("Response : {}" , response.toString());
Assert.assertNotNull(response);
Assertions.assertNotNull(response);
}
}
@@ -26,16 +26,16 @@ import io.restassured.specification.ResponseSpecification;
import org.apache.fineract.integrationtests.common.OfficeDomain;
import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class OfficeIntegrationTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(
@@ -59,7 +59,7 @@ public class OfficeIntegrationTest {
oh.updateOffice(officeId, name, date);
OfficeDomain newOffice = oh.retrieveOfficeByID(officeId);
Assert.assertTrue(name.equals(newOffice.getName()));
Assert.assertArrayEquals(dateArr, newOffice.getOpeningDate());
Assertions.assertTrue(name.equals(newOffice.getName()));
Assertions.assertArrayEquals(dateArr, newOffice.getOpeningDate());
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -30,8 +30,8 @@ import java.util.List;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.PasswordPreferencesHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -42,7 +42,7 @@ public class PasswordPreferencesIntegrationTest {
private RequestSpecification requestSpec;
private ResponseSpecification generalResponseSpec;
@Before
@BeforeEach
public void setUp() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -71,8 +71,8 @@ public class PasswordPreferencesIntegrationTest {
String invalidValidationPolicyId = "2000";
final List<HashMap> error = (List) PasswordPreferencesHelper.updateWithInvalidValidationPolicyId(requestSpec, generalResponseSpec, invalidValidationPolicyId,
CommonConstants.RESPONSE_ERROR);
assertEquals("Password Validation Policy with identifier 2000 does not exist", "error.msg.password.validation.policy.id.invalid",
error.get(0).get("userMessageGlobalisationCode"));
assertEquals("error.msg.password.validation.policy.id.invalid", error.get(0).get("userMessageGlobalisationCode"),
"Password Validation Policy with identifier 2000 does not exist");
}
}
@@ -27,16 +27,16 @@ import java.util.HashMap;
import org.apache.fineract.integrationtests.common.PaymentTypeDomain;
import org.apache.fineract.integrationtests.common.PaymentTypeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class PaymentTypeIntegrationTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -54,13 +54,13 @@ public class PaymentTypeIntegrationTest {
Integer position = 1;
Integer paymentTypeId = PaymentTypeHelper.createPaymentType(requestSpec, responseSpec, name, description, isCashPayment, position);
Assert.assertNotNull(paymentTypeId);
Assertions.assertNotNull(paymentTypeId);
PaymentTypeHelper.verifyPaymentTypeCreatedOnServer(requestSpec, responseSpec, paymentTypeId);
PaymentTypeDomain paymentTypeResponse = PaymentTypeHelper.retrieveById(requestSpec, responseSpec, paymentTypeId);
Assert.assertEquals(name, paymentTypeResponse.getName());
Assert.assertEquals(description, paymentTypeResponse.getDescription());
Assert.assertEquals(isCashPayment, paymentTypeResponse.getIsCashPayment());
Assert.assertEquals(position, paymentTypeResponse.getPosition());
Assertions.assertEquals(name, paymentTypeResponse.getName());
Assertions.assertEquals(description, paymentTypeResponse.getDescription());
Assertions.assertEquals(isCashPayment, paymentTypeResponse.getIsCashPayment());
Assertions.assertEquals(position, paymentTypeResponse.getPosition());
// Update Payment Type
String newName = PaymentTypeHelper.randomNameGenerator("P_TU", 5);
@@ -75,14 +75,14 @@ public class PaymentTypeIntegrationTest {
request.put("position", newPosition);
PaymentTypeHelper.updatePaymentType(paymentTypeId, request, requestSpec, responseSpec);
PaymentTypeDomain paymentTypeUpdatedResponse = PaymentTypeHelper.retrieveById(requestSpec, responseSpec, paymentTypeId);
Assert.assertEquals(newName, paymentTypeUpdatedResponse.getName());
Assert.assertEquals(newDescription, paymentTypeUpdatedResponse.getDescription());
Assert.assertEquals(isCashPaymentUpdatedValue, paymentTypeUpdatedResponse.getIsCashPayment());
Assert.assertEquals(newPosition, paymentTypeUpdatedResponse.getPosition());
Assertions.assertEquals(newName, paymentTypeUpdatedResponse.getName());
Assertions.assertEquals(newDescription, paymentTypeUpdatedResponse.getDescription());
Assertions.assertEquals(isCashPaymentUpdatedValue, paymentTypeUpdatedResponse.getIsCashPayment());
Assertions.assertEquals(newPosition, paymentTypeUpdatedResponse.getPosition());
// Delete
Integer deletedPaymentTypeId = PaymentTypeHelper.deletePaymentType(paymentTypeId, requestSpec, responseSpec);
Assert.assertEquals(paymentTypeId, deletedPaymentTypeId);
Assertions.assertEquals(paymentTypeId, deletedPaymentTypeId);
ResponseSpecification responseSpecification = new ResponseSpecBuilder().expectStatusCode(404).build();
PaymentTypeHelper.retrieveById(requestSpec, responseSpecification, paymentTypeId);
@@ -27,9 +27,9 @@ import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.rates.RatesHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@SuppressWarnings({"rawtypes"})
public class RatesTest {
@@ -37,7 +37,7 @@ public class RatesTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -51,12 +51,12 @@ public class RatesTest {
// Retrieving all Rates
ArrayList<HashMap> allRatesData = RatesHelper.getRates(this.requestSpec, this.responseSpec);
Assert.assertNotNull(allRatesData);
Assertions.assertNotNull(allRatesData);
// Testing Creation and Update of Loan Rate
final Integer loanRateId = RatesHelper.createRates(this.requestSpec, this.responseSpec,
RatesHelper.getLoanRateJSON());
Assert.assertNotNull(loanRateId);
Assertions.assertNotNull(loanRateId);
//Update Rate percentage
HashMap changes = RatesHelper.updateRates(this.requestSpec, this.responseSpec, loanRateId,
@@ -64,8 +64,8 @@ public class RatesTest {
HashMap rateDataAfterChanges = RatesHelper
.getRateById(this.requestSpec, this.responseSpec, loanRateId);
Assert.assertEquals("Verifying Rate after modification", rateDataAfterChanges.get("percentage"),
changes.get("percentage"));
Assertions.assertEquals(rateDataAfterChanges.get("percentage"),
changes.get("percentage"), "Verifying Rate after modification");
}
@@ -18,8 +18,8 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -31,9 +31,9 @@ import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.apache.fineract.integrationtests.useradministration.roles.RolesHelper;
import org.apache.fineract.integrationtests.useradministration.users.UserHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -42,7 +42,7 @@ public class RolesTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -56,7 +56,7 @@ public class RolesTest {
LOG.info("---------------------------------CREATING A ROLE---------------------------------------------");
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId);
Assertions.assertNotNull(roleId);
LOG.info("--------------------------------- Getting ROLE -------------------------------");
HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId);
@@ -70,7 +70,7 @@ public class RolesTest {
LOG.info("---------------------------------CREATING A ROLE---------------------------------------------");
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId);
Assertions.assertNotNull(roleId);
LOG.info("--------------------------------- Getting ROLE -------------------------------");
HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId);
@@ -91,7 +91,7 @@ public class RolesTest {
LOG.info("---------------------------------CREATING A ROLE---------------------------------------------");
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId);
Assertions.assertNotNull(roleId);
LOG.info("--------------------------------- Getting ROLE -------------------------------");
HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId);
@@ -119,7 +119,7 @@ public class RolesTest {
LOG.info("-------------------------------- CREATING A ROLE---------------------------------------------");
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId);
Assertions.assertNotNull(roleId);
LOG.info("--------------------------------- Getting ROLE -------------------------------");
HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId);
@@ -133,16 +133,16 @@ public class RolesTest {
@Test
public void testRoleShouldGetDeletedIfNoActiveUserExists() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId);
Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Assert.assertNotNull(staffId);
Assertions.assertNotNull(staffId);
final Integer userId = UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId);
Assert.assertNotNull(userId);
Assertions.assertNotNull(userId);
final Integer deletedUserId = UserHelper.deleteUser(this.requestSpec, this.responseSpec, userId);
Assert.assertEquals(deletedUserId, userId);
Assertions.assertEquals(deletedUserId, userId);
final Integer deletedRoleId = RolesHelper.deleteRole(this.requestSpec, this.responseSpec, roleId);
assertEquals(deletedRoleId, roleId);
@@ -151,13 +151,13 @@ public class RolesTest {
@Test
public void testRoleShouldNotGetDeletedIfActiveUserExists() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId);
Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Assert.assertNotNull(staffId);
Assertions.assertNotNull(staffId);
final Integer userId = UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId);
Assert.assertNotNull(userId);
Assertions.assertNotNull(userId);
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(403).build();
final Integer deletedRoleId = RolesHelper.deleteRole(this.requestSpec, this.responseSpec, roleId);
@@ -19,7 +19,7 @@
package org.apache.fineract.integrationtests;
import static org.awaitility.Awaitility.await;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.http.ContentType;
@@ -31,9 +31,9 @@ import java.util.Map;
import org.apache.fineract.infrastructure.jobs.service.JobName;
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class SchedulerJobsTest {
@@ -42,7 +42,7 @@ public class SchedulerJobsTest {
private Boolean originalSchedulerStatus;
private final Map<Integer, Boolean> originalJobStatus = new HashMap<>();
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -57,7 +57,7 @@ public class SchedulerJobsTest {
}
}
@After
@AfterEach
public void tearDown() {
schedulerJobHelper.updateSchedulerStatus(originalSchedulerStatus);
for (int jobId = 1; jobId < JobName.values().length; jobId++) {
@@ -85,19 +85,19 @@ public class SchedulerJobsTest {
schedulerJobHelper.updateSchedulerStatus(false);
schedulerStatus = schedulerJobHelper.getSchedulerStatus();
// Verifying Status of the Scheduler after stopping
assertEquals("Verifying Scheduler Job Status", false, schedulerStatus);
assertEquals(false, schedulerStatus, "Verifying Scheduler Job Status");
} else {
schedulerJobHelper.updateSchedulerStatus(true);
schedulerStatus = schedulerJobHelper.getSchedulerStatus();
// Verifying Status of the Scheduler after starting
assertEquals("Verifying Scheduler Job Status", true, schedulerStatus);
assertEquals(true, schedulerStatus, "Verifying Scheduler Job Status");
}
}
@Test
public void testNumberOfJobs() {
List<Integer> jobIds = schedulerJobHelper.getAllSchedulerJobIds();
assertEquals("Number of jobs in database and code do not match: " + jobIds, JobName.values().length, jobIds.size());
assertEquals(JobName.values().length, jobIds.size(), "Number of jobs in database and code do not match: " + jobIds);
}
@Test
@@ -118,10 +118,10 @@ public class SchedulerJobsTest {
Map<String, Object> changes = schedulerJobHelper.updateSchedulerJob(jobId, active);
// Verifying Scheduler Job updates
assertEquals("Verifying Scheduler Job Updates", active, changes.get("active"));
assertEquals(active, changes.get("active"), "Verifying Scheduler Job Updates");
schedulerJob = schedulerJobHelper.getSchedulerJobById(jobId);
assertEquals("Verifying Get Scheduler Job", active, schedulerJob.get("active"));
assertEquals(active, schedulerJob.get("active"), "Verifying Get Scheduler Job");
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -60,11 +60,11 @@ import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.apache.fineract.portfolio.account.PortfolioAccountType;
import org.apache.fineract.portfolio.account.domain.AccountTransferType;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@SuppressWarnings({ "unused", "unchecked", "rawtypes", "static-access", "cast" })
public class SchedulerJobsTestResults {
@@ -93,7 +93,7 @@ public class SchedulerJobsTestResults {
private JournalEntryHelper journalEntryHelper;
private StandingInstructionsHelper standingInstructionsHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -106,28 +106,28 @@ public class SchedulerJobsTestResults {
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
}
@After
@AfterEach
public void tearDown() {
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
}
@Test
@Ignore // TODO FINERACT-924
@Disabled // TODO FINERACT-924
public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId);
@@ -135,11 +135,11 @@ public class SchedulerJobsTestResults {
final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(annualFeeChargeId);
Assertions.assertNotNull(annualFeeChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, annualFeeChargeId, true);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size());
Assertions.assertEquals(1, chargesPendingState.size());
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
@@ -162,27 +162,27 @@ public class SchedulerJobsTestResults {
annualFeeDueDateAsArrayList.get(1), annualFeeDueDateAsArrayList.get(2));
LocalDate todaysDate = LocalDate.now(ZoneId.of("Asia/Kolkata"));
Assert.assertTrue("Verifying that all due Annual Fees have been paid ",
nextDueDateForAnnualFee.isAfter(todaysDate));
Assertions.assertTrue(nextDueDateForAnnualFee.isAfter(todaysDate),
"Verifying that all due Annual Fees have been paid ");
}
@Test
@Ignore
@Disabled
public void testInterestPostingForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId);
@@ -201,28 +201,28 @@ public class SchedulerJobsTestResults {
this.schedulerJobHelper.executeJob(JobName);
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
Assert.assertNotSame("Verifying the Balance after running Post Interest for Savings Job",
summaryBefore.get("accountBalance"), summaryAfter.get("accountBalance"));
Assertions.assertNotSame(summaryBefore.get("accountBalance"), summaryAfter.get("accountBalance"),
"Verifying the Balance after running Post Interest for Savings Job");
}
@Test
@Ignore // TODO FINERACT-857
@Disabled // TODO FINERACT-857
public void testTransferFeeForLoansFromSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId);
@@ -235,11 +235,11 @@ public class SchedulerJobsTestResults {
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(),
savingsId.toString());
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID);
@@ -251,13 +251,13 @@ public class SchedulerJobsTestResults {
Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanSpecifiedDueDateWithAccountTransferJSON());
Assert.assertNotNull(specifiedDueDateChargeId);
Assertions.assertNotNull(specifiedDueDateChargeId);
this.loanTransactionHelper.addChargesForLoan(loanID,
LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
specifiedDueDateChargeId.toString(), "12 March 2013", "100"));
ArrayList<HashMap> chargesPendingState = this.loanTransactionHelper.getLoanCharges(loanID);
Assert.assertEquals(1, chargesPendingState.size());
Assertions.assertEquals(1, chargesPendingState.size());
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_DISBURSAL_DATE,
loanID);
@@ -275,13 +275,13 @@ public class SchedulerJobsTestResults {
final Float balance = (Float) summaryBefore.get("accountBalance") - chargeAmount;
Assert.assertEquals("Verifying the Balance after running Transfer Fee for Loans from Savings", balance,
(Float) summaryAfter.get("accountBalance"));
Assertions.assertEquals(balance, (Float) summaryAfter.get("accountBalance"),
"Verifying the Balance after running Transfer Fee for Loans from Savings");
}
@Test
@Ignore // TODO FINERACT-923
@Disabled // TODO FINERACT-923
public void testApplyHolidaysToLoansJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
@@ -289,16 +289,16 @@ public class SchedulerJobsTestResults {
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer holidayId = this.holidayHelper.createHolidays(this.requestSpec, this.responseSpec);
Assert.assertNotNull(holidayId);
Assertions.assertNotNull(holidayId);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID);
@@ -315,16 +315,16 @@ public class SchedulerJobsTestResults {
// Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper
.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
Assert.assertNotNull(globalConfig);
Assertions.assertNotNull(globalConfig);
// Updating Value for reschedule-repayments-on-holidays Global
// Configuration
Integer configId = (Integer) globalConfig.get(3).get("id");
Assert.assertNotNull(configId);
Assertions.assertNotNull(configId);
HashMap configData = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec,
this.responseSpec, configId.toString());
Assert.assertNotNull(configData);
Assertions.assertNotNull(configData);
Boolean enabled = (Boolean) globalConfig.get(3).get("enabled");
@@ -338,7 +338,7 @@ public class SchedulerJobsTestResults {
holidayId = this.holidayHelper.activateHolidays(this.requestSpec, this.responseSpec,
holidayId.toString());
Assert.assertNotNull(holidayId);
Assertions.assertNotNull(holidayId);
String JobName = "Apply Holidays To Loans";
@@ -354,28 +354,27 @@ public class SchedulerJobsTestResults {
ArrayList<Integer> rescheduleDateAfter = (ArrayList<Integer>) repaymentScheduleDataAfterJob.get(2)
.get("fromDate");
Assert.assertEquals(
"Verifying Repayment Rescheduled Date after Running Apply Holidays to Loans Scheduler Job",
repaymentsRescheduledDate, repaymentsRescheduledDate);
Assertions.assertEquals(repaymentsRescheduledDate, repaymentsRescheduledDate,
"Verifying Repayment Rescheduled Date after Running Apply Holidays to Loans Scheduler Job");
}
@Test
@Ignore // TODO FINERACT-857
@Disabled // TODO FINERACT-857
public void testApplyDueFeeChargesForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId);
@@ -383,11 +382,11 @@ public class SchedulerJobsTestResults {
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec,
this.responseSpec, ChargesHelper.getSavingsSpecifiedDueDateJSON());
Assert.assertNotNull(specifiedDueDateChargeId);
Assertions.assertNotNull(specifiedDueDateChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, specifiedDueDateChargeId, true);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size());
Assertions.assertEquals(1, chargesPendingState.size());
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
@@ -409,12 +408,12 @@ public class SchedulerJobsTestResults {
final Float balance = (Float) summaryBefore.get("accountBalance") - chargeAmount;
Assert.assertEquals("Verifying the Balance after running Pay due Savings Charges", balance,
(Float) summaryAfter.get("accountBalance"));
Assertions.assertEquals(balance, (Float) summaryAfter.get("accountBalance"),
"Verifying the Balance after running Pay due Savings Charges");
}
@Test
@Ignore // TODO FINERACT-857
@Disabled // TODO FINERACT-857
public void testUpdateAccountingRunningBalancesJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
@@ -462,26 +461,25 @@ public class SchedulerJobsTestResults {
final Integer INT_BALANCE = Integer.valueOf(MINIMUM_OPENING_BALANCE);
Assert.assertEquals(
"Verifying Account Running Balance after running Update Accounting Running Balances Scheduler Job",
INT_BALANCE, runningBalanceAfter.get("organizationRunningBalance"));
Assertions.assertEquals(INT_BALANCE, runningBalanceAfter.get("organizationRunningBalance"),
"Verifying Account Running Balance after running Update Accounting Running Balances Scheduler Job");
}
@Test
@Ignore // TODO FINERACT-857
@Disabled // TODO FINERACT-857
public void testUpdateLoanArrearsAgingJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID);
@@ -504,13 +502,13 @@ public class SchedulerJobsTestResults {
Float totalLoanArrearsAging = (Float) loanSummaryData.get("principalOverdue")
+ (Float) loanSummaryData.get("interestOverdue");
Assert.assertEquals("Verifying Arrears Aging after Running Update Loan Arrears Aging Scheduler Job",
totalLoanArrearsAging, loanSummaryData.get("totalOverdue"));
Assertions.assertEquals(totalLoanArrearsAging, loanSummaryData.get("totalOverdue"),
"Verifying Arrears Aging after Running Update Loan Arrears Aging Scheduler Job");
}
@Test
@Ignore // TODO FINERACT-857
@Disabled // TODO FINERACT-857
public void testUpdateLoanPaidInAdvanceJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
@@ -528,13 +526,13 @@ public class SchedulerJobsTestResults {
final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todayDate.getTime());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID);
@@ -569,15 +567,14 @@ public class SchedulerJobsTestResults {
Float totalPaidInAdvance = (Float) loanScheduleAfter.get(1).get("totalPaidInAdvanceForPeriod");
Assert.assertEquals(
"Verifying Loan Repayment in Advance after Running Update Loan Paid in Advance Scheduler Job",
totalDueForCurrentPeriod, totalPaidInAdvance);
Assertions.assertEquals(totalDueForCurrentPeriod, totalPaidInAdvance,
"Verifying Loan Repayment in Advance after Running Update Loan Paid in Advance Scheduler Job");
}
// Invalid test case as it won't affect summary (Loan summary is properly
// updated before running this job)
@Ignore
@Disabled
@Test
public void testUpdateLoanSummaryJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
@@ -596,22 +593,22 @@ public class SchedulerJobsTestResults {
final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
Integer disburseChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanDisbursementJSON());
Assert.assertNotNull(disburseChargeId);
Assertions.assertNotNull(disburseChargeId);
this.loanTransactionHelper.addChargesForLoan(loanID,
LoanTransactionHelper.getDisbursementChargesForLoanAsJSON(disburseChargeId.toString()));
ArrayList<HashMap> chargesPendingState = this.loanTransactionHelper.getLoanCharges(loanID);
Assert.assertEquals(1, chargesPendingState.size());
Assertions.assertEquals(1, chargesPendingState.size());
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID);
@@ -633,13 +630,13 @@ public class SchedulerJobsTestResults {
/* - (Float) loanSummaryBefore.get("feeChargesPaid") */;
HashMap loanSummaryAfter = this.loanTransactionHelper.getLoanSummary(this.requestSpec,
this.responseSpec, loanID);
Assert.assertEquals("Verifying Loan Summary after Running Update Loan Summary Scheduler Job",
expectedSummaryAfterJob, (Float) loanSummaryAfter.get("totalExpectedRepayment"));
Assertions.assertEquals(expectedSummaryAfterJob, (Float) loanSummaryAfter.get("totalExpectedRepayment"),
"Verifying Loan Summary after Running Update Loan Summary Scheduler Job");
}
@Test
@Ignore // TODO FINERACT-857
@Disabled // TODO FINERACT-857
public void testExecuteStandingInstructionsJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
@@ -658,15 +655,15 @@ public class SchedulerJobsTestResults {
final String VALID_TO = dateFormat.format(todaysDate.getTime());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer fromSavingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, fromSavingsId);
@@ -680,7 +677,7 @@ public class SchedulerJobsTestResults {
final Integer toSavingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, toSavingsId);
@@ -701,7 +698,7 @@ public class SchedulerJobsTestResults {
Integer standingInstructionId = this.standingInstructionsHelper.createStandingInstruction(
clientID.toString(), fromSavingsId.toString(), toSavingsId.toString(),
FROM_ACCOUNT_TYPE_SAVINGS, TO_ACCOUNT_TYPE_SAVINGS, VALID_FROM, VALID_TO, MONTH_DAY);
Assert.assertNotNull(standingInstructionId);
Assertions.assertNotNull(standingInstructionId);
String JobName = "Execute Standing Instruction";
this.schedulerJobHelper.executeJob(JobName);
@@ -717,42 +714,42 @@ public class SchedulerJobsTestResults {
- (Float) standingInstructionData.get("amount");
Float expectedToSavingsBalance = toSavingsBalanceBefore + (Float) standingInstructionData.get("amount");
Assert.assertEquals("Verifying From Savings Balance after Successful completion of Scheduler Job",
expectedFromSavingsBalance, fromSavingsBalanceAfter);
Assert.assertEquals("Verifying To Savings Balance after Successful completion of Scheduler Job",
expectedToSavingsBalance, toSavingsBalanceAfter);
Assertions.assertEquals(expectedFromSavingsBalance, fromSavingsBalanceAfter,
"Verifying From Savings Balance after Successful completion of Scheduler Job");
Assertions.assertEquals(expectedToSavingsBalance, toSavingsBalanceAfter,
"Verifying To Savings Balance after Successful completion of Scheduler Job");
Integer fromAccountType = PortfolioAccountType.SAVINGS.getValue();
Integer transferType = AccountTransferType.ACCOUNT_TRANSFER.getValue();
List<HashMap> standinInstructionHistoryData = this.standingInstructionsHelper
.getStandingInstructionHistory(fromSavingsId, fromAccountType, clientID, transferType);
Assert.assertEquals("Verifying the no of stainding instruction transactions logged for the client", 1,
standinInstructionHistoryData.size());
Assertions.assertEquals(1, standinInstructionHistoryData.size(),
"Verifying the no of stainding instruction transactions logged for the client");
HashMap loggedTransaction = standinInstructionHistoryData.get(0);
Assert.assertEquals("Verifying transferred amount and logged transaction amounts",
(Float) standingInstructionData.get("amount"), (Float) loggedTransaction.get("amount"));
Assertions.assertEquals((Float) standingInstructionData.get("amount"), (Float) loggedTransaction.get("amount"),
"Verifying transferred amount and logged transaction amounts");
}
@Test
@Ignore
@Disabled
public void testApplyPenaltyForOverdueLoansJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanOverdueFeeJSON());
Assert.assertNotNull(overdueFeeChargeId);
Assertions.assertNotNull(overdueFeeChargeId);
final Integer loanProductID = createLoanProduct(overdueFeeChargeId.toString());
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID);
@@ -780,9 +777,8 @@ public class SchedulerJobsTestResults {
ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper
.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
Assert.assertEquals(
"Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job",
chargeAmount, (Float) repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"));
Assertions.assertEquals(chargeAmount, (Float) repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"),
"Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job");
loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
@@ -791,24 +787,24 @@ public class SchedulerJobsTestResults {
}
@Test
@Ignore // TODO FINERACT-857
@Disabled // TODO FINERACT-857
public void testAvoidUnncessaryPenaltyWhenAmountZeroForOverdueLoansJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanOverdueFeeJSONWithCalculattionTypePercentage("0.000001"));
Assert.assertNotNull(overdueFeeChargeId);
Assertions.assertNotNull(overdueFeeChargeId);
final Integer loanProductID = createLoanProduct(overdueFeeChargeId.toString());
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID);
@@ -832,11 +828,11 @@ public class SchedulerJobsTestResults {
Map<String, Object> schedulerJob = this.schedulerJobHelper.getSchedulerJobById(jobId);
Assert.assertNotNull(schedulerJob);
Assertions.assertNotNull(schedulerJob);
while ((Boolean) schedulerJob.get("currentlyRunning") == true) {
Thread.sleep(15000);
schedulerJob = this.schedulerJobHelper.getSchedulerJobById(jobId);
Assert.assertNotNull(schedulerJob);
Assertions.assertNotNull(schedulerJob);
}
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec,
@@ -845,14 +841,13 @@ public class SchedulerJobsTestResults {
ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper
.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
Assert.assertEquals(
"Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job",
0, repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"));
Assertions.assertEquals(0, repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"),
"Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job");
final ArrayList loanCharges = this.loanTransactionHelper.getLoanCharges(this.requestSpec,
this.responseSpec, loanID);
Assert.assertNull("Verifying that charge isn't created when the amount is 0", loanCharges);
Assertions.assertNull(loanCharges, "Verifying that charge isn't created when the amount is 0");
loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
@@ -861,19 +856,19 @@ public class SchedulerJobsTestResults {
}
@Test
@Ignore // TODO FINERACT-857
@Disabled // TODO FINERACT-857
public void testUpdateOverdueDaysForNPA() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID);
Assertions.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID);
@@ -889,17 +884,17 @@ public class SchedulerJobsTestResults {
final Boolean isNPABefore = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec,
responseSpec, loanID, "isNPA");
Assert.assertFalse(isNPABefore);
Assertions.assertFalse(isNPABefore);
// Integer jobId = (Integer) allSchedulerJobsData.get(1).get("jobId");
String JobName = "Update Non Performing Assets";
this.schedulerJobHelper.executeJob(JobName);
final Boolean isNPAAfter = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec, responseSpec,
loanID, "isNPA");
Assert.assertTrue(isNPAAfter);
Assertions.assertTrue(isNPAAfter);
}
@Test
@Ignore // TODO FINERACT-857
@Disabled // TODO FINERACT-857
public void testInterestTransferForSavings() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
@@ -928,16 +923,16 @@ public class SchedulerJobsTestResults {
final String WHOLE_TERM = "1";
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE)
+ Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
String.valueOf(balance));
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientId,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId);
@@ -949,15 +944,15 @@ public class SchedulerJobsTestResults {
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO);
Assert.assertNotNull(fixedDepositProductId);
Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(),
fixedDepositProductId.toString(), VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM,
savingsId.toString(), true, fixedDepositAccountHelper);
Assert.assertNotNull(fixedDepositAccountId);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker
.getStatusOfFixedDepositAccount(this.requestSpec, this.responseSpec,
@@ -973,7 +968,7 @@ public class SchedulerJobsTestResults {
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying Balance", balance, summary.get("accountBalance"));
assertEquals(balance, summary.get("accountBalance"), "Verifying Balance");
fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
@@ -984,8 +979,9 @@ public class SchedulerJobsTestResults {
String JobName = "Transfer Interest To Savings";
this.schedulerJobHelper.executeJob(JobName);
fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
assertEquals("Verifying opening Balance", Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT),
fixedDepositSummary.get("accountBalance"));
assertEquals(Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT),
fixedDepositSummary.get("accountBalance"),
"Verifying opening Balance");
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + interestPosted;
@@ -1086,7 +1082,7 @@ public class SchedulerJobsTestResults {
private void validateNumberForEqualExcludePrecission(String val, String val2) {
DecimalFormat twoDForm = new DecimalFormat("#", new DecimalFormatSymbols(Locale.US));
Assert.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(val)))
Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(val)))
.compareTo(Float.valueOf(twoDForm.format(Float.valueOf(val2)))) == 0);
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -28,7 +28,6 @@ import io.restassured.specification.ResponseSpecification;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import junit.framework.Assert;
import org.apache.fineract.integrationtests.common.CalendarHelper;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
@@ -37,9 +36,10 @@ import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,7 +52,7 @@ public class SkipRepaymentOnMonthFirstTest {
private LoanTransactionHelper loanTransactionHelper;
private CalendarHelper calendarHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -61,7 +61,7 @@ public class SkipRepaymentOnMonthFirstTest {
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
}
@After
@AfterEach
public void tearDown() {
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
@@ -74,7 +74,7 @@ public class SkipRepaymentOnMonthFirstTest {
// Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper
.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
Assert.assertNotNull(globalConfig);
Assertions.assertNotNull(globalConfig);
String configName = "skip-repayment-on-first-day-of-month";
boolean newBooleanValue = true;
@@ -84,7 +84,7 @@ public class SkipRepaymentOnMonthFirstTest {
String configId = globalConfig.get(configIndex).get("id").toString();
Integer updateConfigId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(
this.requestSpec, this.responseSpec, configId.toString(), newBooleanValue);
Assert.assertNotNull(updateConfigId);
Assertions.assertNotNull(updateConfigId);
break;
}
}
@@ -155,20 +155,20 @@ public class SkipRepaymentOnMonthFirstTest {
private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
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"));
assertEquals(new ArrayList<>(Arrays.asList(2011, 10, 15)), loanSchedule.get(1).get("dueDate"),
"Checking for Repayment Date for 1st Month");
LOG.info("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"));
assertEquals(new ArrayList<>(Arrays.asList(2011, 11, 15)), loanSchedule.get(2).get("dueDate"),
"Checking for Repayment Date for 2nd Month");
LOG.info("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"));
assertEquals(new ArrayList<>(Arrays.asList(2011, 12, 15)), loanSchedule.get(3).get("dueDate"),
"Checking for Repayment Date for 3rd Month");
LOG.info("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"));
assertEquals(new ArrayList<>(Arrays.asList(2012, 1, 15)), loanSchedule.get(4).get("dueDate"),
"Checking for Repayment Date for 4th Month");
LOG.info("Repayment Date for 4th Month-- {}" , loanSchedule.get(4).get("dueDate"));
}
@@ -18,8 +18,8 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -29,15 +29,15 @@ import io.restassured.specification.ResponseSpecification;
import org.apache.fineract.integrationtests.common.ImageHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class StaffImageApiTest {
private RequestSpecification requestSpec;
private ResponseSpecification responseSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -49,14 +49,14 @@ public class StaffImageApiTest {
public void createStaffImage() {
Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Integer imageId = ImageHelper.createImageForStaff(this.requestSpec, this.responseSpec, staffId);
assertNotNull("Image id should not be null", imageId);
assertNotNull(imageId, "Image id should not be null");
}
@Test
public void getStaffImage(){
Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Integer imageId = ImageHelper.createImageForStaff(this.requestSpec, this.responseSpec, staffId);
assertNotNull("Image id should not be null", imageId);
assertNotNull(imageId, "Image id should not be null");
String imageAsText = ImageHelper.getStaffImageAsText(this.requestSpec, this.responseSpec, staffId);
assertNotNull("Image id should not be null", imageAsText);
assertEquals(ImageHelper.generateImageAsText(), imageAsText);
@@ -66,9 +66,9 @@ public class StaffImageApiTest {
public void getStaffImageAsBinary(){
Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Integer imageId = ImageHelper.createImageForStaff(this.requestSpec, this.responseSpec, staffId);
assertNotNull("Image id should not be null", imageId);
assertNotNull(imageId, "Image id should not be null");
byte[] imageAsBytes = ImageHelper.getStaffImageAsBinary(this.requestSpec, this.responseSpec, staffId);
assertNotNull("Image content should not be null", imageAsBytes);
assertNotNull(imageAsBytes, "Image content should not be null");
assertEquals(251, imageAsBytes.length);
}
@@ -76,17 +76,17 @@ public class StaffImageApiTest {
public void updateImage() {
Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Integer imageId = ImageHelper.createImageForStaff(this.requestSpec, this.responseSpec, staffId);
assertNotNull("Image id should not be null", imageId);
assertNotNull(imageId, "Image id should not be null");
imageId = ImageHelper.updateImageForStaff(this.requestSpec, this.responseSpec, staffId);
assertNotNull("Image id should not be null", imageId);
assertNotNull(imageId, "Image id should not be null");
}
@Test
public void deleteStaffImage() {
Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Integer imageId = ImageHelper.createImageForStaff(this.requestSpec, this.responseSpec, staffId);
assertNotNull("Image id should not be null", imageId);
assertNotNull(imageId, "Image id should not be null");
imageId = ImageHelper.deleteStaffImage(this.requestSpec, this.responseSpec, staffId);
assertNotNull("Image id should not be null", imageId);
assertNotNull(imageId, "Image id should not be null");
}
}
@@ -29,9 +29,9 @@ import java.util.List;
import java.util.Map;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class StaffTest {
@@ -40,7 +40,7 @@ public class StaffTest {
private ResponseSpecification responseSpecForValidationError;
private ResponseSpecification responseSpecForNotFoundError;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -54,9 +54,9 @@ public class StaffTest {
public void testStaffCreate() {
Map<String, Object> response = StaffHelper.createStaffMap(requestSpec, responseSpec);
Assert.assertNotNull(response);
Assert.assertEquals(1, response.get("officeId"));
Assert.assertNotNull(response.get("resourceId"));
Assertions.assertNotNull(response);
Assertions.assertEquals(1, response.get("officeId"));
Assertions.assertNotNull(response.get("resourceId"));
}
@Test
@@ -118,9 +118,9 @@ public class StaffTest {
@Test
public void testStaffFetch() {
Map<String, Object> response = StaffHelper.getStaff(requestSpec, responseSpec, 1);
Assert.assertNotNull(response);
Assert.assertNotNull(response.get("id"));
Assert.assertEquals(1, response.get("id"));
Assertions.assertNotNull(response);
Assertions.assertNotNull(response.get("id"));
Assertions.assertEquals(1, response.get("id"));
}
@Test
@@ -137,8 +137,8 @@ public class StaffTest {
public void testStaffListStatusActive() {
List<Map<String, Object>> responseActive = StaffHelper.getStaffListWithState(requestSpec, responseSpec, "active");
for(final Map<String, Object> staff : responseActive) {
Assert.assertNotNull(staff.get("id"));
Assert.assertEquals(true, staff.get("isActive"));
Assertions.assertNotNull(staff.get("id"));
Assertions.assertEquals(true, staff.get("isActive"));
}
}
@@ -146,14 +146,16 @@ public class StaffTest {
public void testStaffListStatusInactive() {
List<Map<String, Object>> responseInactive = StaffHelper.getStaffListWithState(requestSpec, responseSpec, "inactive");
for(final Map<String, Object> staff : responseInactive) {
Assert.assertNotNull(staff.get("id"));
Assert.assertEquals(false, staff.get("isActive"));
Assertions.assertNotNull(staff.get("id"));
Assertions.assertEquals(false, staff.get("isActive"));
}
}
@Test(expected = ClassCastException.class) // because "xyz" will return an error, not a List
public void testStaffListFetchWrongState() {
StaffHelper.getStaffListWithState(requestSpec, responseSpecForValidationError, "xyz");
@Test // because "xyz" will return an error, not a List
public void testStaffListFetchWrongState() throws ClassCastException {
Assertions.assertThrows(ClassCastException.class, () -> {
StaffHelper.getStaffListWithState(requestSpec, responseSpecForValidationError, "xyz");
});
}
@Test
@@ -178,11 +180,11 @@ public class StaffTest {
@SuppressWarnings("unchecked")
Map<String, Object> changes = (Map<String, Object>) response.get("changes");
Assert.assertEquals(1, response.get("resourceId"));
Assert.assertEquals(firstname, changes.get("firstname"));
Assert.assertEquals(lastname, changes.get("lastname"));
Assert.assertEquals(externalId, changes.get("externalId"));
Assert.assertEquals(mobileNo, changes.get("mobileNo"));
Assertions.assertEquals(1, response.get("resourceId"));
Assertions.assertEquals(firstname, changes.get("firstname"));
Assertions.assertEquals(lastname, changes.get("lastname"));
Assertions.assertEquals(externalId, changes.get("externalId"));
Assertions.assertEquals(mobileNo, changes.get("mobileNo"));
}
@Test
@@ -25,7 +25,7 @@ import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
/**
* Client Loan Integration Test for checking Loan Application Repayment
@@ -38,7 +38,7 @@ public class SurveyIntegrationTest {
private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,8 +18,8 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -32,10 +32,10 @@ import java.util.List;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.system.CodeHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Test for creating, updating, deleting codes and code values
@@ -48,7 +48,7 @@ public class SystemCodeTest {
private ResponseSpecification generalResponseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -72,32 +72,32 @@ public class SystemCodeTest {
final HashMap newCodeAttributes = (HashMap) CodeHelper.getCodeById(this.requestSpec, this.responseSpec, createResponseId, "");
Assert.assertNotNull(newCodeAttributes);
assertEquals("Verify value of codeId", createResponseId, newCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
Assertions.assertNotNull(newCodeAttributes);
assertEquals(createResponseId, newCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME), "Verify value of codeId");
assertEquals("Verify code name", codeName, newCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
assertEquals("Verify system defined is false", false, newCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
assertEquals(codeName, newCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME), "Verify code name");
assertEquals(false, newCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME), "Verify system defined is false");
// update code
final HashMap updateChangeResponse = (HashMap) CodeHelper.updateCode(this.requestSpec, this.responseSpec, createResponseId,
codeName + "(CHANGE)", "changes");
assertEquals("Verify code name updated", codeName + "(CHANGE)", updateChangeResponse.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
assertEquals(codeName + "(CHANGE)", updateChangeResponse.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME), "Verify code name updated");
// delete code
final Integer deleteResponseId = (Integer) CodeHelper.deleteCodeById(this.requestSpec, this.responseSpec, createResponseId,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
assertEquals("Verify code deleted", createResponseId, deleteResponseId);
assertEquals(createResponseId, deleteResponseId, "Verify code deleted");
// verify code deleted
final HashMap deletedCodeValues = (HashMap) CodeHelper
.getCodeById(this.requestSpec, this.generalResponseSpec, deleteResponseId, "");
Assert.assertNotNull(deletedCodeValues);
assertNull("Verify value of codeId", deletedCodeValues.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
Assertions.assertNotNull(deletedCodeValues);
assertNull(deletedCodeValues.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME), "Verify value of codeId");
assertNull("Verify code name", deletedCodeValues.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
assertNull("Verify system defined is false", deletedCodeValues.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
assertNull(deletedCodeValues.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME), "Verify code name");
assertNull(deletedCodeValues.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME), "Verify system defined is false");
}
// @Ignore()
@@ -113,33 +113,33 @@ public class SystemCodeTest {
// verify code created
final HashMap newCodeAttributes = (HashMap) CodeHelper.getCodeById(this.requestSpec, this.responseSpec, createResponseId, "");
Assert.assertNotNull(newCodeAttributes);
assertEquals("Verify value of codeId", createResponseId, newCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
Assertions.assertNotNull(newCodeAttributes);
assertEquals(createResponseId, newCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME), "Verify value of codeId");
assertEquals("Verify code name", codeName, newCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
assertEquals("Verify system defined is false", false, newCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
assertEquals(codeName, newCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME), "Verify code name");
assertEquals(false, newCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME), "Verify system defined is false");
// try to create duplicate-- should fail
final List<HashMap> error = (List) CodeHelper.createCode(this.requestSpec, this.generalResponseSpec, codeName,
CommonConstants.RESPONSE_ERROR);
assertEquals("Verify duplication error", "error.msg.code.duplicate.name", error.get(0).get("userMessageGlobalisationCode"));
assertEquals("error.msg.code.duplicate.name", error.get(0).get("userMessageGlobalisationCode"), "Verify duplication error");
// delete code that was just created
final Integer deleteResponseId = (Integer) CodeHelper.deleteCodeById(this.requestSpec, this.responseSpec, createResponseId,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
assertEquals("Verify code deleted", createResponseId, deleteResponseId);
assertEquals(createResponseId, deleteResponseId, "Verify code deleted");
// verify code deleted
final HashMap deletedCodeAttributes = (HashMap) CodeHelper.getCodeById(this.requestSpec, this.generalResponseSpec,
deleteResponseId, "");
Assert.assertNotNull(deletedCodeAttributes);
assertNull("Verify value of codeId", deletedCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME));
Assertions.assertNotNull(deletedCodeAttributes);
assertNull(deletedCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME), "Verify value of codeId");
assertNull("Verify code name", deletedCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME));
assertNull("Verify system defined is false", deletedCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME));
assertNull(deletedCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME), "Verify code name");
assertNull(deletedCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME), "Verify system defined is false");
}
@@ -154,7 +154,7 @@ public class SystemCodeTest {
final List<HashMap> error = (List) CodeHelper.deleteCodeById(this.requestSpec, this.generalResponseSpec,
(Integer) systemDefinedCode.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME), CommonConstants.RESPONSE_ERROR);
assertEquals("Cannot delete system-defined code", "error.msg.code.systemdefined", error.get(0).get("userMessageGlobalisationCode"));
assertEquals("error.msg.code.systemdefined", error.get(0).get("userMessageGlobalisationCode"), "Cannot delete system-defined code");
// update system-defined code should fail
@@ -162,8 +162,8 @@ public class SystemCodeTest {
(Integer) systemDefinedCode.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME),
systemDefinedCode.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME) + "CHANGE", CommonConstants.RESPONSE_ERROR);
assertEquals("Cannot update system-defined code", "error.msg.code.systemdefined",
updateError.get(0).get("userMessageGlobalisationCode"));
assertEquals("error.msg.code.systemdefined", updateError.get(0).get("userMessageGlobalisationCode"),
"Cannot update system-defined code");
}
@@ -199,47 +199,48 @@ public class SystemCodeTest {
final List<HashMap> codeValuesList = (List) CodeHelper.getCodeValuesForCode(this.requestSpec, this.responseSpec,
createCodeResponseId, "");
assertEquals("Number of code values returned matches number created", 2, codeValuesList.size());
assertEquals(2, codeValuesList.size(), "Number of code values returned matches number created");
// verify values of first code value
final HashMap codeValuesAttributes1 = (HashMap) CodeHelper.getCodeValueById(this.requestSpec, this.responseSpec,
createCodeResponseId, createCodeValueResponseId1, "");
Assert.assertNotNull(codeValuesAttributes1);
assertEquals("Verify value of codeValueId", createCodeValueResponseId1,
codeValuesAttributes1.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME));
Assertions.assertNotNull(codeValuesAttributes1);
assertEquals(createCodeValueResponseId1,
codeValuesAttributes1.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME), "Verify value of codeValueId");
assertEquals("Verify value of code name", codeValue1, codeValuesAttributes1.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME));
assertEquals(codeValue1, codeValuesAttributes1.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME),
"Verify value of code name");
assertEquals("Verify value of code description", codeDescription1,
codeValuesAttributes1.get(CodeHelper.CODE_VALUE_DESCRIPTION_ATTRIBUTE_NAME));
assertEquals(codeDescription1, codeValuesAttributes1.get(CodeHelper.CODE_VALUE_DESCRIPTION_ATTRIBUTE_NAME),
"Verify value of code description");
assertEquals("Verify position of code value", codeValue1Position,
codeValuesAttributes1.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME));
assertEquals(codeValue1Position, codeValuesAttributes1.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME),
"Verify position of code value");
// verify values of second code value
final HashMap codeValuesAttributes2 = (HashMap) CodeHelper.getCodeValueById(this.requestSpec, this.responseSpec,
createCodeResponseId, createCodeValueResponseId2, "");
Assert.assertNotNull(codeValuesAttributes2);
assertEquals("Verify value of codeValueId", createCodeValueResponseId2,
codeValuesAttributes2.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME));
Assertions.assertNotNull(codeValuesAttributes2);
assertEquals(createCodeValueResponseId2, codeValuesAttributes2.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME),
"Verify value of codeValueId");
assertEquals("Verify value of code name", codeValue2, codeValuesAttributes2.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME));
assertEquals(codeValue2, codeValuesAttributes2.get(CodeHelper.CODE_VALUE_NAME_ATTRIBUTE_NAME), "Verify value of code name");
assertEquals("Verify value of code description", codeDescription2,
codeValuesAttributes2.get(CodeHelper.CODE_VALUE_DESCRIPTION_ATTRIBUTE_NAME));
assertEquals(codeDescription2, codeValuesAttributes2.get(CodeHelper.CODE_VALUE_DESCRIPTION_ATTRIBUTE_NAME),
"Verify value of code description");
assertEquals("Verify position of code value", codeValue2Position,
codeValuesAttributes2.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME));
assertEquals(codeValue2Position, codeValuesAttributes2.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME),
"Verify position of code value");
// update code value 1
final HashMap codeValueChanges = (HashMap) CodeHelper.updateCodeValue(this.requestSpec, this.responseSpec, createCodeResponseId,
createCodeValueResponseId1, codeValue1 + "CHANGE", codeDescription1 + "CHANGE", 4, "changes");
assertEquals("Verify changed code value name", codeValue1 + "CHANGE", codeValueChanges.get("name"));
assertEquals(codeValue1 + "CHANGE", codeValueChanges.get("name"), "Verify changed code value name");
assertEquals("Verify changed code value description", codeDescription1 + "CHANGE", codeValueChanges.get("description"));
assertEquals(codeDescription1 + "CHANGE", codeValueChanges.get("description"), "Verify changed code value description");
// delete code value
Integer deletedCodeValueResponseId1 = (Integer) CodeHelper.deleteCodeValueById(this.requestSpec, this.generalResponseSpec,
@@ -255,7 +256,7 @@ public class SystemCodeTest {
final List<HashMap> deletedCodeValuesList = (List) CodeHelper.getCodeValuesForCode(this.requestSpec, this.responseSpec,
createCodeResponseId, "");
assertEquals("Number of code values is 1", 1, deletedCodeValuesList.size());
assertEquals(1, deletedCodeValuesList.size(), "Number of code values is 1");
final Integer deletedCodeValueResponseId2 = (Integer) CodeHelper.deleteCodeValueById(this.requestSpec, this.generalResponseSpec,
createCodeResponseId, createCodeValueResponseId2, CodeHelper.SUBRESPONSE_ID_ATTRIBUTE_NAME);
@@ -263,16 +264,16 @@ public class SystemCodeTest {
final ArrayList<HashMap> deletedCodeValueAttributes2 = (ArrayList<HashMap>) CodeHelper.getCodeValueById(this.requestSpec,
this.generalResponseSpec, createCodeResponseId, deletedCodeValueResponseId2, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.codevalue.id.invalid", deletedCodeValueAttributes2.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
assertEquals(deletedCodeValueAttributes2.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE), "error.msg.codevalue.id.invalid");
final List<HashMap> deletedCodeValuesList1 = (List) CodeHelper.getCodeValuesForCode(this.requestSpec, this.responseSpec,
createCodeResponseId, "");
assertEquals("Number of code values is 0", 0, deletedCodeValuesList1.size());
assertEquals(0, deletedCodeValuesList1.size(), "Number of code values is 0");
}
@Ignore
@Disabled
@Test
public void testCodeValuesAssignedToTable() {
@@ -27,10 +27,10 @@ import io.restassured.specification.ResponseSpecification;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
public class TemplateIntegrationTest {
@@ -41,7 +41,7 @@ public class TemplateIntegrationTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
@@ -50,7 +50,7 @@ public class TemplateIntegrationTest {
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
}
@Ignore
@Disabled
@Test
public void test() {
@@ -70,13 +70,13 @@ public class TemplateIntegrationTest {
final String getrequest2 = Utils.performServerGet(this.requestSpec, this.responseSpec, templateUrlForId, this.RESPONSE_ATTRIBUTE_NAME);
Assert.assertTrue(getrequest2.equals("foo"));
Assertions.assertTrue(getrequest2.equals("foo"));
Utils.performServerDelete(this.requestSpec, this.responseSpec, templateUrlForId, "");
get = Utils.performServerGet(this.requestSpec, this.responseSpec, this.GET_TEMPLATES_URL, "");
final int entriesAfterTest = get.size();
Assert.assertEquals(entriesBeforeTest, entriesAfterTest);
Assertions.assertEquals(entriesBeforeTest, entriesAfterTest);
}
}
@@ -32,10 +32,10 @@ import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.apache.fineract.integrationtests.useradministration.roles.RolesHelper;
import org.apache.fineract.integrationtests.useradministration.users.UserHelper;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,7 +49,7 @@ public class UserAdministrationTest {
return new ResponseSpecBuilder().expectStatusCode(code).build();
}
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -57,7 +57,7 @@ public class UserAdministrationTest {
this.responseSpec = expectStatusCode(200);
}
@After
@AfterEach
public void tearDown() {
for(Integer userId : this.transientUsers) {
UserHelper.deleteUser(this.requestSpec, this.responseSpec, userId);
@@ -69,81 +69,81 @@ public class UserAdministrationTest {
public void testCreateNewUserBlocksDuplicateUsername() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId);
Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Assert.assertNotNull(staffId);
Assertions.assertNotNull(staffId);
final Integer userId = (Integer) UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId, "alphabet", "resourceId");
Assert.assertNotNull(userId);
Assertions.assertNotNull(userId);
this.transientUsers.add(userId);
final List errors = (List) UserHelper.createUser(this.requestSpec, expectStatusCode(403), roleId, staffId, "alphabet", "errors");
Map reason = (Map) errors.get(0);
LOG.info("Reason: {}" , reason.get("defaultUserMessage"));
LOG.info("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"));
Assertions.assertEquals("User with username alphabet already exists.", reason.get("defaultUserMessage"));
Assertions.assertEquals("error.msg.user.duplicate.username", reason.get("userMessageGlobalisationCode"));
}
@Test
public void testUpdateUserAcceptsNewOrSameUsername() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId);
Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Assert.assertNotNull(staffId);
Assertions.assertNotNull(staffId);
final Integer userId = (Integer) UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId, "alphabet", "resourceId");
Assert.assertNotNull(userId);
Assertions.assertNotNull(userId);
this.transientUsers.add(userId);
final Integer userId2 = (Integer) UserHelper.updateUser(this.requestSpec, this.responseSpec, userId, "renegade", "resourceId");
Assert.assertNotNull(userId2);
Assertions.assertNotNull(userId2);
final Integer userId3 = (Integer) UserHelper.updateUser(this.requestSpec, this.responseSpec, userId, "renegade", "resourceId");
Assert.assertNotNull(userId3);
Assertions.assertNotNull(userId3);
}
@Test
public void testUpdateUserBlockDuplicateUsername() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId);
Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Assert.assertNotNull(staffId);
Assertions.assertNotNull(staffId);
final Integer userId = (Integer) UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId, "alphabet", "resourceId");
Assert.assertNotNull(userId);
Assertions.assertNotNull(userId);
this.transientUsers.add(userId);
final Integer userId2 = (Integer) UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId, "bilingual", "resourceId");
Assert.assertNotNull(userId2);
Assertions.assertNotNull(userId2);
this.transientUsers.add(userId2);
final List errors = (List) UserHelper.updateUser(this.requestSpec, expectStatusCode(403), userId2, "alphabet", "errors");
Map reason = (Map) errors.get(0);
Assert.assertEquals("User with username alphabet already exists.", reason.get("defaultUserMessage"));
Assert.assertEquals("error.msg.user.duplicate.username", reason.get("userMessageGlobalisationCode"));
Assertions.assertEquals("User with username alphabet already exists.", reason.get("defaultUserMessage"));
Assertions.assertEquals("error.msg.user.duplicate.username", reason.get("userMessageGlobalisationCode"));
}
@Test
public void testCreateNewUserBlocksDuplicateClientId() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId);
Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Assert.assertNotNull(staffId);
Assertions.assertNotNull(staffId);
final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
final Integer userId = (Integer) UserHelper.createUserForSelfService(this.requestSpec, this.responseSpec, roleId, staffId, clientId, "resourceId");
Assert.assertNotNull(userId);
Assertions.assertNotNull(userId);
this.transientUsers.add(userId);
final List errors = (List) UserHelper.createUserForSelfService(this.requestSpec, expectStatusCode(403), roleId, staffId, clientId, "errors");
Map reason = (Map) errors.get(0);
Assert.assertEquals("Self Service User Id is already created. Go to Admin->Users to edit or delete the self-service user.", reason.get("defaultUserMessage"));
Assertions.assertEquals("Self Service User Id is already created. Go to Admin->Users to edit or delete the self-service user.", reason.get("defaultUserMessage"));
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -30,9 +30,9 @@ import java.util.List;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.WorkingDaysHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@SuppressWarnings({ "rawtypes", "unchecked" })
public class WorkingDaysTest {
@@ -41,7 +41,7 @@ public class WorkingDaysTest {
private RequestSpecification requestSpec;
private ResponseSpecification generalResponseSpec;
@Before
@BeforeEach
public void setUp() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -54,15 +54,15 @@ public class WorkingDaysTest {
@Test
public void updateWorkingDays() {
HashMap response = (HashMap) WorkingDaysHelper.updateWorkingDays(requestSpec, responseSpec);
Assert.assertNotNull(response.get("resourceId"));
Assertions.assertNotNull(response.get("resourceId"));
}
@Test
public void updateWorkingDaysWithWrongRecurrencePattern() {
final List<HashMap> error = (List) WorkingDaysHelper.updateWorkingDaysWithWrongRecurrence(requestSpec, generalResponseSpec,
CommonConstants.RESPONSE_ERROR);
assertEquals("Verify wrong recurrence pattern error", "error.msg.recurring.rule.parsing.error",
error.get(0).get("userMessageGlobalisationCode"));
assertEquals("error.msg.recurring.rule.parsing.error", error.get(0).get("userMessageGlobalisationCode"),
"Verify wrong recurrence pattern error");
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -29,8 +29,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.xbrl.XBRLIntegrationTestHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -42,7 +42,7 @@ public class XBRLIntegrationTest {
private XBRLIntegrationTestHelper xbrlHelper;
@Before
@BeforeEach
public void setUp() throws Exception {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -60,7 +60,7 @@ public class XBRLIntegrationTest {
private void verifyTaxonomyList(final ArrayList<HashMap> taxonomyList) {
LOG.info("--------------------VERIFYING TAXONOMY LIST--------------------------");
assertEquals("Checking for the 1st taxonomy", "AdministrativeExpense", taxonomyList.get(0).get("name"));
assertEquals("AdministrativeExpense", taxonomyList.get(0).get("name"), "Checking for the 1st taxonomy");
}
}
@@ -45,9 +45,9 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -57,7 +57,7 @@ public class ClientEntityImportHandlerTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -71,12 +71,12 @@ public class ClientEntityImportHandlerTest {
//in order to populate helper sheets
requestSpec.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
Integer outcome_staff_creation = StaffHelper.createStaff(requestSpec,responseSpec);
Assert.assertNotNull("Could not create staff",outcome_staff_creation);
Assertions.assertNotNull(outcome_staff_creation, "Could not create staff");
//in order to populate helper sheets
OfficeHelper officeHelper = new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000");
Assert.assertNotNull("Could not create office" ,outcome_office_creation);
Assertions.assertNotNull(outcome_office_creation, "Could not create office");
//in order to populate helper columns in client entity sheet
//create constitution
@@ -131,7 +131,7 @@ public class ClientEntityImportHandlerTest {
String importDocumentId=clientHelper.importClientEntityTemplate(file);
file.delete();
Assert.assertNotNull(importDocumentId);
Assertions.assertNotNull(importDocumentId);
//Wait for the creation of output excel
Thread.sleep(10000);
@@ -146,7 +146,7 @@ public class ClientEntityImportHandlerTest {
LOG.info("Output location: {}", location);
LOG.info("Failure reason column: {}", row.getCell(ClientEntityConstants.STATUS_COL).getStringCellValue());
Assert.assertEquals("Imported",row.getCell(ClientEntityConstants.STATUS_COL).getStringCellValue());
Assertions.assertEquals("Imported",row.getCell(ClientEntityConstants.STATUS_COL).getStringCellValue());
outputWorkbook.close();
}
}
@@ -53,9 +53,9 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -68,7 +68,7 @@ public class LoanImportHandlerTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -83,10 +83,10 @@ public class LoanImportHandlerTest {
//in order to populate helper sheets
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000");
Assert.assertNotNull("Could not create office" ,outcome_office_creation);
Assertions.assertNotNull(outcome_office_creation, "Could not create office");
OfficeDomain office = officeHelper.retrieveOfficeByID(outcome_office_creation);
Assert.assertNotNull("Could not retrieve created office", office);
Assertions.assertNotNull(office, "Could not retrieve created office");
String firstName = Utils.randomNameGenerator("Client_FirstName_", 5);
String lastName = Utils.randomNameGenerator("Client_LastName_", 4);
@@ -104,38 +104,38 @@ public class LoanImportHandlerTest {
Integer outcome_client_creation= Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL,
new Gson().toJson(clientMap), "clientId");
Assert.assertNotNull("Could not create client" ,outcome_client_creation);
Assertions.assertNotNull(outcome_client_creation, "Could not create client");
//in order to populate helper sheets
Integer outcome_group_creation = GroupHelper.createGroup(requestSpec,responseSpec,true);
Assert.assertNotNull("Could not create group" ,outcome_group_creation);
Assertions.assertNotNull(outcome_group_creation, "Could not create group");
//in order to populate helper sheets
Integer outcome_staff_creation = StaffHelper.createStaff(requestSpec,responseSpec);
Assert.assertNotNull("Could not create staff",outcome_staff_creation);
Assertions.assertNotNull(outcome_staff_creation, "Could not create staff");
Map<String, Object> staffMap = StaffHelper.getStaff(requestSpec, responseSpec, outcome_staff_creation);
Assert.assertNotNull("Could not retrieve created staff", staffMap);
Assertions.assertNotNull(staffMap, "Could not retrieve created staff");
LoanTransactionHelper ltHelper=new LoanTransactionHelper(requestSpec,responseSpec);
LoanProductTestBuilder loanProductTestBuilder=new LoanProductTestBuilder();
String jsonLoanProduct=loanProductTestBuilder.build(null);
Integer outcome_lp_creation=ltHelper.getLoanProductId(jsonLoanProduct);
Assert.assertNotNull("Could not create Loan Product" ,outcome_lp_creation);
Assertions.assertNotNull(outcome_lp_creation, "Could not create Loan Product");
String loanProductStr = ltHelper.getLoanProductDetails(requestSpec, responseSpec, outcome_lp_creation);
Assert.assertNotNull("Could not get created Loan Product" , loanProductStr);
Assertions.assertNotNull("Could not get created Loan Product" , loanProductStr);
JsonPath loanProductJson = JsonPath.from(loanProductStr);
String fundName = Utils.randomNameGenerator("",9);
FundsHelper fh = FundsHelper.create(fundName).externalId("fund-" + fundName).build();
Integer outcome_fund_creation= FundsResourceHandler.createFund(new Gson().toJson(fh),requestSpec,responseSpec);
Assert.assertNotNull("Could not create Fund" ,outcome_fund_creation);
Assertions.assertNotNull(outcome_fund_creation, "Could not create Fund");
String paymentTypeName = PaymentTypeHelper.randomNameGenerator("P_T", 5);
String paymentTypeDescription = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15);
Integer outcome_payment_creation= PaymentTypeHelper.createPaymentType(requestSpec, responseSpec, paymentTypeName, paymentTypeDescription, true,1);
Assert.assertNotNull("Could not create payment type" ,outcome_payment_creation);
Assertions.assertNotNull(outcome_payment_creation, "Could not create payment type");
LoanTransactionHelper loanTransactionHelper=new LoanTransactionHelper(requestSpec,responseSpec);
Workbook workbook=loanTransactionHelper.getLoanWorkbook("dd MMMM yyyy");
@@ -190,7 +190,7 @@ public class LoanImportHandlerTest {
String importDocumentId=loanTransactionHelper.importLoanTemplate(file);
file.delete();
Assert.assertNotNull(importDocumentId);
Assertions.assertNotNull(importDocumentId);
//Wait for the creation of output excel
Thread.sleep(10000);
@@ -205,7 +205,7 @@ public class LoanImportHandlerTest {
LOG.info("Output location: {}", location);
LOG.info("Failure reason column: {}", row.getCell(LoanConstants.FAILURE_REPORT_COL).getStringCellValue());
Assert.assertEquals("Imported",row.getCell(LoanConstants.STATUS_COL).getStringCellValue());
Assertions.assertEquals("Imported",row.getCell(LoanConstants.STATUS_COL).getStringCellValue());
outputworkbook.close();
}
}
@@ -38,9 +38,9 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -51,7 +51,7 @@ public class OfficeImportHandlerTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup(){
Utils.initializeRESTAssured();
this.requestSpec=new RequestSpecBuilder().build();
@@ -91,7 +91,7 @@ public class OfficeImportHandlerTest {
String importDocumentId=officeHelper.importOfficeTemplate(file);
file.delete();
Assert.assertNotNull(importDocumentId);
Assertions.assertNotNull(importDocumentId);
// Wait for the creation of output excel
Thread.sleep(10000);
@@ -106,7 +106,7 @@ public class OfficeImportHandlerTest {
LOG.info("Output location: {}", location);
LOG.info("Failure reason column: {}", row.getCell(OfficeConstants.STATUS_COL).getStringCellValue());
Assert.assertEquals("Imported",row.getCell(OfficeConstants.STATUS_COL).getStringCellValue());
Assertions.assertEquals("Imported", row.getCell(OfficeConstants.STATUS_COL).getStringCellValue());
outputWorkbook.close();
}
}
@@ -49,9 +49,9 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -65,7 +65,7 @@ public class SavingsImportHandlerTest {
private static final String CREATE_CLIENT_URL = "/fineract-provider/api/v1/clients?" + Utils.TENANT_IDENTIFIER;
public static final String DATE_FORMAT = "dd MMMM yyyy";
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -80,10 +80,10 @@ public class SavingsImportHandlerTest {
//in order to populate helper sheets
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000");
Assert.assertNotNull("Could not create office" ,outcome_office_creation);
Assertions.assertNotNull(outcome_office_creation, "Could not create office");
OfficeDomain office = officeHelper.retrieveOfficeByID(outcome_office_creation);
Assert.assertNotNull("Could not retrieve created office", office);
Assertions.assertNotNull(office, "Could not retrieve created office");
String firstName = Utils.randomNameGenerator("Client_FirstName_", 5);
String lastName = Utils.randomNameGenerator("Client_LastName_", 4);
@@ -101,23 +101,23 @@ public class SavingsImportHandlerTest {
Integer outcome_client_creation= Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL,
new Gson().toJson(clientMap), "clientId");
Assert.assertNotNull("Could not create client" ,outcome_client_creation);
Assertions.assertNotNull(outcome_client_creation, "Could not create client");
//in order to populate helper sheets
Integer outcome_group_creation=GroupHelper.createGroup(requestSpec,responseSpec,true);
Assert.assertNotNull("Could not create group" ,outcome_group_creation);
Assertions.assertNotNull(outcome_group_creation, "Could not create group");
//in order to populate helper sheets
Integer outcome_staff_creation =StaffHelper.createStaff(requestSpec,responseSpec);
Assert.assertNotNull("Could not create staff",outcome_staff_creation);
Assertions.assertNotNull(outcome_staff_creation, "Could not create staff");
Map<String, Object> staffMap = StaffHelper.getStaff(requestSpec, responseSpec, outcome_staff_creation);
Assert.assertNotNull("Could not retrieve created staff", staffMap);
Assertions.assertNotNull(staffMap, "Could not retrieve created staff");
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
String jsonSavingsProduct=savingsProductHelper.build();
Integer outcome_sp_creaction=SavingsProductHelper.createSavingsProduct(jsonSavingsProduct,requestSpec,responseSpec);
Assert.assertNotNull("Could not create Savings product",outcome_sp_creaction);
Assertions.assertNotNull(outcome_sp_creaction, "Could not create Savings product");
SavingsAccountHelper savingsAccountHelper=new SavingsAccountHelper(requestSpec,responseSpec);
Workbook workbook=savingsAccountHelper.getSavingsWorkbook("dd MMMM yyyy");
@@ -164,7 +164,7 @@ public class SavingsImportHandlerTest {
String importDocumentId=savingsAccountHelper.importSavingsTemplate(file);
file.delete();
Assert.assertNotNull(importDocumentId);
Assertions.assertNotNull(importDocumentId);
//Wait for the creation of output excel
Thread.sleep(10000);
@@ -179,7 +179,7 @@ public class SavingsImportHandlerTest {
LOG.info("Output location: {}", location);
LOG.info("Failure reason column: {}", row.getCell(SavingsConstants.STATUS_COL).getStringCellValue());
Assert.assertEquals("Imported",row.getCell(SavingsConstants.STATUS_COL).getStringCellValue());
Assertions.assertEquals("Imported",row.getCell(SavingsConstants.STATUS_COL).getStringCellValue());
Outputworkbook.close();
}
}
@@ -34,16 +34,16 @@ import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class ClientEntityWorkbookPopulatorTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup(){
Utils.initializeRESTAssured();
this.requestSpec=new RequestSpecBuilder().build();
@@ -63,20 +63,20 @@ public class ClientEntityWorkbookPopulatorTest {
StaffHelper staffHelper=new StaffHelper();
requestSpec.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
Integer outcome_staff_creation =staffHelper.createStaff(requestSpec,responseSpec);
Assert.assertNotNull("Could not create staff",outcome_staff_creation);
Assertions.assertNotNull(outcome_staff_creation, "Could not create staff");
//in order to populate helper sheets
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000");
Assert.assertNotNull("Could not create office" ,outcome_office_creation);
Assertions.assertNotNull(outcome_office_creation, "Could not create office");
ClientHelper clientHelper=new ClientHelper(requestSpec,responseSpec);
Workbook workbook=clientHelper.getClientEntityWorkbook(GlobalEntityType.CLIENTS_ENTTTY,"dd MMMM yyyy");
Sheet officeSheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
Row firstOfficeRow=officeSheet.getRow(1);
Assert.assertNotNull("No offices found for given OfficeId ",firstOfficeRow.getCell(1));
Assertions.assertNotNull(firstOfficeRow.getCell(1), "No offices found for given OfficeId ");
Sheet staffSheet=workbook.getSheet(TemplatePopulateImportConstants.STAFF_SHEET_NAME);
Row firstStaffRow=staffSheet.getRow(1);
Assert.assertNotNull("No staff found for given staffId",firstStaffRow.getCell(1));
Assertions.assertNotNull(firstStaffRow.getCell(1), "No staff found for given staffId");
}
}
@@ -39,16 +39,16 @@ import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class LoanWorkbookPopulatorTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup(){
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -61,35 +61,35 @@ public class LoanWorkbookPopulatorTest {
//in order to populate helper sheets
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000");
Assert.assertNotNull("Could not create office" ,outcome_office_creation);
Assertions.assertNotNull(outcome_office_creation, "Could not create office");
//in order to populate helper sheets
ClientHelper clientHelper=new ClientHelper(requestSpec,responseSpec);
Integer outcome_client_creation=clientHelper.createClient(requestSpec,responseSpec);
Assert.assertNotNull("Could not create client" ,outcome_client_creation);
Assertions.assertNotNull(outcome_client_creation, "Could not create client");
//in order to populate helper sheets
GroupHelper groupHelper=new GroupHelper(requestSpec,responseSpec);
Integer outcome_group_creation=groupHelper.createGroup(requestSpec,responseSpec,true);
Assert.assertNotNull("Could not create group" ,outcome_group_creation);
Assertions.assertNotNull(outcome_group_creation, "Could not create group");
//in order to populate helper sheets
StaffHelper staffHelper=new StaffHelper();
Integer outcome_staff_creation =staffHelper.createStaff(requestSpec,responseSpec);
Assert.assertNotNull("Could not create staff",outcome_staff_creation);
Assertions.assertNotNull(outcome_staff_creation, "Could not create staff");
LoanTransactionHelper loanTransactionHelper=new LoanTransactionHelper(requestSpec,responseSpec);
LoanProductTestBuilder loanProductTestBuilder=new LoanProductTestBuilder();
String jsonLoanProduct=loanProductTestBuilder.build(null);
Integer outcome_lp_creaion=loanTransactionHelper.getLoanProductId(jsonLoanProduct);
Assert.assertNotNull("Could not create Loan Product" ,outcome_lp_creaion);
Assertions.assertNotNull(outcome_lp_creaion, "Could not create Loan Product");
FundsResourceHandler fundsResourceHandler=new FundsResourceHandler();
String jsonFund="{\n" +
"\t\"name\": \""+Utils.randomNameGenerator("Fund_Name",9)+"\"\n" +
"}";
Integer outcome_fund_creation=fundsResourceHandler.createFund(jsonFund,requestSpec,responseSpec);
Assert.assertNotNull("Could not create Fund" ,outcome_fund_creation);
Assertions.assertNotNull(outcome_fund_creation, "Could not create Fund");
PaymentTypeHelper paymentTypeHelper=new PaymentTypeHelper();
String name = PaymentTypeHelper.randomNameGenerator("P_T", 5);
@@ -97,32 +97,32 @@ public class LoanWorkbookPopulatorTest {
Boolean isCashPayment = true;
Integer position = 1;
Integer outcome_payment_creation= paymentTypeHelper.createPaymentType(requestSpec, responseSpec,name,description,isCashPayment,position);
Assert.assertNotNull("Could not create payment type" ,outcome_payment_creation);
Assertions.assertNotNull(outcome_payment_creation, "Could not create payment type");
Workbook workbook=loanTransactionHelper.getLoanWorkbook("dd MMMM yyyy");
Sheet officeSheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
Row firstOfficeRow=officeSheet.getRow(1);
Assert.assertNotNull("No offices found ",firstOfficeRow.getCell(1));
Assertions.assertNotNull(firstOfficeRow.getCell(1), "No offices found ");
Sheet clientSheet=workbook.getSheet(TemplatePopulateImportConstants.CLIENT_SHEET_NAME);
Row firstClientRow=clientSheet.getRow(1);
Assert.assertNotNull("No clients found ",firstClientRow.getCell(1));
Assertions.assertNotNull(firstClientRow.getCell(1), "No clients found ");
Sheet groupSheet=workbook.getSheet(TemplatePopulateImportConstants.GROUP_SHEET_NAME);
Row firstGroupRow=groupSheet.getRow(1);
Assert.assertNotNull("No groups found ",firstGroupRow.getCell(1));
Assertions.assertNotNull(firstGroupRow.getCell(1), "No groups found ");
Sheet staffSheet=workbook.getSheet(TemplatePopulateImportConstants.STAFF_SHEET_NAME);
Row firstStaffRow=staffSheet.getRow(1);
Assert.assertNotNull("No staff found ",firstStaffRow.getCell(1));
Assertions.assertNotNull(firstStaffRow.getCell(1), "No staff found ");
Sheet productSheet=workbook.getSheet(TemplatePopulateImportConstants.PRODUCT_SHEET_NAME);
Row firstProductRow=productSheet.getRow(1);
Assert.assertNotNull("No products found ",firstProductRow.getCell(1));
Assertions.assertNotNull(firstProductRow.getCell(1), "No products found ");
Sheet extrasSheet=workbook.getSheet(TemplatePopulateImportConstants.EXTRAS_SHEET_NAME);
Row firstExtrasRow=extrasSheet.getRow(1);
Assert.assertNotNull("No Extras found ",firstExtrasRow.getCell(1));
Assertions.assertNotNull(firstExtrasRow.getCell(1), "No Extras found ");
}
}
@@ -30,15 +30,15 @@ import org.apache.fineract.integrationtests.common.Utils;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class OfficeWorkBookPopulatorTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup(){
Utils.initializeRESTAssured();
this.requestSpec=new RequestSpecBuilder().build();
@@ -56,8 +56,8 @@ public class OfficeWorkBookPopulatorTest {
Workbook workbook=officeHelper.getOfficeWorkBook("dd MMMM yyyy");
Sheet sheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
Row firstRow= sheet.getRow(1);
Assert.assertNotNull("No parent offices found",firstRow.getCell(OfficeConstants.LOOKUP_OFFICE_COL).getStringCellValue());
Assert.assertEquals(1,firstRow.getCell(OfficeConstants.LOOKUP_OFFICE_ID_COL).getNumericCellValue(),0.0);
Assertions.assertNotNull("No parent offices found", firstRow.getCell(OfficeConstants.LOOKUP_OFFICE_COL).getStringCellValue());
Assertions.assertEquals(1, firstRow.getCell(OfficeConstants.LOOKUP_OFFICE_ID_COL).getNumericCellValue(), 0.0);
}
}
@@ -37,15 +37,15 @@ import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class SavingsWorkbookPopulateTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup(){
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -59,50 +59,50 @@ public class SavingsWorkbookPopulateTest {
//in order to populate helper sheets
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000");
Assert.assertNotNull("Could not create office" ,outcome_office_creation);
Assertions.assertNotNull(outcome_office_creation, "Could not create office");
//in order to populate helper sheets
ClientHelper clientHelper=new ClientHelper(requestSpec,responseSpec);
Integer outcome_client_creation=clientHelper.createClient(requestSpec,responseSpec);
Assert.assertNotNull("Could not create client" ,outcome_client_creation);
Assertions.assertNotNull(outcome_client_creation, "Could not create client");
//in order to populate helper sheets
GroupHelper groupHelper=new GroupHelper(requestSpec,responseSpec);
Integer outcome_group_creation=groupHelper.createGroup(requestSpec,responseSpec,true);
Assert.assertNotNull("Could not create group" ,outcome_group_creation);
Assertions.assertNotNull(outcome_group_creation, "Could not create group");
//in order to populate helper sheets
StaffHelper staffHelper=new StaffHelper();
Integer outcome_staff_creation =staffHelper.createStaff(requestSpec,responseSpec);
Assert.assertNotNull("Could not create staff",outcome_staff_creation);
Assertions.assertNotNull(outcome_staff_creation, "Could not create staff");
SavingsProductHelper savingsProductHelper=new SavingsProductHelper();
String jsonSavingsProduct=savingsProductHelper.build();
Integer outcome_sp_creaction=savingsProductHelper.createSavingsProduct(jsonSavingsProduct,requestSpec,responseSpec);
Assert.assertNotNull("Could not create Savings product",outcome_sp_creaction);
Assertions.assertNotNull(outcome_sp_creaction, "Could not create Savings product");
SavingsAccountHelper savingsAccountHelper=new SavingsAccountHelper(requestSpec,responseSpec);
Workbook workbook=savingsAccountHelper.getSavingsWorkbook("dd MMMM yyyy");
Sheet officeSheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
Row firstOfficeRow=officeSheet.getRow(1);
Assert.assertNotNull("No offices found ",firstOfficeRow.getCell(1));
Assertions.assertNotNull(firstOfficeRow.getCell(1), "No offices found ");
Sheet clientSheet=workbook.getSheet(TemplatePopulateImportConstants.CLIENT_SHEET_NAME);
Row firstClientRow=clientSheet.getRow(1);
Assert.assertNotNull("No clients found ",firstClientRow.getCell(1));
Assertions.assertNotNull(firstClientRow.getCell(1), "No clients found ");
Sheet groupSheet=workbook.getSheet(TemplatePopulateImportConstants.GROUP_SHEET_NAME);
Row firstGroupRow=groupSheet.getRow(1);
Assert.assertNotNull("No groups found ",firstGroupRow.getCell(1));
Assertions.assertNotNull(firstGroupRow.getCell(1), "No groups found ");
Sheet staffSheet=workbook.getSheet(TemplatePopulateImportConstants.STAFF_SHEET_NAME);
Row firstStaffRow=staffSheet.getRow(1);
Assert.assertNotNull("No staff found ",firstStaffRow.getCell(1));
Assertions.assertNotNull(firstStaffRow.getCell(1), "No staff found ");
Sheet productSheet=workbook.getSheet(TemplatePopulateImportConstants.PRODUCT_SHEET_NAME);
Row firstProductRow=productSheet.getRow(1);
Assert.assertNotNull("No products found ",firstProductRow.getCell(1));
Assertions.assertNotNull(firstProductRow.getCell(1), "No products found ");
}
}
@@ -27,7 +27,7 @@ import java.util.List;
import java.util.Map;
import org.apache.fineract.batch.domain.BatchRequest;
import org.apache.fineract.batch.domain.BatchResponse;
import org.junit.Assert;
import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -129,8 +129,8 @@ public class BatchHelper {
jsonifiedRequest);
// Verifies that the response result is there
Assert.assertNotNull(response);
Assert.assertTrue(response.size() > 0);
Assertions.assertNotNull(response);
Assertions.assertTrue(response.size() > 0);
return response;
}
@@ -427,6 +427,6 @@ public class BatchHelper {
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) 0, (long) responseRecords);
Assertions.assertEquals((long) 0, (long) responseRecords, "No records found with given externalId");
}
}
@@ -19,7 +19,7 @@
package org.apache.fineract.integrationtests.common;
import static io.restassured.path.json.JsonPath.from;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import io.restassured.specification.RequestSpecification;
@@ -87,7 +87,7 @@ public class CalendarHelper {
final String responseCalendarDetailsinJSON = Utils.performServerGet(requestSpec, responseSpec, CLIENT_URL,
"collectionMeetingCalendar");
final Integer responseCalendarId = from(responseCalendarDetailsinJSON).get("id");
assertEquals("ERROR IN CREATING THE CALENDAR", generatedCalendarId, responseCalendarId);
assertEquals( generatedCalendarId, responseCalendarId, "ERROR IN CREATING THE CALENDAR");
}
public static Integer createMeetingForGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests.common;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.common.base.Strings;
import com.google.common.reflect.TypeToken;
@@ -169,7 +169,7 @@ public class CenterHelper {
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);
assertEquals(generatedCenterID, responseCenterID, "ERROR IN CREATING THE CENTER");
}
public static void verifyCenterActivatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -177,7 +177,7 @@ public class CenterHelper {
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);
assertEquals(generatedCenterStatus, responseCenterStatus, "ERROR IN ACTIVATING THE CENTER");
}
public static Integer activateCenter(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -27,9 +27,9 @@ import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
*
@@ -45,7 +45,7 @@ public class ClientChargesTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -59,11 +59,11 @@ public class ClientChargesTest {
// Creates clientCharge
final Integer chargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getChargeSpecifiedDueDateJSON());
Assert.assertNotNull(chargeId);
Assertions.assertNotNull(chargeId);
// creates client with activation date
final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 October 2011");
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
/**
* create a charge for loan and try to associate to client created in
@@ -73,11 +73,11 @@ public class ClientChargesTest {
*/
final Integer loanChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON());
Assert.assertNotNull(loanChargeId);
Assertions.assertNotNull(loanChargeId);
ResponseSpecification responseLoanChargeFailure = new ResponseSpecBuilder().expectStatusCode(403).build();
final Integer clientLoanChargeId = ClientHelper.addChargesForClient(this.requestSpec, responseLoanChargeFailure, clientId,
ClientHelper.getSpecifiedDueDateChargesClientAsJSON(loanChargeId.toString(), "29 October 2011"));
Assert.assertNull(clientLoanChargeId);
Assertions.assertNull(clientLoanChargeId);
/**
* associates a clientCharge to a client and pay client charge for 10
@@ -85,10 +85,10 @@ public class ClientChargesTest {
**/
final Integer clientChargeId = ClientHelper.addChargesForClient(this.requestSpec, this.responseSpec, clientId,
ClientHelper.getSpecifiedDueDateChargesClientAsJSON(chargeId.toString(), "29 October 2011"));
Assert.assertNotNull(clientChargeId);
Assertions.assertNotNull(clientChargeId);
final String clientChargePaidTransactionId = ClientHelper.payChargesForClients(this.requestSpec, this.responseSpec, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "10"));
Assert.assertNotNull(clientChargePaidTransactionId);
Assertions.assertNotNull(clientChargePaidTransactionId);
isValidOutstandingAmount(ClientHelper.getClientCharge(requestSpec, responseSpec, clientId.toString(), clientChargeId.toString()),
(float) 190.0);
@@ -98,7 +98,7 @@ public class ClientChargesTest {
*/
final Integer undoTrxnId = ClientHelper.revertClientChargeTransaction(this.requestSpec, this.responseSpec,
clientId.toString(), clientChargePaidTransactionId);
Assert.assertNotNull(undoTrxnId);
Assertions.assertNotNull(undoTrxnId);
isReversedTransaction(clientId.toString(), undoTrxnId.toString());
/**
* Now pay client charge for 20 USD and ensure the outstanding amount is
@@ -111,12 +111,12 @@ public class ClientChargesTest {
today.add(Calendar.DAY_OF_MONTH, 2);
final String responseId_futureDate_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId,
clientChargeId, ClientHelper.getPayChargeJSON(dateFormat.format(today.getTime()), "20"));
Assert.assertNull(responseId_futureDate_failure);
Assertions.assertNull(responseId_futureDate_failure);
// waived off the outstanding client charge
final String waiveOffClientChargeTransactionId = ClientHelper.waiveChargesForClients(this.requestSpec, this.responseSpec, clientId,
clientChargeId, ClientHelper.getWaiveChargeJSON("100", clientChargeId.toString()));
Assert.assertNotNull(waiveOffClientChargeTransactionId);
Assertions.assertNotNull(waiveOffClientChargeTransactionId);
/**
* Revert the waived off client charge transaction by passing the
@@ -125,7 +125,7 @@ public class ClientChargesTest {
*/
final Integer undoWaiveTrxnId = ClientHelper.revertClientChargeTransaction(this.requestSpec, this.responseSpec, clientId.toString(),
waiveOffClientChargeTransactionId);
Assert.assertNotNull(undoWaiveTrxnId);
Assertions.assertNotNull(undoWaiveTrxnId);
isReversedTransaction(clientId.toString(), undoWaiveTrxnId.toString());
/**
* pay client charge before client activation date and ensured its a
@@ -134,21 +134,21 @@ public class ClientChargesTest {
final String responseId_activationDate_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("30 September 2011", "20"));
Assert.assertNull(responseId_activationDate_failure);
Assertions.assertNull(responseId_activationDate_failure);
/**
* pay client charge more than outstanding amount amount and ensured its
* a failure test case
*/
final String responseId_moreAmount_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "300"));
Assert.assertNull(responseId_moreAmount_failure);
Assertions.assertNull(responseId_moreAmount_failure);
/**
* pay client charge for 10 USD and ensure outstanding amount is updated
* properly
*/
final String chargePaid_responseId = ClientHelper.payChargesForClients(this.requestSpec, this.responseSpec, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "100"));
Assert.assertNotNull(chargePaid_responseId);
Assertions.assertNotNull(chargePaid_responseId);
isValidOutstandingAmount(ClientHelper.getClientCharge(requestSpec, responseSpec, clientId.toString(), clientChargeId.toString()),
(float) 100.0);
@@ -164,7 +164,7 @@ public class ClientChargesTest {
private void isReversedTransaction(String clientId, String transactionId) {
final Boolean isReversed = ClientHelper.getClientTransactions(this.requestSpec, this.responseSpec, clientId.toString(),
transactionId);
Assert.assertTrue(isReversed);
Assertions.assertTrue(isReversed);
}
/**
@@ -175,7 +175,7 @@ public class ClientChargesTest {
* @param expectedAmount
*/
private void isValidOutstandingAmount(Object outStandingAmount, Object expectedAmount) {
Assert.assertEquals(expectedAmount, (float) outStandingAmount);
Assertions.assertEquals(expectedAmount, (float) outStandingAmount);
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests.common;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import io.restassured.specification.RequestSpecification;
@@ -312,7 +312,7 @@ public class ClientHelper {
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);
assertEquals(generatedClientID, responseClientID, "ERROR IN CREATING THE CLIENT");
}
public static Object getClient(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -23,7 +23,7 @@ import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import java.util.ArrayList;
import java.util.HashMap;
import org.junit.Assert;
import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -81,20 +81,20 @@ public class GlobalConfigurationHelper {
ArrayList<HashMap> actualGlobalConfigurations = getAllGlobalConfigurations(requestSpec, responseSpec);
// There are currently 27 global configurations.
Assert.assertEquals(28, expectedGlobalConfigurations.size());
Assert.assertEquals(28, actualGlobalConfigurations.size());
Assertions.assertEquals(28, expectedGlobalConfigurations.size());
Assertions.assertEquals(28, actualGlobalConfigurations.size());
for (int i = 0; i < expectedGlobalConfigurations.size(); i++) {
HashMap expectedGlobalConfiguration = expectedGlobalConfigurations.get(i);
HashMap actualGlobalConfiguration = actualGlobalConfigurations.get(i);
Assert.assertEquals(expectedGlobalConfiguration.get("id"), actualGlobalConfiguration.get("id"));
Assertions.assertEquals(expectedGlobalConfiguration.get("id"), actualGlobalConfiguration.get("id"));
final String assertionFailedMessage = "Assertion failed for configID:<" + expectedGlobalConfiguration.get("id") + ">";
Assert.assertEquals(assertionFailedMessage, expectedGlobalConfiguration.get("name"), actualGlobalConfiguration.get("name"));
Assert.assertEquals(assertionFailedMessage, expectedGlobalConfiguration.get("value"), actualGlobalConfiguration.get("value"));
Assert.assertEquals(assertionFailedMessage, expectedGlobalConfiguration.get("enabled"), actualGlobalConfiguration.get("enabled"));
Assert.assertEquals(assertionFailedMessage, expectedGlobalConfiguration.get("trapDoor"), actualGlobalConfiguration.get("trapDoor"));
Assertions.assertEquals(expectedGlobalConfiguration.get("name"), actualGlobalConfiguration.get("name"), assertionFailedMessage);
Assertions.assertEquals(expectedGlobalConfiguration.get("value"), actualGlobalConfiguration.get("value"), assertionFailedMessage);
Assertions.assertEquals(expectedGlobalConfiguration.get("enabled"), actualGlobalConfiguration.get("enabled"), assertionFailedMessage);
Assertions.assertEquals(expectedGlobalConfiguration.get("trapDoor"), actualGlobalConfiguration.get("trapDoor"), assertionFailedMessage);
}
}
@@ -18,9 +18,9 @@
*/
package org.apache.fineract.integrationtests.common;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.common.base.Strings;
import com.google.gson.Gson;
@@ -193,7 +193,7 @@ public class GroupHelper {
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);
assertEquals(generatedGroupID, responseGroupID, "ERROR IN CREATING THE GROUP");
}
public static void verifyGroupDetails(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -201,7 +201,7 @@ public class GroupHelper {
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);
assertEquals(expectedValue, responseValue, "ERROR IN CREATING THE GROUP");
}
public static void verifyGroupActivatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -209,7 +209,7 @@ public class GroupHelper {
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);
assertEquals(generatedGroupStatus, responseGroupStatus, "ERROR IN ACTIVATING THE GROUP");
}
public static void verifyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -220,7 +220,7 @@ public class GroupHelper {
+ "?associations=clientMembers&" + Utils.TENANT_IDENTIFIER;
list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "clientMembers");
LOG.debug("the list of verifyEmptyGroupMembers : {} ", list);
assertTrue("ERROR IN GROUP MEMBER", list.toString().contains("id=" + groupMember.toString()));
assertTrue(list.toString().contains("id=" + groupMember.toString()), "ERROR IN GROUP MEMBER");
}
public static void verifyEmptyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -231,7 +231,7 @@ public class GroupHelper {
+ "?associations=clientMembers&" + Utils.TENANT_IDENTIFIER;
list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "clientMembers");
LOG.debug("the list of verifyEmptyGroupMembers : {} ", list);
assertEquals("GROUP MEMBER LIST NOT EMPTY", list, null);
assertEquals(list, null, "GROUP MEMBER LIST NOT EMPTY");
}
public static void verifyGroupDeleted(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -240,7 +240,7 @@ public class GroupHelper {
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");
assertFalse("GROUP NOT DELETED", list.toString().contains("id=" + generatedGroupID.toString()));
assertFalse(list.toString().contains("id=" + generatedGroupID.toString()), "GROUP NOT DELETED");
}
//Glim_Gsim_testing
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests.common;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import io.restassured.builder.ResponseSpecBuilder;
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests.common;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
@@ -61,6 +61,6 @@ public class LoanRescheduleRequestHelper {
final String URL = LOAN_RESCHEDULE_REQUEST_URL + "/" + requestId + "?" + Utils.TENANT_IDENTIFIER;
final Integer id = Utils.performServerGet(requestSpec, responseSpec, URL, "id");
assertEquals("ERROR IN CREATING LOAN RESCHEDULE REQUEST", requestId, id);
assertEquals(requestId, id, "ERROR IN CREATING LOAN RESCHEDULE REQUES");
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests.common;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
@@ -67,7 +67,7 @@ public class PaymentTypeHelper {
+ Utils.TENANT_IDENTIFIER;
final Integer responsePaymentTypeID = Utils.performServerGet(requestSpec, responseSpec, GET_PAYMENTTYPE_URL,
"id");
assertEquals("ERROR IN CREATING THE PAYMENT TYPE", generatedPaymentTypeID, responsePaymentTypeID);
assertEquals(generatedPaymentTypeID, responsePaymentTypeID, "ERROR IN CREATING THE PAYMENT TYPE");
}
public static PaymentTypeDomain retrieveById(RequestSpecification requestSpec, ResponseSpecification responseSpec,
@@ -40,10 +40,10 @@ import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.provisioning.ProvisioningHelper;
import org.apache.fineract.integrationtests.common.provisioning.ProvisioningTransactionHelper;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,7 +58,7 @@ public class ProvisioningIntegrationTest {
private AccountHelper accountHelper;
private LoanTransactionHelper loanTransactionHelper;
@Before
@BeforeEach
public void setup() throws ParseException{
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -66,7 +66,7 @@ public class ProvisioningIntegrationTest {
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
Assume.assumeTrue(!isAlreadyProvisioningEntriesCreated());
Assumptions.assumeTrue(!isAlreadyProvisioningEntriesCreated());
}
@Test
@@ -79,7 +79,7 @@ public class ProvisioningIntegrationTest {
for (int i = 0; i < LOANPRODUCTS_SIZE; i++) {
final Integer loanProductID = createLoanProduct(false, NONE);
loanProducts.add(loanProductID);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, null, null, "1,00,000.00");
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -90,17 +90,17 @@ public class ProvisioningIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
loans.add(loanID);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
}
ArrayList categories = transactionHelper.retrieveAllProvisioningCategories();
Assert.assertTrue(categories.size() > 0) ;
Assertions.assertTrue(categories.size() > 0) ;
Account liability = accountHelper.createLiabilityAccount() ;
Account expense = accountHelper.createExpenseAccount() ;
Map requestCriteria = ProvisioningHelper.createProvisioingCriteriaJson(loanProducts, categories, liability, expense);
String provisioningCriteriaCreateJson = new Gson().toJson(requestCriteria);
Integer criteriaId = transactionHelper.createProvisioningCriteria(provisioningCriteriaCreateJson);
Assert.assertNotNull(criteriaId);
Assertions.assertNotNull(criteriaId);
Map newCriteria = transactionHelper.retrieveProvisioningCriteria(criteriaId) ;
validateProvisioningCriteria(requestCriteria, newCriteria) ;
@@ -124,18 +124,18 @@ public class ProvisioningIntegrationTest {
requestCriteria = ProvisioningHelper.createProvisioingCriteriaJson(loanProducts, categories, liability, expense);
provisioningCriteriaCreateJson = new Gson().toJson(requestCriteria);
criteriaId = transactionHelper.createProvisioningCriteria(provisioningCriteriaCreateJson);
Assert.assertNotNull(criteriaId);
Assertions.assertNotNull(criteriaId);
String provisioningEntryJson = ProvisioningHelper.createProvisioningEntryJson();
Integer provisioningEntryId = transactionHelper.createProvisioningEntries(provisioningEntryJson);
Assert.assertNotNull(provisioningEntryId);
Assertions.assertNotNull(provisioningEntryId);
transactionHelper.updateProvisioningEntry("recreateprovisioningentry", provisioningEntryId, "") ;
transactionHelper.updateProvisioningEntry("createjournalentry", provisioningEntryId, "") ;
Map entry = transactionHelper.retrieveProvisioningEntry(provisioningEntryId) ;
Assert.assertTrue((Boolean)entry.get("journalEntry")) ;
Assertions.assertTrue((Boolean)entry.get("journalEntry")) ;
Map provisioningEntry = transactionHelper.retrieveProvisioningEntries(provisioningEntryId) ;
Assert.assertTrue(((ArrayList)provisioningEntry.get("pageItems")).size() > 0) ;
Assertions.assertTrue(((ArrayList)provisioningEntry.get("pageItems")).size() > 0) ;
}
private void validateProvisioningCriteria(Map requestCriteria, Map newCriteria) {
@@ -143,16 +143,16 @@ public class ProvisioningIntegrationTest {
//criteria name validation
String requestCriteriaName = (String)requestCriteria.get("criteriaName") ;
String criteriaName = (String)newCriteria.get("criteriaName") ;
Assert.assertEquals(criteriaName, requestCriteriaName) ;
Assertions.assertEquals(criteriaName, requestCriteriaName) ;
//loan products validation
ArrayList requestProducts = (ArrayList)requestCriteria.get("loanProducts") ;
ArrayList products = (ArrayList)newCriteria.get("loanProducts") ;
Assert.assertEquals(products.size(), requestProducts.size()) ;
Assertions.assertEquals(products.size(), requestProducts.size()) ;
ArrayList requestedDefinitions = (ArrayList)requestCriteria.get("definitions") ;
ArrayList newdefintions = (ArrayList) newCriteria.get("definitions") ;
Assert.assertEquals(newdefintions.size(), requestedDefinitions.size()) ;
Assertions.assertEquals(newdefintions.size(), requestedDefinitions.size()) ;
for(int i = 0 ; i < newdefintions.size() ; i++) {
Map requestedMap = (Map)requestedDefinitions.get(i) ;
Object requestedCategoryId = requestedMap.get("categoryId") ;
@@ -173,7 +173,7 @@ public class ProvisioningIntegrationTest {
}
}
if(!found) {
Assert.fail("No Category found with Id:" + requestedCategoryId);
Assertions.fail("No Category found with Id:" + requestedCategoryId);
}
}
}
@@ -181,7 +181,7 @@ public class ProvisioningIntegrationTest {
private void checkProperty(String propertyName, Map requestMap, Map newMap) {
Object requested = requestMap.get(propertyName) ;
Object modified = newMap.get(propertyName) ;
Assert.assertEquals(requested, modified) ;
Assertions.assertEquals(requested, modified) ;
}
private Integer createLoanProduct(final boolean multiDisburseLoan, final String accountingRule, final Account... accounts) {
@@ -22,10 +22,10 @@ import static java.time.Instant.now;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.fail;
import com.google.gson.Gson;
import io.restassured.builder.ResponseSpecBuilder;
@@ -175,11 +175,11 @@ public class SchedulerJobHelper {
LOG.error("Lsat Job failure error log (only relevent if the job fails: {}",
jobHistoryData.get(jobHistoryData.size() - 1).get("jobRunErrorLog"));
assertFalse("Job History is empty :( Was it too slow? Failures in background job?", jobHistoryData.isEmpty());
assertFalse(jobHistoryData.isEmpty(), "Job History is empty :( Was it too slow? Failures in background job?");
// Verifying the Status of the Recently executed Scheduler Job
assertEquals("Verifying Last Scheduler Job Status", "success",
jobHistoryData.get(jobHistoryData.size() - 1).get("status"));
assertEquals("success", jobHistoryData.get(jobHistoryData.size() - 1).get("status"),
"Verifying Last Scheduler Job Status");
}
/**
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests.common;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import io.restassured.specification.RequestSpecification;
@@ -68,7 +68,7 @@ public class SurveyHelper {
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);
assertEquals(generatedClientID, responseClientID, "ERROR IN CREATING THE CLIENT");
}
@@ -22,7 +22,7 @@ import static io.restassured.RestAssured.given;
import static io.restassured.path.json.JsonPath.from;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
@@ -18,14 +18,14 @@
*/
package org.apache.fineract.integrationtests.common.accounting;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.jupiter.api.Assertions;
@SuppressWarnings("rawtypes")
public class JournalEntryHelper {
@@ -62,7 +62,7 @@ public class JournalEntryHelper {
public void ensureNoAccountingTransactionsWithTransactionId(final String transactionId) {
ArrayList<HashMap> transactions = getJournalEntriesByTransactionId(transactionId);
assertTrue("Tranasactions are is not empty", transactions.isEmpty());
assertTrue(transactions.isEmpty(), "Tranasactions are is not empty");
}
@@ -88,7 +88,7 @@ public class JournalEntryHelper {
break;
}
}
Assert.assertTrue("Journal Entry not found", matchFound);
Assertions.assertTrue(matchFound, "Journal Entry not found");
}
}
@@ -18,13 +18,13 @@
*/
package org.apache.fineract.integrationtests.common.fixeddeposit;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,46 +35,46 @@ public class FixedDepositAccountStatusChecker {
public static void verifyFixedDepositIsApproved(final HashMap fixedDepositStatusHashMap) {
LOG.info("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS APPROVED --------------------");
assertTrue("Error in Approving Fixed deposit application", getStatus(fixedDepositStatusHashMap, "approved"));
assertTrue(getStatus(fixedDepositStatusHashMap, "approved"), "Error in Approving Fixed deposit application");
LOG.info("{}", fixedDepositStatusHashMap.toString());
}
public static void verifyFixedDepositIsPending(final HashMap fixedDepositStatusHashMap) {
LOG.info("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS PENDING --------------------");
assertTrue("FIXED DEPOSIT ACCOUNT IS NOT IN PENDING STATE",
getStatus(fixedDepositStatusHashMap, "submittedAndPendingApproval"));
assertTrue(getStatus(fixedDepositStatusHashMap, "submittedAndPendingApproval"),
"FIXED DEPOSIT ACCOUNT IS NOT IN PENDING STATE");
LOG.info("{}", fixedDepositStatusHashMap.toString());
}
public static void verifyFixedDepositIsActive(final HashMap fixedDepositStatusHashMap) {
LOG.info("----------------- VERIFYING FIXED DEPOSIT APPLICATION IS ACTIVE -----------------");
assertTrue("ERROR IN ACTIVATING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "active"));
assertTrue(getStatus(fixedDepositStatusHashMap, "active"), "ERROR IN ACTIVATING THE FIXED DEPOSIT APPLICATION");
LOG.info("{}", fixedDepositStatusHashMap.toString());
}
public static void verifyFixedDepositIsRejected(final HashMap fixedDepositStatusHashMap) {
LOG.info("-------------- VERIFYING FIXED DEPOSIT APPLICATION IS REJECTED ----------------");
assertTrue("ERROR IN REJECTING THE FIXED DEPOSIT APPLICATION",
getStatus(fixedDepositStatusHashMap, "rejected"));
assertTrue(getStatus(fixedDepositStatusHashMap, "rejected"),
"ERROR IN REJECTING THE FIXED DEPOSIT APPLICATION");
LOG.info("{}", fixedDepositStatusHashMap.toString());
}
public static void verifyFixedDepositIsWithdrawn(final HashMap fixedDepositStatusHashMap) {
LOG.info("---------------- VERIFYING FIXED DEPOSIT APPLICATION IS WITHDRAWN ----------------");
assertTrue("ERROR IN WITHDRAW THE FIXED DEPOSIT APPLICATION",
getStatus(fixedDepositStatusHashMap, "withdrawnByApplicant"));
assertTrue(getStatus(fixedDepositStatusHashMap, "withdrawnByApplicant"),
"ERROR IN WITHDRAW THE FIXED DEPOSIT APPLICATION");
LOG.info("{}", fixedDepositStatusHashMap.toString());
}
public static void verifyFixedDepositAccountIsClosed(final HashMap fixedDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN CLOSING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "closed"));
assertTrue(getStatus(fixedDepositStatusHashMap, "closed"), "ERROR IN CLOSING THE FIXED DEPOSIT APPLICATION");
LOG.info("{}", fixedDepositStatusHashMap.toString());
}
public static void verifyFixedDepositAccountIsNotActive(final HashMap fixedDepositStatusHashMap) {
LOG.info("------------------ VERIFYING FIXED DEPOSIT APPLICATION IS INACTIVE --------------------");
Assert.assertFalse(getStatus(fixedDepositStatusHashMap, "active"));
Assertions.assertFalse(getStatus(fixedDepositStatusHashMap, "active"));
LOG.info("{}", fixedDepositStatusHashMap.toString());
}
@@ -87,15 +87,15 @@ public class FixedDepositAccountStatusChecker {
public static void verifyFixedDepositAccountIsPrematureClosed(HashMap fixedDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN PREMATURELY CLOSING THE FIXED DEPOSIT ACCOUNT",
getStatus(fixedDepositStatusHashMap, "prematureClosed"));
assertTrue(getStatus(fixedDepositStatusHashMap, "prematureClosed"),
"ERROR IN PREMATURELY CLOSING THE FIXED DEPOSIT ACCOUNT");
LOG.info("{}", fixedDepositStatusHashMap.toString());
}
public static void verifyFixedDepositAccountIsMatured(HashMap fixedDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS MATURED ---------------------");
assertTrue("ERROR IN MATURITY JOB OF THE FIXED DEPOSIT ACCOUNT",
getStatus(fixedDepositStatusHashMap, "matured"));
assertTrue(getStatus(fixedDepositStatusHashMap, "matured"),
"ERROR IN MATURITY JOB OF THE FIXED DEPOSIT ACCOUNT");
LOG.info("{}", fixedDepositStatusHashMap.toString());
}
@@ -18,9 +18,9 @@
*/
package org.apache.fineract.integrationtests.common.loans;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
@@ -18,8 +18,8 @@
*/
package org.apache.fineract.integrationtests.common.loans;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.gson.Gson;
import io.restassured.specification.RequestSpecification;
@@ -669,8 +669,9 @@ public class LoanTransactionHelper {
LOG.info("---------------------------GETTING LOAN REPAYMENT SCHEDULE--------------------------------");
final ArrayList<HashMap> repaymentPeriods = getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
loanID);
assertEquals("Mismatch in Principal Loan Balance Outstanding ", expectedPrincipalOutstanding,
repaymentPeriods.get(repaymentNumber).get("principalLoanBalanceOutstanding"));
assertEquals(expectedPrincipalOutstanding,
repaymentPeriods.get(repaymentNumber).get("principalLoanBalanceOutstanding"),
"Mismatch in Principal Loan Balance Outstanding ");
}
public void checkAccrualTransactionForRepayment(final LocalDate transactionDate, final Float interestPortion,
@@ -690,17 +691,20 @@ public class LoanTransactionHelper {
if (transactionDate.equals(accrualEntryDate)) {
isTransactionFound = true;
assertEquals("Mismatch in transaction amounts", interestPortion,
Float.valueOf(String.valueOf(transactions.get(i).get("interestPortion"))));
assertEquals("Mismatch in transaction amounts", feePortion,
Float.valueOf(String.valueOf(transactions.get(i).get("feeChargesPortion"))));
assertEquals("Mismatch in transaction amounts", penaltyPortion,
Float.valueOf(String.valueOf(transactions.get(i).get("penaltyChargesPortion"))));
assertEquals(interestPortion,
Float.valueOf(String.valueOf(transactions.get(i).get("interestPortion"))),
"Mismatch in transaction amounts");
assertEquals(feePortion,
Float.valueOf(String.valueOf(transactions.get(i).get("feeChargesPortion"))),
"Mismatch in transaction amounts");
assertEquals(penaltyPortion,
Float.valueOf(String.valueOf(transactions.get(i).get("penaltyChargesPortion"))),
"Mismatch in transaction amounts");
break;
}
}
}
assertTrue("No Accrual entries are posted", isTransactionFound);
assertTrue(isTransactionFound, "No Accrual entries are posted");
}
@@ -20,7 +20,7 @@ package org.apache.fineract.integrationtests.common.organisation;
import static io.restassured.RestAssured.given;
import static io.restassured.path.json.JsonPath.from;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
@@ -67,7 +67,7 @@ public class CampaignsHelper {
+ Utils.TENANT_IDENTIFIER;
final Integer responseCampaignId = Utils.performServerGet(requestSpec, responseSpec, RETRIEVE_SMS_CAMPAIGNS_URL,
"id");
assertEquals("ERROR IN CREATING THE CAMPAIGN", generatedCampaignId, responseCampaignId);
assertEquals(generatedCampaignId, responseCampaignId, "ERROR IN CREATING THE CAMPAIGN");
}
public Integer updateCampaign(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests.common.organisation;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -29,11 +29,11 @@ import java.util.ArrayList;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@Ignore
@Disabled
public class CampaignsTest {
private RequestSpecification requestSpec;
@@ -53,7 +53,7 @@ public class CampaignsTest {
public static final String DATE_FORMAT = "dd MMMM yyyy";
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,8 +18,8 @@
*/
package org.apache.fineract.integrationtests.common.organisation;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -39,9 +39,9 @@ import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.system.DatatableHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -74,7 +74,7 @@ public class EntityDatatableChecksIntegrationTest {
// TODO Auto-generated constructor stub
}
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -93,15 +93,15 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(CLIENT_APP_TABLE_NAME, datatableName,
100, null);
assertNotNull("ERROR IN CREATING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN CREATING THE ENTITY DATATABLE CHECK");
// deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId);
assertNotNull("ERROR IN DELETING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN DELETING THE ENTITY DATATABLE CHECK");
// deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(datatableName);
assertEquals("ERROR IN DELETING THE DATATABLE", datatableName, deletedDataTableName);
assertEquals(datatableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
}
@Test
@@ -121,7 +121,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(CLIENT_APP_TABLE_NAME,
registeredTableName, 100, null);
assertNotNull("ERROR IN CREATING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN CREATING THE ENTITY DATATABLE CHECK");
// creating client with datatables
final Integer clientID = ClientHelper.createClientPendingWithDatatable(requestSpec, responseSpec, registeredTableName);
@@ -129,15 +129,15 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId);
assertNotNull("ERROR IN DELETING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN DELETING THE ENTITY DATATABLE CHECK");
// deleting datatable entries
Integer appTableId = this.datatableHelper.deleteDatatableEntries(registeredTableName, clientID, "clientId");
assertEquals("ERROR IN DELETING THE DATATABLE ENTRIES", clientID, appTableId);
assertEquals(clientID, appTableId, "ERROR IN DELETING THE DATATABLE ENTRIES");
// deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName);
assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
}
@SuppressWarnings("unchecked")
@@ -154,7 +154,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(CLIENT_APP_TABLE_NAME,
registeredTableName, 100, null);
assertNotNull("ERROR IN CREATING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN CREATING THE ENTITY DATATABLE CHECK");
// creating client with datatables with error
ArrayList<HashMap<Object, Object>> clientErrorData = (ArrayList<HashMap<Object, Object>>) validationErrorHelper
@@ -164,11 +164,11 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId);
assertNotNull("ERROR IN DELETING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN DELETING THE ENTITY DATATABLE CHECK");
// deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName);
assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
}
@Test
@@ -181,7 +181,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(GROUP_APP_TABLE_NAME,
registeredTableName, 100, null);
assertNotNull("ERROR IN CREATING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN CREATING THE ENTITY DATATABLE CHECK");
// creating group with datatables
final Integer groupId = GroupHelper.createGroupPendingWithDatatable(this.requestSpec, this.responseSpec, registeredTableName);
@@ -189,15 +189,15 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId);
assertNotNull("ERROR IN DELETING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN DELETING THE ENTITY DATATABLE CHECK");
// deleting datatable entries
Integer appTableId = this.datatableHelper.deleteDatatableEntries(registeredTableName, groupId, "groupId");
assertEquals("ERROR IN DELETING THE DATATABLE ENTRIES", groupId, appTableId);
assertEquals(groupId, appTableId, "ERROR IN DELETING THE DATATABLE ENTRIES");
// deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName);
assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
}
@SuppressWarnings("unchecked")
@@ -214,7 +214,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(GROUP_APP_TABLE_NAME,
registeredTableName, 100, null);
assertNotNull("ERROR IN CREATING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN CREATING THE ENTITY DATATABLE CHECK");
// creating group with datatables with error
ArrayList<HashMap<Object, Object>> groupErrorData = (ArrayList<HashMap<Object, Object>>) validationErrorHelper
@@ -224,11 +224,11 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId);
assertNotNull("ERROR IN DELETING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN DELETING THE ENTITY DATATABLE CHECK");
// deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName);
assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
}
@Test
@@ -248,31 +248,31 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(SAVINGS_APP_TABLE_NAME,
registeredTableName, 100, null);
assertNotNull("ERROR IN CREATING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN CREATING THE ENTITY DATATABLE CHECK");
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
// creating savings with datatables
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplicationWithDatatables(clientID, savingsProductID,
ACCOUNT_TYPE_INDIVIDUAL, "01 December 2016", registeredTableName);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
// deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId);
assertNotNull("ERROR IN DELETING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN DELETING THE ENTITY DATATABLE CHECK");
// deleting datatable entries
Integer appTableId = this.datatableHelper.deleteDatatableEntries(registeredTableName, savingsId, "savingsId");
assertEquals("ERROR IN DELETING THE DATATABLE ENTRIES", savingsId, appTableId);
assertEquals(savingsId, appTableId, "ERROR IN DELETING THE DATATABLE ENTRIES");
// deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName);
assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
}
@SuppressWarnings("unchecked")
@@ -294,14 +294,14 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(SAVINGS_APP_TABLE_NAME,
registeredTableName, 100, null);
assertNotNull("ERROR IN CREATING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN CREATING THE ENTITY DATATABLE CHECK");
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
// creating savings with datatables with error
ArrayList<HashMap<Object, Object>> groupErrorData = (ArrayList<HashMap<Object, Object>>) validationErrorHelper
@@ -312,11 +312,11 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId);
assertNotNull("ERROR IN DELETING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN DELETING THE ENTITY DATATABLE CHECK");
// deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName);
assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
}
@Test
@@ -329,7 +329,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating loan product
final Integer loanProductID = createLoanProduct("100", "0", LoanProductTestBuilder.DEFAULT_STRATEGY);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
// creating datatable
String registeredTableName = this.datatableHelper.createDatatable(LOAN_APP_TABLE_NAME, false);
@@ -338,23 +338,23 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(LOAN_APP_TABLE_NAME,
registeredTableName, 100, loanProductID);
assertNotNull("ERROR IN CREATING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN CREATING THE ENTITY DATATABLE CHECK");
// creating new loan application
final Integer loanID = applyForLoanApplication(clientID, loanProductID, "5", registeredTableName);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
// deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId);
assertNotNull("ERROR IN DELETING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN DELETING THE ENTITY DATATABLE CHECK");
// deleting datatable entries
Integer appTableId = this.datatableHelper.deleteDatatableEntries(registeredTableName, loanID, "loanId");
assertEquals("ERROR IN DELETING THE DATATABLE ENTRIES", loanID, appTableId);
assertEquals(loanID, appTableId, "ERROR IN DELETING THE DATATABLE ENTRIES");
// deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName);
assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
}
@SuppressWarnings("unchecked")
@@ -372,7 +372,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating loan product
final Integer loanProductID = createLoanProduct("100", "0", LoanProductTestBuilder.DEFAULT_STRATEGY);
Assert.assertNotNull(loanProductID);
Assertions.assertNotNull(loanProductID);
// creating datatable
String registeredTableName = this.datatableHelper.createDatatable(LOAN_APP_TABLE_NAME, false);
@@ -381,7 +381,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(LOAN_APP_TABLE_NAME,
registeredTableName, 100, loanProductID);
assertNotNull("ERROR IN CREATING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN CREATING THE ENTITY DATATABLE CHECK");
// creating new loan application with error
ArrayList<HashMap<Object, Object>> loanErrorData = (ArrayList<HashMap<Object, Object>>) applyForLoanApplicationWithError(clientID,
@@ -391,11 +391,11 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId);
assertNotNull("ERROR IN DELETING THE ENTITY DATATABLE CHECK", entityDatatableCheckId);
assertNotNull(entityDatatableCheckId, "ERROR IN DELETING THE ENTITY DATATABLE CHECK");
// deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName);
assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
}
private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -18,13 +18,13 @@
*/
package org.apache.fineract.integrationtests.common.recurringdeposit;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert;
import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,44 +35,44 @@ public class RecurringDepositAccountStatusChecker {
public static void verifyRecurringDepositIsApproved(final HashMap recurringDepositStatusHashMap) {
LOG.info("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS APPROVED --------------------");
assertTrue("Error in Approving Recurring deposit application", getStatus(recurringDepositStatusHashMap, "approved"));
assertTrue(getStatus(recurringDepositStatusHashMap, "approved"), "Error in Approving Recurring deposit application");
LOG.info("{}",recurringDepositStatusHashMap.toString());
}
public static void verifyRecurringDepositIsPending(final HashMap recurringDepositStatusHashMap) {
LOG.info("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS PENDING --------------------");
assertTrue("RECURRING DEPOSIT ACCOUNT IS NOT IN PENDING STATE",
getStatus(recurringDepositStatusHashMap, "submittedAndPendingApproval"));
assertTrue(getStatus(recurringDepositStatusHashMap, "submittedAndPendingApproval"),
"RECURRING DEPOSIT ACCOUNT IS NOT IN PENDING STATE");
LOG.info("{}",recurringDepositStatusHashMap.toString());
}
public static void verifyRecurringDepositIsActive(final HashMap recurringDepositStatusHashMap) {
LOG.info("----------------- VERIFYING RECURRING DEPOSIT APPLICATION IS ACTIVE -----------------");
assertTrue("ERROR IN ACTIVATING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "active"));
assertTrue(getStatus(recurringDepositStatusHashMap, "active"), "ERROR IN ACTIVATING THE RECURRING DEPOSIT APPLICATION");
LOG.info("{}",recurringDepositStatusHashMap.toString());
}
public static void verifyRecurringDepositIsRejected(final HashMap recurringDepositStatusHashMap) {
LOG.info("-------------- VERIFYING RECURRING DEPOSIT APPLICATION IS REJECTED ----------------");
assertTrue("ERROR IN REJECTING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "rejected"));
assertTrue(getStatus(recurringDepositStatusHashMap, "rejected"), "ERROR IN REJECTING THE RECURRING DEPOSIT APPLICATION");
LOG.info("{}",recurringDepositStatusHashMap.toString());
}
public static void verifyRecurringDepositIsWithdrawn(final HashMap recurringDepositStatusHashMap) {
LOG.info("---------------- VERIFYING RECURRING DEPOSIT APPLICATION IS WITHDRAWN ----------------");
assertTrue("ERROR IN WITHDRAW THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "withdrawnByApplicant"));
assertTrue(getStatus(recurringDepositStatusHashMap, "withdrawnByApplicant"), "ERROR IN WITHDRAW THE RECURRING DEPOSIT APPLICATION");
LOG.info("{}",recurringDepositStatusHashMap.toString());
}
public static void verifyRecurringDepositAccountIsClosed(final HashMap recurringDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN CLOSING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "closed"));
assertTrue(getStatus(recurringDepositStatusHashMap, "closed"), "ERROR IN CLOSING THE RECURRING DEPOSIT APPLICATION");
LOG.info("{}",recurringDepositStatusHashMap.toString());
}
public static void verifyRecurringDepositAccountIsNotActive(final HashMap recurringDepositStatusHashMap) {
LOG.info("------------------ VERIFYING RECURRING DEPOSIT APPLICATION IS INACTIVE --------------------");
Assert.assertFalse(getStatus(recurringDepositStatusHashMap, "active"));
Assertions.assertFalse(getStatus(recurringDepositStatusHashMap, "active"));
LOG.info("{}",recurringDepositStatusHashMap.toString());
}
@@ -85,14 +85,14 @@ public class RecurringDepositAccountStatusChecker {
public static void verifyRecurringDepositAccountIsPrematureClosed(HashMap recurringDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN PREMATURELY CLOSING THE RECURRING DEPOSIT ACCOUNT",
getStatus(recurringDepositStatusHashMap, "prematureClosed"));
assertTrue(getStatus(recurringDepositStatusHashMap, "prematureClosed"),
"ERROR IN PREMATURELY CLOSING THE RECURRING DEPOSIT ACCOUNT");
LOG.info("{}",recurringDepositStatusHashMap.toString());
}
public static void verifyRecurringDepositAccountIsMatured(HashMap recurringDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS MATURED ---------------------");
assertTrue("ERROR IN MATURITY JOB OF THE RECURRING DEPOSIT ACCOUNT", getStatus(recurringDepositStatusHashMap, "matured"));
assertTrue(getStatus(recurringDepositStatusHashMap, "matured"), "ERROR IN MATURITY JOB OF THE RECURRING DEPOSIT ACCOUNT");
LOG.info("{}",recurringDepositStatusHashMap.toString());
}
@@ -39,7 +39,7 @@ import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -674,12 +674,12 @@ public class SavingsAccountHelper {
public static Integer openSavingsAccount(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer clientId, final String minimumOpeningBalance) {
final Integer savingsProductID = createSavingsProduct(requestSpec, responseSpec, minimumOpeningBalance);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
SavingsAccountHelper savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
final Integer savingsId = savingsAccountHelper.applyForSavingsApplication(clientId, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID);
Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests.common.savings;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import io.restassured.specification.RequestSpecification;
@@ -293,7 +293,7 @@ public class SavingsProductHelper {
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);
assertEquals(generatedProductID, responseSavingsProductID, "ERROR IN CREATING THE Savings Product");
}
public SavingsProductHelper withDormancy() {
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests.common.savings;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
@@ -35,44 +35,44 @@ public class SavingsStatusChecker {
public static void verifySavingsIsApproved(final HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS APPROVED ------------------------------------");
assertTrue("ERROR IN APPROVING SAVINGS APPLICATION", getStatus(savingsStatusHashMap, "approved"));
assertTrue(getStatus(savingsStatusHashMap, "approved"), "ERROR IN APPROVING SAVINGS APPLICATION");
LOG.info("Savings Application Status: {} \n", savingsStatusHashMap);
}
public static void verifySavingsIsPending(final HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS PENDING ------------------------------------");
assertTrue("SAVINGS ACCOUNT IS NOT IN PENDING STATE",
getStatus(savingsStatusHashMap, "submittedAndPendingApproval"));
assertTrue(getStatus(savingsStatusHashMap, "submittedAndPendingApproval"),
"SAVINGS ACCOUNT IS NOT IN PENDING STATE");
LOG.info("Savings Application Status: {} \n", savingsStatusHashMap);
}
public static void verifySavingsIsActive(final HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------");
assertTrue("ERROR IN ACTIVATING THE SAVINGS APPLICATION", getStatus(savingsStatusHashMap, "active"));
assertTrue(getStatus(savingsStatusHashMap, "active"), "ERROR IN ACTIVATING THE SAVINGS APPLICATION");
LOG.info("Savings Application Status: {} \n", savingsStatusHashMap);
}
public static void verifySavingsIsRejected(final HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS REJECTED ------------------------------------");
assertTrue("ERROR IN REJECTING THE SAVINGS APPLICATION", getStatus(savingsStatusHashMap, "rejected"));
assertTrue(getStatus(savingsStatusHashMap, "rejected"), "ERROR IN REJECTING THE SAVINGS APPLICATION");
LOG.info("Savings Application Status: {} \n", savingsStatusHashMap);
}
public static void verifySavingsIsWithdrawn(final HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS WITHDRAWN ------------------------------------");
assertTrue("ERROR IN WITHDRAW THE SAVINGS APPLICATION",
getStatus(savingsStatusHashMap, "withdrawnByApplicant"));
assertTrue(getStatus(savingsStatusHashMap, "withdrawnByApplicant"),
"ERROR IN WITHDRAW THE SAVINGS APPLICATION");
LOG.info("Savings Application Status: {}", savingsStatusHashMap);
}
public static void verifySavingsAccountIsClosed(final HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS CLOSED ------------------------------------");
assertTrue("ERROR IN CLOSING THE SAVINGS APPLICATION", getStatus(savingsStatusHashMap, "closed"));
assertTrue(getStatus(savingsStatusHashMap, "closed"), "ERROR IN CLOSING THE SAVINGS APPLICATION");
LOG.info("Savings Application Status: {}", savingsStatusHashMap);
}
@@ -102,56 +102,56 @@ public class SavingsStatusChecker {
public static void verifySavingsSubStatusInactive(HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------");
assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap, "inactive"));
assertTrue(getStatus(savingsStatusHashMap, "inactive"), "UNEXPECTED SAVINGS ACCOUNT SUB STATUS");
LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
}
public static void verifySavingsSubStatusDormant(HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------");
assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap, "dormant"));
assertTrue(getStatus(savingsStatusHashMap, "dormant"), "UNEXPECTED SAVINGS ACCOUNT SUB STATUS");
LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
}
public static void verifySavingsSubStatusEscheat(HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------");
assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap, "escheat"));
assertTrue(getStatus(savingsStatusHashMap, "escheat"), "UNEXPECTED SAVINGS ACCOUNT SUB STATUS");
LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
}
public static void verifySavingsSubStatusNone(HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------");
assertTrue("UNEXPECTED SAVINGS ACCOUNT SUB STATUS", getStatus(savingsStatusHashMap, "none"));
assertTrue(getStatus(savingsStatusHashMap, "none"), "UNEXPECTED SAVINGS ACCOUNT SUB STATUS");
LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
}
public static void verifySavingsSubStatusblock(HashMap savingsStatusHashMap) {
LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS ACCOUNT IS BLOCKED ------------------------------------");
assertTrue("block", getStatus(savingsStatusHashMap, "block"));
assertTrue(getStatus(savingsStatusHashMap, "block"), "block");
LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
}
public static void verifySavingsSubStatusIsNone(HashMap savingsStatusHashMap) {
LOG.info(
"\n------------------------- VERIFYING SAVINGS ACCOUNT IS NOT BLOCKED FOR ANY TYPE OF TRANSACTIONS ---------------------------");
assertTrue("none", getStatus(savingsStatusHashMap, "none"));
assertTrue(getStatus(savingsStatusHashMap, "none"), "none");
LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
}
public static void verifySavingsSubStatusIsDebitBlocked(HashMap savingsStatusHashMap) {
LOG.info(
"\n--------------------- VERIFYING SAVINGS APPLICATION IS BLOCKED FOR DEBIT TRANSACTIONS ---------------------");
assertTrue("status is blockDebit", getStatus(savingsStatusHashMap, "blockDebit"));
assertTrue(getStatus(savingsStatusHashMap, "blockDebit"), "status is blockDebit");
LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
}
public static void verifySavingsSubStatusIsCreditBlocked(HashMap savingsStatusHashMap) {
LOG.info(
"\n---------------------- VERIFYING SAVINGS APPLICATION IS BLOCKED FOR CREDIT TRANSACTIONS ---------------");
assertTrue("blockCredit ", getStatus(savingsStatusHashMap, "blockCredit"));
assertTrue(getStatus(savingsStatusHashMap, "blockCredit"), "blockCredit ");
LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
}
@@ -35,9 +35,9 @@ import java.util.Map;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class DividendsIntegrationTests {
@@ -48,7 +48,7 @@ public class DividendsIntegrationTests {
private RequestSpecification requestSpec;
private ResponseSpecification responseSpec;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -67,16 +67,16 @@ public class DividendsIntegrationTests {
for(int i = 0 ; i < 5; i++) {
final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
clients.add(clientId) ;
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
Integer savingsAccountId = SavingsAccountHelper.openSavingsAccount(requestSpec, responseSpec, clientId, "1000");
savingAccounts.add(savingsAccountId) ;
Assert.assertNotNull(savingsAccountId);
Assertions.assertNotNull(savingsAccountId);
final Integer shareAccountId = createShareAccount(clientId, productId, savingsAccountId, dates[i], shares[i]);
shareAccounts.add(shareAccountId) ;
Assert.assertNotNull(shareAccountId);
Assertions.assertNotNull(shareAccountId);
Map<String, Object> shareAccountData = ShareAccountTransactionHelper
.retrieveShareAccount(shareAccountId, requestSpec, responseSpec);
Assert.assertNotNull(shareAccountData);
Assertions.assertNotNull(shareAccountData);
// Approve share Account
Map<String, Object> approveMap = new HashMap<>();
approveMap.put("note", "Share Account Approval Note");
@@ -104,84 +104,84 @@ public class DividendsIntegrationTests {
final Integer dividendId = ShareDividendsTransactionHelper.createShareProductDividends(productId, createDividendsJson, requestSpec, responseSpec) ;
Map<String, Object> productdividends = ShareDividendsTransactionHelper.retrieveAllDividends(productId, requestSpec, responseSpec);
Assert.assertEquals("1", String.valueOf(productdividends.get("totalFilteredRecords")));
Assertions.assertEquals("1", String.valueOf(productdividends.get("totalFilteredRecords")));
Map<String,Object> dividend = ((List<Map<String,Object>>)productdividends.get("pageItems")).get(0) ;
Assert.assertEquals("50000.0", String.valueOf(dividend.get("amount"))) ;
Assertions.assertEquals("50000.0", String.valueOf(dividend.get("amount"))) ;
Map<String, Object> status = (Map<String, Object>)dividend.get("status") ;
Assert.assertEquals("shareAccountDividendStatusType.initiated", String.valueOf(status.get("code")));
Assertions.assertEquals("shareAccountDividendStatusType.initiated", String.valueOf(status.get("code")));
List<Integer> startdateList = (List<Integer>) dividend.get("dividendPeriodStartDate");
Calendar cal = Calendar.getInstance();
cal.set(startdateList.get(0), startdateList.get(1) - 1, startdateList.get(2));
Date startDate = cal.getTime();
Assert.assertEquals("01 Jan 2015", simple.format(startDate));
Assertions.assertEquals("01 Jan 2015", simple.format(startDate));
List<Integer> enddateList = (List<Integer>) dividend.get("dividendPeriodEndDate");
cal = Calendar.getInstance();
cal.set(enddateList.get(0), enddateList.get(1) - 1, enddateList.get(2));
Date endDate = cal.getTime();
Assert.assertEquals("01 Apr 2016", simple.format(endDate));
Assertions.assertEquals("01 Apr 2016", simple.format(endDate));
Map<String, Object> dividenddetails = ShareDividendsTransactionHelper.retrieveDividendDetails(productId, dividendId, requestSpec, responseSpec) ;
Assert.assertEquals("5", String.valueOf(dividenddetails.get("totalFilteredRecords")));
Assertions.assertEquals("5", String.valueOf(dividenddetails.get("totalFilteredRecords")));
List<Map<String, Object>> pageItems = (List<Map<String, Object>>)dividenddetails.get("pageItems") ;
for(Map<String, Object> dividendData: pageItems) {
Map<String, Object> accountData = (Map<String, Object>) dividendData.get("accountData") ;
String accountId = String.valueOf(accountData.get("id")) ;
if(String.valueOf(shareAccounts.get(0)).equals(accountId)) {
Assert.assertEquals("11320.755", String.valueOf(dividendData.get("amount")));
Assertions.assertEquals("11320.755", String.valueOf(dividendData.get("amount")));
}else if(String.valueOf(shareAccounts.get(1)).equals(accountId)) {
Assert.assertEquals("18172.791", String.valueOf(dividendData.get("amount")));
Assertions.assertEquals("18172.791", String.valueOf(dividendData.get("amount")));
}else if(String.valueOf(shareAccounts.get(2)).equals(accountId)) {
Assert.assertEquals("13629.593", String.valueOf(dividendData.get("amount")));
Assertions.assertEquals("13629.593", String.valueOf(dividendData.get("amount")));
}else if(String.valueOf(shareAccounts.get(3)).equals(accountId)) {
Assert.assertEquals("3028.7983", String.valueOf(dividendData.get("amount")));
Assertions.assertEquals("3028.7983", String.valueOf(dividendData.get("amount")));
}else if(String.valueOf(shareAccounts.get(4)).equals(accountId)) {
Assert.assertEquals("3848.0637", String.valueOf(dividendData.get("amount")));
Assertions.assertEquals("3848.0637", String.valueOf(dividendData.get("amount")));
}
Map<String, Object> statusMap = (Map<String, Object>) dividendData.get("status") ;
Assert.assertEquals("shareAccountDividendStatusType.initiated", String.valueOf(statusMap.get("code"))) ;
Assertions.assertEquals("shareAccountDividendStatusType.initiated", String.valueOf(statusMap.get("code"))) ;
}
String jsonString = "" ;
ShareDividendsTransactionHelper.postCommand("approve", productId, dividendId, jsonString, requestSpec, responseSpec) ;
productdividends = ShareDividendsTransactionHelper.retrieveAllDividends(productId, requestSpec, responseSpec);
Assert.assertEquals("1", String.valueOf(productdividends.get("totalFilteredRecords")));
Assertions.assertEquals("1", String.valueOf(productdividends.get("totalFilteredRecords")));
dividend = ((List<Map<String,Object>>)productdividends.get("pageItems")).get(0) ;
Assert.assertEquals("50000.0", String.valueOf(dividend.get("amount"))) ;
Assertions.assertEquals("50000.0", String.valueOf(dividend.get("amount"))) ;
status = (Map<String, Object>)dividend.get("status") ;
Assert.assertEquals("shareAccountDividendStatusType.approved", String.valueOf(status.get("code")));
Assertions.assertEquals("shareAccountDividendStatusType.approved", String.valueOf(status.get("code")));
startdateList = (List<Integer>) dividend.get("dividendPeriodStartDate");
cal = Calendar.getInstance();
cal.set(startdateList.get(0), startdateList.get(1) - 1, startdateList.get(2));
startDate = cal.getTime();
Assert.assertEquals("01 Jan 2015", simple.format(startDate));
Assertions.assertEquals("01 Jan 2015", simple.format(startDate));
enddateList = (List<Integer>) dividend.get("dividendPeriodEndDate");
cal = Calendar.getInstance();
cal.set(enddateList.get(0), enddateList.get(1) - 1, enddateList.get(2));
endDate = cal.getTime();
Assert.assertEquals("01 Apr 2016", simple.format(endDate));
Assertions.assertEquals("01 Apr 2016", simple.format(endDate));
dividenddetails = ShareDividendsTransactionHelper.retrieveDividendDetails(productId, dividendId, requestSpec, responseSpec) ;
Assert.assertEquals("5", String.valueOf(dividenddetails.get("totalFilteredRecords")));
Assertions.assertEquals("5", String.valueOf(dividenddetails.get("totalFilteredRecords")));
pageItems = (List<Map<String, Object>>)dividenddetails.get("pageItems") ;
for(Map<String, Object> dividendData: pageItems) {
Map<String, Object> accountData = (Map<String, Object>) dividendData.get("accountData") ;
String accountId = String.valueOf(accountData.get("id")) ;
if(String.valueOf(shareAccounts.get(0)).equals(accountId)) {
Assert.assertEquals("11320.755", String.valueOf(dividendData.get("amount")));
Assertions.assertEquals("11320.755", String.valueOf(dividendData.get("amount")));
}else if(String.valueOf(shareAccounts.get(1)).equals(accountId)) {
Assert.assertEquals("18172.791", String.valueOf(dividendData.get("amount")));
Assertions.assertEquals("18172.791", String.valueOf(dividendData.get("amount")));
}else if(String.valueOf(shareAccounts.get(2)).equals(accountId)) {
Assert.assertEquals("13629.593", String.valueOf(dividendData.get("amount")));
Assertions.assertEquals("13629.593", String.valueOf(dividendData.get("amount")));
}else if(String.valueOf(shareAccounts.get(3)).equals(accountId)) {
Assert.assertEquals("3028.7983", String.valueOf(dividendData.get("amount")));
Assertions.assertEquals("3028.7983", String.valueOf(dividendData.get("amount")));
}else if(String.valueOf(shareAccounts.get(4)).equals(accountId)) {
Assert.assertEquals("3848.0637", String.valueOf(dividendData.get("amount")));
Assertions.assertEquals("3848.0637", String.valueOf(dividendData.get("amount")));
}
Map<String, Object> statusMap = (Map<String, Object>) dividendData.get("status") ;
Assert.assertEquals("shareAccountDividendStatusType.initiated", String.valueOf(statusMap.get("code"))) ;
Assertions.assertEquals("shareAccountDividendStatusType.initiated", String.valueOf(statusMap.get("code"))) ;
}
}
@@ -28,7 +28,7 @@ import java.util.Map;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.integrationtests.common.Utils;
import org.joda.time.LocalDate;
import org.junit.Assert;
import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -134,61 +134,61 @@ public class ShareProductHelper {
@SuppressWarnings("unchecked")
public void verifyShareProduct(Map<String, Object> shareProductData) {
String productName = (String)shareProductData.get("name") ;
Assert.assertEquals(this.productName, productName);
Assertions.assertEquals(this.productName, productName);
String shortName = (String)shareProductData.get("shortName") ;
Assert.assertEquals(this.shortName, shortName);
Assertions.assertEquals(this.shortName, shortName);
String description = (String)shareProductData.get("description") ;
Assert.assertEquals(this.description, description);
Assertions.assertEquals(this.description, description);
Map<String, String> currency = (Map<String,String>)shareProductData.get("currency") ;
String currencyCode = currency.get("code") ;
Assert.assertEquals(this.currencyCode, currencyCode);
Assertions.assertEquals(this.currencyCode, currencyCode);
String digitsAfterDecimal = String.valueOf(currency.get("decimalPlaces")) ;
Assert.assertEquals(DIGITS_AFTER_DECIMAL, digitsAfterDecimal);
Assertions.assertEquals(DIGITS_AFTER_DECIMAL, digitsAfterDecimal);
String inMultiplesOf = String.valueOf(currency.get("inMultiplesOf")) ;
Assert.assertEquals(IN_MULTIPLES_OF, inMultiplesOf);
Assertions.assertEquals(IN_MULTIPLES_OF, inMultiplesOf);
String totalShares = String.valueOf(shareProductData.get("totalShares")) ;
Assert.assertEquals(this.totalShares, totalShares);
Assertions.assertEquals(this.totalShares, totalShares);
String sharesIssued = String.valueOf(shareProductData.get("totalSharesIssued")) ;
Assert.assertEquals(this.sharesIssued, sharesIssued);
Assertions.assertEquals(this.sharesIssued, sharesIssued);
String unitPrice = String.valueOf(shareProductData.get("unitPrice")) ;
Assert.assertEquals(this.unitPrice, unitPrice);
Assertions.assertEquals(this.unitPrice, unitPrice);
String minimumShares = String.valueOf(shareProductData.get("minimumShares")) ;
Assert.assertEquals(this.minimumShares, minimumShares);
Assertions.assertEquals(this.minimumShares, minimumShares);
String nominalShares = String.valueOf(shareProductData.get("nominalShares")) ;
Assert.assertEquals(this.nominalShares, nominalShares);
Assertions.assertEquals(this.nominalShares, nominalShares);
String maximumShares = String.valueOf(shareProductData.get("maximumShares")) ;
Assert.assertEquals(this.maximumShares, maximumShares);
Assertions.assertEquals(this.maximumShares, maximumShares);
String allowDividendCalculationForInactiveClients = String.valueOf(shareProductData.get("allowDividendCalculationForInactiveClients")) ;
Assert.assertEquals(this.allowDividendCalculationForInactiveClients, allowDividendCalculationForInactiveClients);
Assertions.assertEquals(this.allowDividendCalculationForInactiveClients, allowDividendCalculationForInactiveClients);
Map<String, Object> accountingRuleMap = (Map<String, Object>) shareProductData.get("accountingRule") ;
String accountingRule = String.valueOf(accountingRuleMap.get("id")) ;
Assert.assertEquals(this.accountingRule, accountingRule);
Assertions.assertEquals(this.accountingRule, accountingRule);
String minimumActivePeriodForDividends = String.valueOf(shareProductData.get("minimumActivePeriod")) ;
Assert.assertEquals(this.minimumActivePeriodForDividends, minimumActivePeriodForDividends);
Assertions.assertEquals(this.minimumActivePeriodForDividends, minimumActivePeriodForDividends);
Map<String, Object> minimumActivePeriodType = (Map<String, Object>) shareProductData.get("minimumActivePeriodForDividendsTypeEnum") ;
String minimumactiveperiodFrequencyType = String.valueOf(minimumActivePeriodType.get("id")) ;
Assert.assertEquals(this.minimumactiveperiodFrequencyType, minimumactiveperiodFrequencyType);
Assertions.assertEquals(this.minimumactiveperiodFrequencyType, minimumactiveperiodFrequencyType);
String lockinPeriodFrequency = String.valueOf(shareProductData.get("lockinPeriod")) ;
Assert.assertEquals(this.lockinPeriodFrequency, lockinPeriodFrequency);
Assertions.assertEquals(this.lockinPeriodFrequency, lockinPeriodFrequency);
Map<String, Object> lockinPeriodType = (Map<String, Object>) shareProductData.get("lockPeriodTypeEnum") ;
String lockinPeriodFrequencyType = String.valueOf(lockinPeriodType.get("id")) ;
Assert.assertEquals(this.lockinPeriodFrequencyType, lockinPeriodFrequencyType);
Assertions.assertEquals(this.lockinPeriodFrequencyType, lockinPeriodFrequencyType);
//ArrayList<Map<String, String>> charges = (ArrayList<Map<String, String>>)shareProductData.get("chargesSelected") ;
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.integrationtests.common.system;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import io.restassured.specification.RequestSpecification;
@@ -49,9 +49,9 @@ import org.apache.fineract.interoperation.util.InteropUtil;
import org.apache.fineract.interoperation.util.MathUtil;
import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
import org.apache.fineract.portfolio.savings.SavingsApiConstants;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -82,7 +82,7 @@ public class InteropTest {
private String quoteCode;
private String transferCode;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -115,7 +115,7 @@ public class InteropTest {
private void createClient() {
clientId = ClientHelper.createClient(requestSpec, responseSpec);
Assert.assertNotNull(clientId);
Assertions.assertNotNull(clientId);
}
private void createSavingsProduct() {
@@ -138,7 +138,7 @@ public class InteropTest {
.withAccountingRuleAsCashBased(accounts)
.build();
savingsProductId = SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
Assert.assertNotNull(savingsProductId);
Assertions.assertNotNull(savingsProductId);
LOG.debug("Sucessfully created Interoperable Saving Product (id: {})", savingsProductId);
}
@@ -146,13 +146,13 @@ public class InteropTest {
private void createCharge() {
chargeId = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getSavingsJSON(interopHelper.getFee().toString(),
interopHelper.getCurrency(), ChargeTimeType.WITHDRAWAL_FEE));
Assert.assertNotNull(chargeId);
Assertions.assertNotNull(chargeId);
}
private void openSavingsAccount() {
LOG.debug("------------------------------ Create Interoperable Saving Account ---------------------------------------");
savingsId = savingsAccountHelper.applyForSavingsApplicationWithExternalId(clientId, savingsProductId, ACCOUNT_TYPE_INDIVIDUAL, interopHelper.getAccountExternalId(), true);
Assert.assertNotNull(savingsId);
Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -173,22 +173,22 @@ public class InteropTest {
private void testParties() {
String idValue = UUID.randomUUID().toString();
String accountId = interopHelper.postParty(InteropIdentifierType.MSISDN, idValue);
Assert.assertEquals(interopHelper.getAccountExternalId(), accountId);
Assertions.assertEquals(interopHelper.getAccountExternalId(), accountId);
interopHelper.setResponseSpec(responseErrorSpec);
accountId = interopHelper.postParty(InteropIdentifierType.MSISDN, idValue);
Assert.assertNull(accountId);
Assertions.assertNull(accountId);
interopHelper.setResponseSpec(responseSpec);
accountId = interopHelper.getParty(InteropIdentifierType.MSISDN, idValue);
Assert.assertEquals(interopHelper.getAccountExternalId(), accountId);
Assertions.assertEquals(interopHelper.getAccountExternalId(), accountId);
accountId = interopHelper.deleteParty(InteropIdentifierType.MSISDN, idValue);
Assert.assertEquals(interopHelper.getAccountExternalId(), accountId);
Assertions.assertEquals(interopHelper.getAccountExternalId(), accountId);
interopHelper.setResponseSpec(responseErrorSpec);
accountId = interopHelper.getParty(InteropIdentifierType.MSISDN, idValue);
Assert.assertNull(accountId);
Assertions.assertNull(accountId);
interopHelper.setResponseSpec(responseSpec);
}
@@ -196,8 +196,8 @@ public class InteropTest {
requestCode = UUID.randomUUID().toString();
String response = interopHelper.postTransactionRequest(requestCode, InteropTransactionRole.PAYER);
JsonPath json = JsonPath.from(response);
Assert.assertEquals(requestCode, json.getString(InteropUtil.PARAM_REQUEST_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
Assertions.assertEquals(requestCode, json.getString(InteropUtil.PARAM_REQUEST_CODE));
Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
interopHelper.setResponseSpec(responseClientErrorSpec);
interopHelper.postTransactionRequest(requestCode, InteropTransactionRole.PAYEE);
@@ -209,25 +209,25 @@ public class InteropTest {
quoteCode = UUID.randomUUID().toString();
String response = interopHelper.postQuote(quoteCode, InteropTransactionRole.PAYER);
JsonPath json = JsonPath.from(response);
Assert.assertEquals(quoteCode, json.getString(InteropUtil.PARAM_QUOTE_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
Assertions.assertEquals(quoteCode, json.getString(InteropUtil.PARAM_QUOTE_CODE));
Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
Map<Object, Object> fee = json.getMap(InteropUtil.PARAM_FSP_FEE);
Assert.assertNotNull(fee);
Assertions.assertNotNull(fee);
BigDecimal feeAmount = ObjectConverter.convertObjectTo(fee.get(InteropUtil.PARAM_AMOUNT), BigDecimal.class);
Assert.assertTrue("Quote fee expected: " + interopHelper.getFee() + ", actual: " + feeAmount, MathUtil.isEqualTo(interopHelper.getFee(), feeAmount));
Assert.assertEquals(interopHelper.getCurrency(), fee.get(InteropUtil.PARAM_CURRENCY));
Assertions.assertTrue(MathUtil.isEqualTo(interopHelper.getFee(), feeAmount), "Quote fee expected: " + interopHelper.getFee() + ", actual: " + feeAmount);
Assertions.assertEquals(interopHelper.getCurrency(), fee.get(InteropUtil.PARAM_CURRENCY));
// payee
response = interopHelper.postQuote(quoteCode, InteropTransactionRole.PAYEE);
json = JsonPath.from(response);
Assert.assertEquals(quoteCode, json.getString(InteropUtil.PARAM_QUOTE_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
Assertions.assertEquals(quoteCode, json.getString(InteropUtil.PARAM_QUOTE_CODE));
Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
fee = json.getMap(InteropUtil.PARAM_FSP_FEE);
if (fee != null) {
feeAmount = ObjectConverter.convertObjectTo(fee.get(InteropUtil.PARAM_AMOUNT), BigDecimal.class);
Assert.assertTrue("PAYEE Quote fee expected: " + BigDecimal.ZERO + ", actual: " + feeAmount, MathUtil.isZero(feeAmount));
Assertions.assertTrue(MathUtil.isZero(feeAmount), "PAYEE Quote fee expected: " + BigDecimal.ZERO + ", actual: " + feeAmount);
}
}
@@ -240,8 +240,8 @@ public class InteropTest {
transferCode = UUID.randomUUID().toString();
String response = interopHelper.prepareTransfer(transferCode);
JsonPath json = JsonPath.from(response);
Assert.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
Assertions.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE));
Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
// prepare
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
@@ -252,29 +252,29 @@ public class InteropTest {
BigDecimal transferAmount = interopHelper.getTransferAmount();
BigDecimal expectedHold = MathUtil.add(onHold, transferAmount, MATHCONTEXT);
Assert.assertTrue("On hold amount expected: " + expectedHold + ", actual: " + onHold2, MathUtil.isEqualTo(expectedHold, onHold2));
Assertions.assertTrue(MathUtil.isEqualTo(expectedHold, onHold2), "On hold amount expected: " + expectedHold + ", actual: " + onHold2);
BigDecimal expectedBalance = MathUtil.subtract(balance, transferAmount, MATHCONTEXT);
Assert.assertTrue("Balance amount expected: " + expectedBalance + ", actual: " + balance2, MathUtil.isEqualTo(expectedBalance, balance2));
Assertions.assertTrue(MathUtil.isEqualTo(expectedBalance, balance2), "Balance amount expected: " + expectedBalance + ", actual: " + balance2);
// payer
response = interopHelper.createTransfer(transferCode, InteropTransactionRole.PAYER);
json = JsonPath.from(response);
Assert.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
Assertions.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE));
Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
LOG.debug("Response Interoperable GET Saving: {}", savings);
savingsJson = JsonPath.from(savings);
BigDecimal onHold3 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class);
BigDecimal balance3 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class);
Assert.assertTrue("On hold amount expected: " + onHold + ", actual: " + onHold3, MathUtil.isEqualTo(onHold, onHold3));
Assert.assertTrue("Balance amount expected: " + expectedBalance + ", actual: " + balance3, MathUtil.isEqualTo(expectedBalance, balance3));
Assertions.assertTrue(MathUtil.isEqualTo(onHold, onHold3), "On hold amount expected: " + onHold + ", actual: " + onHold3);
Assertions.assertTrue(MathUtil.isEqualTo(expectedBalance, balance3), "Balance amount expected: " + expectedBalance + ", actual: " + balance3);
// payee
response = interopHelper.createTransfer(transferCode, InteropTransactionRole.PAYEE);
json = JsonPath.from(response);
Assert.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
Assertions.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE));
Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
LOG.debug("Response Interoperable GET Saving: {}", savings);
@@ -282,7 +282,7 @@ public class InteropTest {
BigDecimal onHold4 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class);
BigDecimal balance4 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class);
expectedBalance = MathUtil.subtract(balance, interopHelper.getFee(), MATHCONTEXT);
Assert.assertTrue("On hold amount expected: " + onHold + ", actual: " + onHold4, MathUtil.isEqualTo(onHold, onHold4));
Assert.assertTrue("Balance amount expected: " + expectedBalance + ", actual: " + balance4, MathUtil.isEqualTo(balance, balance4));
Assertions.assertTrue(MathUtil.isEqualTo(onHold, onHold4), "On hold amount expected: " + onHold + ", actual: " + onHold4);
Assertions.assertTrue(MathUtil.isEqualTo(balance, balance4), "Balance amount expected: " + expectedBalance + ", actual: " + balance4);
}
}
@@ -18,9 +18,9 @@
*/
package org.apache.fineract.integrationtests.loanaccount.guarantor;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
@@ -42,9 +42,9 @@ import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -62,7 +62,7 @@ public class GuarantorTest {
private final Float external1_guarantee = Float.valueOf((float)2000);
private final Float external2_guarantee = Float.valueOf((float)1000);
@Before
@BeforeEach
public void setUp() throws Exception {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -100,17 +100,17 @@ public class GuarantorTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -7 * 4);
String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
String guarantorJSON = new GuarantorTestBuilder().externalCustomer().build();
Integer externalGuarantor = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
Assert.assertNotNull(externalGuarantor);
Assertions.assertNotNull(externalGuarantor);
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithoutGuaranteeAmount(String.valueOf(clientID_external)).build();
Integer withoutGuaranteeAmount = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
Assert.assertNotNull(withoutGuaranteeAmount);
Assertions.assertNotNull(withoutGuaranteeAmount);
ArrayList<HashMap> errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR);
@@ -122,7 +122,7 @@ public class GuarantorTest {
String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build();
Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(selfSavigsId, null);
Assert.assertNotNull(selfGuarantee);
Assertions.assertNotNull(selfGuarantee);
errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR);
@@ -134,7 +134,7 @@ public class GuarantorTest {
String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build();
Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_1, null);
Assert.assertNotNull(externalGuarantee_1);
Assertions.assertNotNull(externalGuarantee_1);
errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR);
@@ -146,7 +146,7 @@ public class GuarantorTest {
String.valueOf(externalSavigsId_2), String.valueOf(external2_guarantee)).build();
Integer externalGuarantee_2 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_2, null);
Assert.assertNotNull(externalGuarantee_2);
Assertions.assertNotNull(externalGuarantee_2);
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID);
@@ -257,17 +257,17 @@ public class GuarantorTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -7 * 4);
String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
String guarantorJSON = new GuarantorTestBuilder().externalCustomer().build();
Integer externalGuarantor = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
Assert.assertNotNull(externalGuarantor);
Assertions.assertNotNull(externalGuarantor);
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithoutGuaranteeAmount(String.valueOf(clientID_external)).build();
Integer withoutGuaranteeAmount = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
Assert.assertNotNull(withoutGuaranteeAmount);
Assertions.assertNotNull(withoutGuaranteeAmount);
ArrayList<HashMap> errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR);
@@ -279,7 +279,7 @@ public class GuarantorTest {
String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build();
Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(selfSavigsId, null);
Assert.assertNotNull(selfGuarantee);
Assertions.assertNotNull(selfGuarantee);
errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR);
@@ -291,7 +291,7 @@ public class GuarantorTest {
String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build();
Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_1, null);
Assert.assertNotNull(externalGuarantee_1);
Assertions.assertNotNull(externalGuarantee_1);
errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR);
@@ -302,7 +302,7 @@ public class GuarantorTest {
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external2),
String.valueOf(externalSavigsId_2), String.valueOf(external2_guarantee)).build();
Integer externalGuarantee_2 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
Assert.assertNotNull(externalGuarantee_2);
Assertions.assertNotNull(externalGuarantee_2);
verifySavingsOnHoldBalance(externalSavigsId_2, null);
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
@@ -349,7 +349,7 @@ public class GuarantorTest {
String.valueOf(externalSavigsId_3), String.valueOf(external1_guarantee)).build();
Integer externalGuarantee_3 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_3, external1_guarantee);
Assert.assertNotNull(externalGuarantee_3);
Assertions.assertNotNull(externalGuarantee_3);
this.guarantorHelper.deleteGuarantor(externalGuarantee_1, fundDetailId, loanID);
guarantors = this.guarantorHelper.getAllGuarantor(loanID);
@@ -443,7 +443,7 @@ public class GuarantorTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -21);
String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -451,13 +451,13 @@ public class GuarantorTest {
String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build();
Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(selfSavigsId, null);
Assert.assertNotNull(selfGuarantee);
Assertions.assertNotNull(selfGuarantee);
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external),
String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build();
Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_1, null);
Assert.assertNotNull(externalGuarantee_1);
Assertions.assertNotNull(externalGuarantee_1);
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID);
@@ -516,7 +516,7 @@ public class GuarantorTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -21);
String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -524,13 +524,13 @@ public class GuarantorTest {
String.valueOf(selfSavigsId), String.valueOf(selfguarantee)).build();
Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(selfSavigsId, null);
Assert.assertNotNull(selfGuarantee);
Assertions.assertNotNull(selfGuarantee);
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external),
String.valueOf(externalSavigsId_1), String.valueOf(externalguarantee)).build();
Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_1, null);
Assert.assertNotNull(externalGuarantee_1);
Assertions.assertNotNull(externalGuarantee_1);
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID);
@@ -585,7 +585,7 @@ public class GuarantorTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -21);
String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE);
Assert.assertNotNull(loanID);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -593,12 +593,12 @@ public class GuarantorTest {
String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build();
Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(selfSavigsId, null);
Assert.assertNotNull(selfGuarantee);
Assertions.assertNotNull(selfGuarantee);
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external),
String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build();
Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
Assert.assertNotNull(externalGuarantee_1);
Assertions.assertNotNull(externalGuarantee_1);
verifySavingsOnHoldBalance(externalSavigsId_1, null);
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
@@ -635,15 +635,15 @@ public class GuarantorTest {
private void verifySavingsOnHoldBalance(final Integer savingsId, final Float expectedBalance) {
Float onHoldAmount = (Float) this.savingsAccountHelper.getSavingsDetails(savingsId, "onHoldFunds");
assertEquals("Verifying On Hold Funds", expectedBalance, onHoldAmount);
assertEquals(expectedBalance, onHoldAmount, "Verifying On Hold Funds");
}
@SuppressWarnings({ "rawtypes", "cast" })
private void verifySavingsBalanceAndOnHoldBalance(final Integer savingsId, final Float expectedBalance, final Float accountBalance) {
HashMap savingsDetails = (HashMap) this.savingsAccountHelper.getSavingsDetails(savingsId);
assertEquals("Verifying On Hold Funds", expectedBalance, savingsDetails.get("onHoldFunds"));
assertEquals(expectedBalance, savingsDetails.get("onHoldFunds"), "Verifying On Hold Funds");
HashMap summary = (HashMap) savingsDetails.get("summary");
assertEquals("Verifying Account balance", accountBalance, summary.get("accountBalance"));
assertEquals(accountBalance, summary.get("accountBalance"), "Verifying Account balance");
}
@SuppressWarnings("rawtypes")
@@ -30,9 +30,9 @@ import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -44,7 +44,7 @@ public class VariableInstallmentsIntegrationTest {
private ResponseSpecification responseSpec;
private LoanTransactionHelper loanTransactionHelper;
@Before
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -59,9 +59,9 @@ public class VariableInstallmentsIntegrationTest {
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(json);
LOG.info("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------");
Map loanProduct = (Map)loanTransactionHelper.getLoanProductDetail(requestSpec, responseSpec, loanProductID, "") ;
Assert.assertTrue((Boolean)loanProduct.get("allowVariableInstallments")) ;
Assert.assertEquals(Integer.valueOf(5), loanProduct.get("minimumGap")) ;
Assert.assertEquals(Integer.valueOf(90), loanProduct.get("maximumGap")) ;
Assertions.assertTrue((Boolean)loanProduct.get("allowVariableInstallments")) ;
Assertions.assertEquals(Integer.valueOf(5), loanProduct.get("minimumGap")) ;
Assertions.assertEquals(Integer.valueOf(90), loanProduct.get("maximumGap")) ;
}
@@ -71,7 +71,7 @@ public class VariableInstallmentsIntegrationTest {
Integer loanProductID = this.loanTransactionHelper.getLoanProductId(josn);
LOG.info("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------");
Map loanProduct = (Map)loanTransactionHelper.getLoanProductDetail(requestSpec, responseSpec, loanProductID, "") ;
Assert.assertTrue(!(Boolean)loanProduct.get("allowVariableInstallments")) ;
Assertions.assertTrue(!(Boolean)loanProduct.get("allowVariableInstallments")) ;
}
@Test
@@ -106,12 +106,12 @@ public class VariableInstallmentsIntegrationTest {
}
private void assertAfterSubmit(ArrayList<Map> serverData, ArrayList<Map> expectedData) {
Assert.assertTrue(serverData.size() == expectedData.size()) ;
Assertions.assertTrue(serverData.size() == expectedData.size()) ;
for(int i = 0 ; i < serverData.size(); i++) {
Map<String, Object> serverMap = serverData.get(i) ;
Map<String, Object> expectedMap = expectedData.get(i) ;
Assert.assertTrue(VariableInstallmentsDecliningBalanceHelper.formatDate((ArrayList)serverMap.get("dueDate")).equals(expectedMap.get("dueDate"))) ;
Assert.assertTrue(serverMap.get("totalOutstandingForPeriod").toString().equals(expectedMap.get("installmentAmount"))) ;
Assertions.assertTrue(VariableInstallmentsDecliningBalanceHelper.formatDate((ArrayList)serverMap.get("dueDate")).equals(expectedMap.get("dueDate"))) ;
Assertions.assertTrue(serverMap.get("totalOutstandingForPeriod").toString().equals(expectedMap.get("installmentAmount"))) ;
}
}

Some files were not shown because too many files have changed in this diff Show More