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. 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. 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 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. 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. 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. 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 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
dependency 'org.apache.activemq:activemq-broker:5.15.13' dependency 'org.apache.activemq:activemq-broker:5.15.13'
dependency 'org.apache.bval:org.apache.bval.bundle:2.0.3' 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-core:3.3.3'
dependency 'org.mockito:mockito-junit-jupiter:3.3.3'
dependency 'io.github.classgraph:classgraph:4.8.86' dependency 'io.github.classgraph:classgraph:4.8.86'
dependency 'org.awaitility:awaitility:4.0.3' dependency 'org.awaitility:awaitility:4.0.3'
dependency 'com.github.spotbugs:spotbugs-annotations:4.0.4' 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. // 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! // Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly!
// //
testImplementation( 'junit:junit', testImplementation( 'org.mockito:mockito-core',
'org.junit.platform:junit-platform-runner', // FINERACT-943 'org.mockito:mockito-junit-jupiter',
'org.mockito:mockito-core',
'io.github.classgraph:classgraph', 'io.github.classgraph:classgraph',
'org.awaitility:awaitility' 'org.awaitility:awaitility'
) )
@@ -129,5 +128,6 @@ dependencies {
} }
testImplementation ('org.springframework.boot:spring-boot-starter-test') { testImplementation ('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'com.jayway.jsonpath', module: 'json-path' 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.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.system.AccountNumberPreferencesHelper; import org.apache.fineract.integrationtests.common.system.AccountNumberPreferencesHelper;
import org.apache.fineract.integrationtests.common.system.CodeHelper; import org.apache.fineract.integrationtests.common.system.CodeHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -88,7 +88,7 @@ public class AccountNumberPreferencesTest {
private Integer centerId; private Integer centerId;
private String groupAccountNo; private String groupAccountNo;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -159,7 +159,7 @@ public class AccountNumberPreferencesTest {
HashMap<String, Object> deletionError = this.accountNumberPreferencesHelper.deleteAccountNumberPreference(10, HashMap<String, Object> deletionError = this.accountNumberPreferencesHelper.deleteAccountNumberPreference(10,
this.responseNotFoundError, ""); 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() { private void validateDefaultAccountNumberGeneration() {
@@ -216,7 +216,7 @@ public class AccountNumberPreferencesTest {
HashMap<String, Object> creationError = this.accountNumberPreferencesHelper.createAccountNumberPreferenceWithInvalidData( HashMap<String, Object> creationError = this.accountNumberPreferencesHelper.createAccountNumberPreferenceWithInvalidData(
this.responseForbiddenError, accountType, prefixType, ""); 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)); creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
} }
@@ -231,11 +231,11 @@ public class AccountNumberPreferencesTest {
if (creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).equals( if (creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).equals(
"validation.msg.accountNumberFormat.accountType.is.not.within.expected.range")) { "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)); creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
} else if (creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).equals( } else if (creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).equals(
"validation.msg.accountNumberFormat.prefixType.is.not.one.of.expected.enumerations")) { "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)); creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
} }
} }
@@ -257,13 +257,13 @@ public class AccountNumberPreferencesTest {
HashMap<String, Object> updationError = this.accountNumberPreferencesHelper.updateAccountNumberPreference(9999, "101", HashMap<String, Object> updationError = this.accountNumberPreferencesHelper.updateAccountNumberPreference(9999, "101",
this.responseNotFoundError, ""); this.responseNotFoundError, "");
if (updationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).equals("error.msg.resource.not.found")) { 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 */ /* Invalid Prefix Type */
HashMap<String, Object> updationError1 = this.accountNumberPreferencesHelper.updateAccountNumberPreference( HashMap<String, Object> updationError1 = this.accountNumberPreferencesHelper.updateAccountNumberPreference(
this.clientAccountNumberPreferenceId, "103", this.responseValidationError, ""); 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()); String name = "CenterCreation" + new Timestamp(new java.util.Date().getTime());
this.centerId = CenterHelper.createCenter(name, officeId, requestSpec, responseSpec); this.centerId = CenterHelper.createCenter(name, officeId, requestSpec, responseSpec);
CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec); CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec);
Assert.assertNotNull(center); Assertions.assertNotNull(center);
Assert.assertTrue(center.getName().equals(name)); Assertions.assertTrue(center.getName().equals(name));
if (isAccountPreferenceSetUp) { if (isAccountPreferenceSetUp) {
String centerPrefixName = (String) this.accountNumberPreferencesHelper.getAccountNumberPreference( String centerPrefixName = (String) this.accountNumberPreferencesHelper.getAccountNumberPreference(
@@ -329,7 +329,7 @@ public class AccountNumberPreferencesTest {
private void createAndValidateClientWithoutAccountPreference() { private void createAndValidateClientWithoutAccountPreference() {
this.clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); 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"); String clientAccountNo = (String) ClientHelper.getClient(requestSpec, responseSpec, this.clientId.toString(), "accountNo");
validateAccountNumberLengthAndStartsWithPrefix(clientAccountNo, null); validateAccountNumberLengthAndStartsWithPrefix(clientAccountNo, null);
} }
@@ -356,14 +356,14 @@ public class AccountNumberPreferencesTest {
this.clientId = ClientHelper.createClientForAccountPreference(this.requestSpec, this.responseSpec, this.clientCodeValueId, this.clientId = ClientHelper.createClientForAccountPreference(this.requestSpec, this.responseSpec, this.clientCodeValueId,
"clientId"); "clientId");
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
clientAccountNo = (String) ClientHelper.getClient(this.requestSpec, this.responseSpec, this.clientId.toString(), "accountNo"); clientAccountNo = (String) ClientHelper.getClient(this.requestSpec, this.responseSpec, this.clientId.toString(), "accountNo");
this.validateAccountNumberLengthAndStartsWithPrefix(clientAccountNo, this.clientCodeValueName); this.validateAccountNumberLengthAndStartsWithPrefix(clientAccountNo, this.clientCodeValueName);
} else if (clientPrefixName.equals(this.officeName)) { } else if (clientPrefixName.equals(this.officeName)) {
this.clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); this.clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
clientAccountNo = (String) ClientHelper.getClient(requestSpec, responseSpec, this.clientId.toString(), "accountNo"); clientAccountNo = (String) ClientHelper.getClient(requestSpec, responseSpec, this.clientId.toString(), "accountNo");
String officeName = (String) ClientHelper.getClient(requestSpec, responseSpec, this.clientId.toString(), "officeName"); String officeName = (String) ClientHelper.getClient(requestSpec, responseSpec, this.clientId.toString(), "officeName");
this.validateAccountNumberLengthAndStartsWithPrefix(clientAccountNo, officeName); this.validateAccountNumberLengthAndStartsWithPrefix(clientAccountNo, officeName);
@@ -373,10 +373,10 @@ public class AccountNumberPreferencesTest {
private void validateAccountNumberLengthAndStartsWithPrefix(final String accountNumber, String prefix) { private void validateAccountNumberLengthAndStartsWithPrefix(final String accountNumber, String prefix) {
if (prefix != null) { if (prefix != null) {
prefix = prefix.substring(0, Math.min(prefix.length(), 10)); prefix = prefix.substring(0, Math.min(prefix.length(), 10));
Assert.assertEquals(accountNumber.length(), prefix.length() + 9); Assertions.assertEquals(accountNumber.length(), prefix.length() + 9);
Assert.assertTrue(accountNumber.startsWith(prefix)); Assertions.assertTrue(accountNumber.startsWith(prefix));
} else { } else {
Assert.assertEquals(9, accountNumber.length()); Assertions.assertEquals(9, accountNumber.length());
} }
} }
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper; import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker; import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -87,7 +87,7 @@ public class AccountTransferTest {
private Integer financialActivityAccountId; private Integer financialActivityAccountId;
private Account liabilityTransferAccount; private Account liabilityTransferAccount;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -102,13 +102,13 @@ public class AccountTransferTest {
/** Setup liability transfer account **/ /** Setup liability transfer account **/
/** Create a Liability and an Asset Transfer Account **/ /** Create a Liability and an Asset Transfer Account **/
liabilityTransferAccount = accountHelper.createLiabilityAccount(); liabilityTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(liabilityTransferAccount); Assertions.assertNotNull(liabilityTransferAccount);
/*** Create A Financial Activity to Account Mapping **/ /*** Create A Financial Activity to Account Mapping **/
financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount( financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
FinancialActivityAccountsTest.LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount.getAccountID(), FinancialActivityAccountsTest.LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount.getAccountID(),
responseSpec, CommonConstants.RESPONSE_RESOURCE_ID); responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId); Assertions.assertNotNull(financialActivityAccountId);
} else { } else {
for (HashMap financialActivity : financialActivities) { for (HashMap financialActivity : financialActivities) {
HashMap financialActivityData = (HashMap) financialActivity.get("financialActivityData"); HashMap financialActivityData = (HashMap) financialActivity.get("financialActivityData");
@@ -125,12 +125,12 @@ public class AccountTransferTest {
/** /**
* Delete the Liability transfer account * Delete the Liability transfer account
*/ */
@After @AfterEach
public void tearDown() { public void tearDown() {
Integer deletedFinancialActivityAccountId = financialActivityAccountHelper.deleteFinancialActivityAccount( Integer deletedFinancialActivityAccountId = financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, responseSpec, CommonConstants.RESPONSE_RESOURCE_ID); financialActivityAccountId, responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId); Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId); Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
} }
@Test @Test
@@ -145,20 +145,20 @@ public class AccountTransferTest {
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec); OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
Integer toOfficeId = officeHelper.createOffice("01 January 2011"); Integer toOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(toOfficeId); Assertions.assertNotNull(toOfficeId);
// Creating Savings Account to which fund to be Transferred // Creating Savings Account to which fund to be Transferred
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011", final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(toOfficeId)); String.valueOf(toOfficeId));
Assert.assertNotNull(toClientID); Assertions.assertNotNull(toClientID);
final Integer toSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, assetAccount, final Integer toSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, assetAccount,
incomeAccount, expenseAccount, liabilityAccount); incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(toSavingsProductID); Assertions.assertNotNull(toSavingsProductID);
final Integer toSavingsID = this.savingsAccountHelper.applyForSavingsApplication(toClientID, toSavingsProductID, final Integer toSavingsID = this.savingsAccountHelper.applyForSavingsApplication(toClientID, toSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL); ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(toSavingsProductID); Assertions.assertNotNull(toSavingsProductID);
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsID); HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsID);
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
@@ -172,20 +172,20 @@ public class AccountTransferTest {
final HashMap toSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(toSavingsID); final HashMap toSavingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
Integer fromOfficeId = officeHelper.createOffice("01 January 2011"); Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(fromOfficeId); Assertions.assertNotNull(fromOfficeId);
// Creating Savings Account from which the Fund has to be Transferred // Creating Savings Account from which the Fund has to be Transferred
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011", final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(fromOfficeId)); String.valueOf(fromOfficeId));
Assert.assertNotNull(fromClientID); Assertions.assertNotNull(fromClientID);
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
assetAccount, incomeAccount, expenseAccount, liabilityAccount); assetAccount, incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(fromSavingsProductID); Assertions.assertNotNull(fromSavingsProductID);
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID, final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL); ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(fromSavingsID); Assertions.assertNotNull(fromSavingsID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID); HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
@@ -208,12 +208,12 @@ public class AccountTransferTest {
toSavingsBalance += Float.valueOf(ACCOUNT_TRANSFER_AMOUNT); toSavingsBalance += Float.valueOf(ACCOUNT_TRANSFER_AMOUNT);
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID); HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance, assertEquals(fromSavingsBalance, fromSavingsSummaryAfter.get("accountBalance"),
fromSavingsSummaryAfter.get("accountBalance")); "Verifying From Savings Account Balance after Account Transfer");
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID); HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
assertEquals("Verifying To Savings Account Balance after Account Transfer", toSavingsBalance, assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
toSavingsSummaryAfter.get("accountBalance")); "Verifying To Savings Account Balance after Account Transfer");
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT), final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT),
JournalEntry.TransactionType.CREDIT) }; JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] office2LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT), 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); OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
Integer toOfficeId = officeHelper.createOffice("01 January 2011"); Integer toOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(toOfficeId); Assertions.assertNotNull(toOfficeId);
// Creating Loan Account to which fund to be Transferred // Creating Loan Account to which fund to be Transferred
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011", final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(toOfficeId)); String.valueOf(toOfficeId));
Assert.assertNotNull(toClientID); Assertions.assertNotNull(toClientID);
Account toTransferAccount = accountHelper.createLiabilityAccount(); Account toTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(toTransferAccount); Assertions.assertNotNull(toTransferAccount);
final Integer toLoanProductID = createLoanProduct(loanAssetAccount, loanIncomeAccount, loanExpenseAccount, overpaymentAccount); final Integer toLoanProductID = createLoanProduct(loanAssetAccount, loanIncomeAccount, loanExpenseAccount, overpaymentAccount);
Assert.assertNotNull(toLoanProductID); Assertions.assertNotNull(toLoanProductID);
final Integer toLoanID = applyForLoanApplication(toClientID, toLoanProductID); final Integer toLoanID = applyForLoanApplication(toClientID, toLoanProductID);
Assert.assertNotNull(toLoanID); Assertions.assertNotNull(toLoanID);
HashMap toLoanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, toLoanID); HashMap toLoanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, toLoanID);
LoanStatusChecker.verifyLoanIsPending(toLoanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(toLoanStatusHashMap);
@@ -270,20 +270,20 @@ public class AccountTransferTest {
LoanStatusChecker.verifyLoanIsActive(toLoanStatusHashMap); LoanStatusChecker.verifyLoanIsActive(toLoanStatusHashMap);
Integer fromOfficeId = officeHelper.createOffice("01 January 2011"); Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(fromOfficeId); Assertions.assertNotNull(fromOfficeId);
// Creating Savings Account from which the Fund has to be Transferred // Creating Savings Account from which the Fund has to be Transferred
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011", final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(fromOfficeId)); String.valueOf(fromOfficeId));
Assert.assertNotNull(fromClientID); Assertions.assertNotNull(fromClientID);
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
assetAccount, incomeAccount, expenseAccount, liabilityAccount); assetAccount, incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(fromSavingsProductID); Assertions.assertNotNull(fromSavingsProductID);
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID, final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL); ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(fromSavingsID); Assertions.assertNotNull(fromSavingsID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID); HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
@@ -304,12 +304,12 @@ public class AccountTransferTest {
fromSavingsBalance -= TRANSFER_AMOUNT_ADJUST; fromSavingsBalance -= TRANSFER_AMOUNT_ADJUST;
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID); HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance, assertEquals(fromSavingsBalance, fromSavingsSummaryAfter.get("accountBalance"),
fromSavingsSummaryAfter.get("accountBalance")); "Verifying From Savings Account Balance after Account Transfer");
HashMap toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, toLoanID); HashMap toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, toLoanID);
assertEquals("Verifying To Loan Repayment Amount after Account Transfer", TRANSFER_AMOUNT_ADJUST, assertEquals(TRANSFER_AMOUNT_ADJUST, toLoanSummaryAfter.get("totalRepayment"),
toLoanSummaryAfter.get("totalRepayment")); "Verifying To Loan Repayment Amount after Account Transfer");
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST), final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
JournalEntry.TransactionType.CREDIT) }; JournalEntry.TransactionType.CREDIT) };
@@ -340,20 +340,20 @@ public class AccountTransferTest {
OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec); OfficeHelper officeHelper = new OfficeHelper(this.requestSpec, this.responseSpec);
Integer toOfficeId = officeHelper.createOffice("01 January 2011"); Integer toOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(toOfficeId); Assertions.assertNotNull(toOfficeId);
// Creating Loan Account to which fund to be Transferred // Creating Loan Account to which fund to be Transferred
final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011", final Integer toClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(toOfficeId)); String.valueOf(toOfficeId));
Assert.assertNotNull(toClientID); Assertions.assertNotNull(toClientID);
final Integer toSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, assetAccount, final Integer toSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, assetAccount,
incomeAccount, expenseAccount, liabilityAccount); incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(toSavingsProductID); Assertions.assertNotNull(toSavingsProductID);
final Integer toSavingsID = this.savingsAccountHelper.applyForSavingsApplication(toClientID, toSavingsProductID, final Integer toSavingsID = this.savingsAccountHelper.applyForSavingsApplication(toClientID, toSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL); ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(toSavingsID); Assertions.assertNotNull(toSavingsID);
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsID); HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsID);
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
@@ -365,18 +365,18 @@ public class AccountTransferTest {
SavingsStatusChecker.verifySavingsIsActive(toSavingsStatusHashMap); SavingsStatusChecker.verifySavingsIsActive(toSavingsStatusHashMap);
Integer fromOfficeId = officeHelper.createOffice("01 January 2011"); Integer fromOfficeId = officeHelper.createOffice("01 January 2011");
Assert.assertNotNull(fromOfficeId); Assertions.assertNotNull(fromOfficeId);
// Creating Savings Account from which the Fund has to be Transferred // Creating Savings Account from which the Fund has to be Transferred
final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011", final Integer fromClientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2011",
String.valueOf(fromOfficeId)); String.valueOf(fromOfficeId));
Assert.assertNotNull(fromClientID); Assertions.assertNotNull(fromClientID);
final Integer loanProductID = createLoanProduct(loanAssetAccount, loanIncomeAccount, loanExpenseAccount, overpaymentAccount); final Integer loanProductID = createLoanProduct(loanAssetAccount, loanIncomeAccount, loanExpenseAccount, overpaymentAccount);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(fromClientID, loanProductID); final Integer loanID = applyForLoanApplication(fromClientID, loanProductID);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -389,11 +389,11 @@ public class AccountTransferTest {
final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer fromSavingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
assetAccount, incomeAccount, expenseAccount, liabilityAccount); assetAccount, incomeAccount, expenseAccount, liabilityAccount);
Assert.assertNotNull(fromSavingsProductID); Assertions.assertNotNull(fromSavingsProductID);
final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID, final Integer fromSavingsID = this.savingsAccountHelper.applyForSavingsApplication(fromClientID, fromSavingsProductID,
ACCOUNT_TYPE_INDIVIDUAL); ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(fromSavingsID); Assertions.assertNotNull(fromSavingsID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID); HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsID);
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
@@ -416,8 +416,8 @@ public class AccountTransferTest {
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID); HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
// Verifying fromSavings Account Balance after Account Transfer // Verifying fromSavings Account Balance after Account Transfer
assertEquals("Verifying From Savings Account Balance after Account Transfer", fromSavingsBalance, assertEquals(fromSavingsBalance, fromSavingsSummaryAfter.get("accountBalance"),
fromSavingsSummaryAfter.get("accountBalance")); "Verifying From Savings Account Balance after Account Transfer");
Float toSavingsBalance = Float.valueOf(MINIMUM_OPENING_BALANCE); Float toSavingsBalance = Float.valueOf(MINIMUM_OPENING_BALANCE);
@@ -429,8 +429,8 @@ public class AccountTransferTest {
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID); HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
// Verifying toSavings Account Balance after Account Transfer // Verifying toSavings Account Balance after Account Transfer
assertEquals("Verifying From Savings Account Balance after Account Transfer", toSavingsBalance, assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
toSavingsSummaryAfter.get("accountBalance")); "Verifying From Savings Account Balance after Account Transfer");
final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST), final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
JournalEntry.TransactionType.CREDIT) }; JournalEntry.TransactionType.CREDIT) };
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.Days; import org.joda.time.Days;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -109,7 +109,7 @@ public class AccountingScenarioIntegrationTest {
private SchedulerJobHelper schedulerJobHelper; private SchedulerJobHelper schedulerJobHelper;
private PeriodicAccrualAccountingHelper periodicAccrualAccountingHelper; private PeriodicAccrualAccountingHelper periodicAccrualAccountingHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -282,7 +282,7 @@ public class AccountingScenarioIntegrationTest {
CommonConstants.RESPONSE_RESOURCE_ID); CommonConstants.RESPONSE_RESOURCE_ID);
Float balance = SP_BALANCE + SP_DEPOSIT_AMOUNT; Float balance = SP_BALANCE + SP_DEPOSIT_AMOUNT;
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsID); 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----------------------------"); LOG.info("----------------------Verifying Journal Entry after the Transaction Deposit----------------------------");
final JournalEntry[] assetAccountFirstTransactionEntry = { new JournalEntry(this.SP_DEPOSIT_AMOUNT, final JournalEntry[] assetAccountFirstTransactionEntry = { new JournalEntry(this.SP_DEPOSIT_AMOUNT,
@@ -298,7 +298,7 @@ public class AccountingScenarioIntegrationTest {
CommonConstants.RESPONSE_RESOURCE_ID); CommonConstants.RESPONSE_RESOURCE_ID);
balance -= SP_WITHDRAWAL_AMOUNT; balance -= SP_WITHDRAWAL_AMOUNT;
summary = this.savingsAccountHelper.getSavingsSummary(savingsID); 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----------------------"); LOG.info("-------------------Verifying Journal Entry after the Transaction Withdrawal----------------------");
final JournalEntry[] assetAccountSecondTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT, final JournalEntry[] assetAccountSecondTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT,
@@ -312,11 +312,11 @@ public class AccountingScenarioIntegrationTest {
// Third Transaction-Add Charges for Withdrawal Fee // Third Transaction-Add Charges for Withdrawal Fee
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsWithdrawalFeeJSON()); ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalChargeId); Assertions.assertNotNull(withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsID, withdrawalChargeId, false); this.savingsAccountHelper.addChargesForSavings(savingsID, withdrawalChargeId, false);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsID); ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsID);
Assert.assertEquals(1, chargesPendingState.size()); Assertions.assertEquals(1, chargesPendingState.size());
HashMap savingsChargeForPay = chargesPendingState.get(0); HashMap savingsChargeForPay = chargesPendingState.get(0);
HashMap paidCharge = this.savingsAccountHelper.getSavingsCharge(savingsID, (Integer) savingsChargeForPay.get("id")); HashMap paidCharge = this.savingsAccountHelper.getSavingsCharge(savingsID, (Integer) savingsChargeForPay.get("id"));
Float chargeAmount = (Float) paidCharge.get("amount"); Float chargeAmount = (Float) paidCharge.get("amount");
@@ -339,7 +339,7 @@ public class AccountingScenarioIntegrationTest {
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.TRANSACTION_DATE, incomeAccountThirdTransactionEntry); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.TRANSACTION_DATE, incomeAccountThirdTransactionEntry);
// Verifying Balance after applying Charge for Withdrawal Fee // Verifying Balance after applying Charge for Withdrawal Fee
assertEquals("Verifying Balance", balance, summary.get("accountBalance")); assertEquals(balance, summary.get("accountBalance"), "Verifying Balance");
} }
@Test @Test
@@ -376,15 +376,15 @@ public class AccountingScenarioIntegrationTest {
final Account liabilityAccount = this.accountHelper.createLiabilityAccount(); final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, assetAccount, incomeAccount, expenseAccount, Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, assetAccount, incomeAccount, expenseAccount,
liabilityAccount); liabilityAccount);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
VALID_TO, SUBMITTED_ON_DATE, FixedDepositTest.WHOLE_TERM); VALID_TO, SUBMITTED_ON_DATE, FixedDepositTest.WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -407,7 +407,7 @@ public class AccountingScenarioIntegrationTest {
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, ACTIVATION_DATE, liablilityAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, ACTIVATION_DATE, liablilityAccountInitialEntry);
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId); Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest); Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId); accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted"); Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -454,15 +454,15 @@ public class AccountingScenarioIntegrationTest {
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime()); final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
Integer recurringDepositProductId = createRecurringDepositProduct(VALID_FROM, VALID_TO, assetAccount, liabilityAccount, Integer recurringDepositProductId = createRecurringDepositProduct(VALID_FROM, VALID_TO, assetAccount, liabilityAccount,
incomeAccount, expenseAccount); incomeAccount, expenseAccount);
Assert.assertNotNull(recurringDepositProductId); Assertions.assertNotNull(recurringDepositProductId);
Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(), Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(),
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, RecurringDepositTest.WHOLE_TERM, EXPECTED_FIRST_DEPOSIT_ON_DATE); 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( HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
this.requestSpec, this.responseSpec, recurringDepositAccountId.toString()); this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
@@ -482,7 +482,7 @@ public class AccountingScenarioIntegrationTest {
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE); depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE);
Assert.assertNotNull(depositTransactionId); Assertions.assertNotNull(depositTransactionId);
// Checking initial Journal entries after Activation. // Checking initial Journal entries after Activation.
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) }; final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
@@ -493,7 +493,7 @@ public class AccountingScenarioIntegrationTest {
Integer interestPostingTransactionId = this.recurringDepositAccountHelper Integer interestPostingTransactionId = this.recurringDepositAccountHelper
.postInterestForRecurringDeposit(recurringDepositAccountId); .postInterestForRecurringDeposit(recurringDepositAccountId);
Assert.assertNotNull(interestPostingTransactionId); Assertions.assertNotNull(interestPostingTransactionId);
HashMap accountSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId); HashMap accountSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted"); Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -19,13 +19,13 @@
package org.apache.fineract.integrationtests; 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.RestAssured;
import io.restassured.http.ContentType; import io.restassured.http.ContentType;
import io.restassured.response.Response; import io.restassured.response.Response;
import java.util.Map; import java.util.Map;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class ActuatorIntegrationTest { public class ActuatorIntegrationTest {
@@ -24,15 +24,15 @@ import io.restassured.http.ContentType;
import io.restassured.specification.RequestSpecification; import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification; import io.restassured.specification.ResponseSpecification;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class ApiDocsTest { public class ApiDocsTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper; import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Test class for * Test class for
@@ -62,9 +62,9 @@ public class BatchApiTest {
/** /**
* Sets up the essential settings for the TEST like contentType, * 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() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
@@ -92,7 +92,7 @@ public class BatchApiTest {
// Verify that only 501 is returned as the status code // Verify that only 501 is returned as the status code
for (BatchResponse resp : response) { 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 // Verify that a 200 response is returned as the status code
for (BatchResponse resp : response) { 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"); BatchHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, "TestExtId12");
// Asserts that all the transactions have been successfully rolled back // Asserts that all the transactions have been successfully rolled back
Assert.assertEquals(1, response.size()); Assertions.assertEquals(1, response.size());
Assert.assertEquals("Verify Status code 400", (long) 400, (long) response.get(0).getStatusCode()); 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(); final JsonObject changes = new FromJsonHelper().parse(response.get(1).getBody()).getAsJsonObject().get("changes").getAsJsonObject();
// Asserts the client information is successfully updated // Asserts the client information is successfully updated
Assert.assertEquals("Verify Firstname", "TestFirstName", changes.get("firstname").getAsString()); Assertions.assertEquals("Verify Firstname", "TestFirstName", changes.get("firstname").getAsString());
Assert.assertEquals("Verify Lastname", "TestLastName", changes.get("lastname").getAsString()); Assertions.assertEquals("Verify Lastname", "TestLastName", changes.get("lastname").getAsString());
} }
/** /**
@@ -240,7 +240,7 @@ public class BatchApiTest {
// Get the clientId parameter from createClient Response // Get the clientId parameter from createClient Response
final JsonElement clientId = new FromJsonHelper().parse(response.get(0).getBody()).getAsJsonObject().get("clientId"); 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, final List<BatchResponse> response = BatchHelper.postBatchRequestsWithoutEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest); 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, final List<BatchResponse> response = BatchHelper.postBatchRequestsWithoutEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest); 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, final List<BatchResponse> response = BatchHelper.postBatchRequestsWithoutEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest); jsonifiedRequest);
Assert.assertEquals("Verify Status Code 200 for Repayment", 200L, (long) response.get(5).getStatusCode()); Assertions.assertEquals(200L, (long) response.get(5).getStatusCode(), "Verify Status Code 200 for Repayment");
Assert.assertEquals("Verify Status Code 200 for Repayment", 200L, (long) response.get(6).getStatusCode()); 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, final List<BatchResponse> response = BatchHelper.postBatchRequestsWithoutEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest); jsonifiedRequest);
Assert.assertEquals("Verify Status Code 200 for Create Client", 200L, (long) response.get(0).getStatusCode()); Assertions.assertEquals(200L, (long) response.get(0).getStatusCode(), "Verify Status Code 200 for Create Client");
Assert.assertEquals("Verify Status Code 200 for Activate Client", 200L, (long) response.get(1).getStatusCode()); 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, final List<BatchResponse> response = BatchHelper.postBatchRequestsWithoutEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest); jsonifiedRequest);
Assert.assertEquals("Verify Status Code 200 for Approve Loan", 200L, (long) response.get(3).getStatusCode()); Assertions.assertEquals(200L, (long) response.get(3).getStatusCode(), "Verify Status Code 200 for Approve Loan");
Assert.assertEquals("Verify Status Code 200 for Disburse Loan", 200L, (long) response.get(4).getStatusCode()); 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, final List<BatchResponse> response = BatchHelper.postBatchRequestsWithEnclosingTransaction(this.requestSpec, this.responseSpec,
jsonifiedRequest); jsonifiedRequest);
Assert.assertEquals("Verify Status Code 200 for create client", 200L, (long) response.get(0).getStatusCode()); Assertions.assertEquals(200L, (long) response.get(0).getStatusCode(), "Verify Status Code 200 for create client");
Assert.assertEquals("Verify Status Code 200 for apply Loan", 200L, (long) response.get(1).getStatusCode()); Assertions.assertEquals(200L, (long) response.get(1).getStatusCode(), "Verify Status Code 200 for apply Loan");
Assert.assertEquals("Verify Status Code 200 for approve Loan", 200L, (long) response.get(2).getStatusCode()); Assertions.assertEquals(200L, (long) response.get(2).getStatusCode(), "Verify Status Code 200 for approve Loan");
Assert.assertEquals("Verify Status Code 200 for disburse Loan", 200L, (long) response.get(3).getStatusCode()); 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.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder; import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -58,9 +58,9 @@ public class BatchRequestsIntegrationTest {
/** /**
* Sets up the essential settings for the TEST like contentType, * 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() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
@@ -135,7 +135,7 @@ public class BatchRequestsIntegrationTest {
// Verify that each loan has been applied successfully // Verify that each loan has been applied successfully
for (BatchResponse res : response) { 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; 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 com.google.gson.Gson;
import io.restassured.builder.RequestSpecBuilder; 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.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper; import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -46,7 +46,7 @@ public class CenterIntegrationTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -62,20 +62,20 @@ public class CenterIntegrationTest {
int resourceId = CenterHelper.createCenter(name, officeId, requestSpec, responseSpec); int resourceId = CenterHelper.createCenter(name, officeId, requestSpec, responseSpec);
CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec); CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec);
Assert.assertNotNull(center); Assertions.assertNotNull(center);
Assert.assertTrue(center.getName().equals(name)); Assertions.assertTrue(center.getName().equals(name));
Assert.assertTrue(center.getOfficeId() == officeId); Assertions.assertTrue(center.getOfficeId() == officeId);
Assert.assertTrue(center.isActive() == false); Assertions.assertTrue(center.isActive() == false);
// Test retrieval by listing all centers // Test retrieval by listing all centers
int id = CenterHelper.listCenters(requestSpec, responseSpec).get(0).getId(); int id = CenterHelper.listCenters(requestSpec, responseSpec).get(0).getId();
Assert.assertTrue(id > 0); Assertions.assertTrue(id > 0);
CenterDomain retrievedCenter = CenterHelper.retrieveByID(id, requestSpec, responseSpec); CenterDomain retrievedCenter = CenterHelper.retrieveByID(id, requestSpec, responseSpec);
Assert.assertNotNull(retrievedCenter); Assertions.assertNotNull(retrievedCenter);
Assert.assertNotNull(retrievedCenter.getName()); Assertions.assertNotNull(retrievedCenter.getName());
Assert.assertNotNull(retrievedCenter.getHierarchy()); Assertions.assertNotNull(retrievedCenter.getHierarchy());
Assert.assertNotNull(retrievedCenter.getOfficeName()); Assertions.assertNotNull(retrievedCenter.getOfficeName());
} }
@@ -90,13 +90,13 @@ public class CenterIntegrationTest {
int resourceId = CenterHelper.createCenter(name, officeId, externalId, staffId, groupMembers, requestSpec, responseSpec); int resourceId = CenterHelper.createCenter(name, officeId, externalId, staffId, groupMembers, requestSpec, responseSpec);
CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec); CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec);
Assert.assertNotNull(center); Assertions.assertNotNull(center);
Assert.assertTrue(center.getName().equals(name)); Assertions.assertTrue(center.getName().equals(name));
Assert.assertTrue(center.getOfficeId() == officeId); Assertions.assertTrue(center.getOfficeId() == officeId);
Assert.assertTrue(center.getExternalId().equals(externalId)); Assertions.assertTrue(center.getExternalId().equals(externalId));
Assert.assertTrue(center.getStaffId() == staffId); Assertions.assertTrue(center.getStaffId() == staffId);
Assert.assertTrue(center.isActive() == false); Assertions.assertTrue(center.isActive() == false);
Assert.assertArrayEquals(center.getGroupMembers(), groupMembers); Assertions.assertArrayEquals(center.getGroupMembers(), groupMembers);
} }
@Test @Test
@@ -104,9 +104,9 @@ public class CenterIntegrationTest {
ArrayList<CenterDomain> paginatedList = CenterHelper.paginatedListCenters(requestSpec, responseSpec); ArrayList<CenterDomain> paginatedList = CenterHelper.paginatedListCenters(requestSpec, responseSpec);
ArrayList<CenterDomain> list = CenterHelper.listCenters(requestSpec, responseSpec); ArrayList<CenterDomain> list = CenterHelper.listCenters(requestSpec, responseSpec);
Assert.assertNotNull(paginatedList); Assertions.assertNotNull(paginatedList);
Assert.assertNotNull(list); Assertions.assertNotNull(list);
Assert.assertTrue(Arrays.equals(paginatedList.toArray(new CenterDomain[paginatedList.size()]), Assertions.assertTrue(Arrays.equals(paginatedList.toArray(new CenterDomain[paginatedList.size()]),
list.toArray(new CenterDomain[list.size()]))); list.toArray(new CenterDomain[list.size()])));
} }
@@ -116,7 +116,7 @@ public class CenterIntegrationTest {
int id = arr.get(arr.size() - 1).getId() + 1; int id = arr.get(arr.size() - 1).getId() + 1;
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(404).build(); ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(404).build();
CenterDomain center = CenterHelper.retrieveByID(id, requestSpec, responseSpec); CenterDomain center = CenterHelper.retrieveByID(id, requestSpec, responseSpec);
Assert.assertNotNull(center); Assertions.assertNotNull(center);
} }
@SuppressWarnings({ "rawtypes", "unchecked" }) @SuppressWarnings({ "rawtypes", "unchecked" })
@@ -137,7 +137,7 @@ public class CenterIntegrationTest {
int[] associateResponse = CenterHelper.associateGroups(resourceId, associateGroupMembers, requestSpec, responseSpec); int[] associateResponse = CenterHelper.associateGroups(resourceId, associateGroupMembers, requestSpec, responseSpec);
Arrays.sort(associateResponse); Arrays.sort(associateResponse);
Arrays.sort(associateGroupMembers); Arrays.sort(associateGroupMembers);
Assert.assertArrayEquals(associateResponse, associateGroupMembers); Assertions.assertArrayEquals(associateResponse, associateGroupMembers);
int[] newGroupMembers = new int[5]; int[] newGroupMembers = new int[5];
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
@@ -153,17 +153,17 @@ public class CenterIntegrationTest {
request.put("externalId", newExternalId); request.put("externalId", newExternalId);
request.put("staffId", newStaffId); request.put("staffId", newStaffId);
HashMap response = CenterHelper.updateCenter(resourceId, request, requestSpec, responseSpec); HashMap response = CenterHelper.updateCenter(resourceId, request, requestSpec, responseSpec);
Assert.assertNotNull(response); Assertions.assertNotNull(response);
Assert.assertEquals(newName, response.get("name")); Assertions.assertEquals(newName, response.get("name"));
Assert.assertEquals(newExternalId, response.get("externalId")); Assertions.assertEquals(newExternalId, response.get("externalId"));
Assert.assertEquals(Integer.valueOf(newStaffId), Integer.valueOf(response.get("staffId").toString())); Assertions.assertEquals(Integer.valueOf(newStaffId), Integer.valueOf(response.get("staffId").toString()));
CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec); CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec);
Assert.assertNotNull(center); Assertions.assertNotNull(center);
Assert.assertEquals(newName, center.getName()); Assertions.assertEquals(newName, center.getName());
Assert.assertEquals(newExternalId, center.getExternalId()); Assertions.assertEquals(newExternalId, center.getExternalId());
Assert.assertEquals((Integer)newStaffId, center.getStaffId()); Assertions.assertEquals((Integer)newStaffId, center.getStaffId());
Assert.assertArrayEquals(newGroupMembers, center.getGroupMembers()); Assertions.assertArrayEquals(newGroupMembers, center.getGroupMembers());
} }
@Test @Test
@@ -175,7 +175,7 @@ public class CenterIntegrationTest {
CenterHelper.deleteCenter(resourceId, requestSpec, responseSpec); CenterHelper.deleteCenter(resourceId, requestSpec, responseSpec);
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(404).build(); ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(404).build();
CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec); CenterDomain center = CenterHelper.retrieveByID(resourceId, requestSpec, responseSpec);
Assert.assertNotNull(center); Assertions.assertNotNull(center);
} }
private int[] generateGroupMembers(int size, int officeId) { private int[] generateGroupMembers(int size, int officeId) {
@@ -201,21 +201,21 @@ public class CenterIntegrationTest {
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
LOG.info("--------------creating first staff with id------------- {}" , staffId); 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 int centerWithStaffId = CenterHelper.createCenterWithStaffId(this.requestSpec, this.responseSpec, staffId);
final CenterDomain center = CenterHelper.retrieveByID(centerWithStaffId, requestSpec, responseSpec); final CenterDomain center = CenterHelper.retrieveByID(centerWithStaffId, requestSpec, responseSpec);
Assert.assertNotNull(center); Assertions.assertNotNull(center);
Assert.assertTrue(center.getId() == centerWithStaffId); Assertions.assertTrue(center.getId() == centerWithStaffId);
Assert.assertTrue(center.getStaffId().intValue() == staffId); Assertions.assertTrue(center.getStaffId().intValue() == staffId);
Assert.assertTrue(center.isActive() == true); Assertions.assertTrue(center.isActive() == true);
} }
@Test @Test
public void testAssignStaffToCenter() { public void testAssignStaffToCenter() {
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
LOG.info("--------------creating first staff with id------------- {}" , staffId); LOG.info("--------------creating first staff with id------------- {}" , staffId);
Assert.assertNotNull(staffId); Assertions.assertNotNull(staffId);
final Integer groupID = CenterHelper.createCenter(this.requestSpec, this.responseSpec); final Integer groupID = CenterHelper.createCenter(this.requestSpec, this.responseSpec);
CenterHelper.verifyCenterCreatedOnServer(this.requestSpec, this.responseSpec, groupID); CenterHelper.verifyCenterCreatedOnServer(this.requestSpec, this.responseSpec, groupID);
@@ -223,12 +223,12 @@ public class CenterIntegrationTest {
final HashMap assignStaffToCenterResponseMap = (HashMap) CenterHelper.assignStaff(this.requestSpec, final HashMap assignStaffToCenterResponseMap = (HashMap) CenterHelper.assignStaff(this.requestSpec,
this.responseSpec, groupID.toString(), this.responseSpec, groupID.toString(),
staffId.longValue()); 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); final CenterDomain center = CenterHelper.retrieveByID(groupID, requestSpec, responseSpec);
Assert.assertNotNull(center); Assertions.assertNotNull(center);
Assert.assertTrue(center.getId().intValue() == groupID); Assertions.assertTrue(center.getId().intValue() == groupID);
Assert.assertTrue(center.getStaffId().intValue() == staffId); Assertions.assertTrue(center.getStaffId().intValue() == staffId);
} }
@@ -236,7 +236,7 @@ public class CenterIntegrationTest {
public void testUnassignStaffToCenter() { public void testUnassignStaffToCenter() {
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
LOG.info("--------------creating first staff with id------------- {}" , staffId); LOG.info("--------------creating first staff with id------------- {}" , staffId);
Assert.assertNotNull(staffId); Assertions.assertNotNull(staffId);
final Integer groupID = CenterHelper.createCenter(this.requestSpec, this.responseSpec); final Integer groupID = CenterHelper.createCenter(this.requestSpec, this.responseSpec);
CenterHelper.verifyCenterCreatedOnServer(this.requestSpec, this.responseSpec, groupID); CenterHelper.verifyCenterCreatedOnServer(this.requestSpec, this.responseSpec, groupID);
@@ -244,20 +244,20 @@ public class CenterIntegrationTest {
final HashMap assignStaffToCenterResponseMap = (HashMap) CenterHelper.assignStaff(this.requestSpec, final HashMap assignStaffToCenterResponseMap = (HashMap) CenterHelper.assignStaff(this.requestSpec,
this.responseSpec, groupID.toString(), this.responseSpec, groupID.toString(),
staffId.longValue()); 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); final CenterDomain centerWithStaffAssigned = CenterHelper.retrieveByID(groupID, requestSpec, responseSpec);
Assert.assertNotNull(centerWithStaffAssigned); Assertions.assertNotNull(centerWithStaffAssigned);
Assert.assertTrue(centerWithStaffAssigned.getId().intValue() == groupID); Assertions.assertTrue(centerWithStaffAssigned.getId().intValue() == groupID);
Assert.assertTrue(centerWithStaffAssigned.getStaffId().intValue() == staffId); Assertions.assertTrue(centerWithStaffAssigned.getStaffId().intValue() == staffId);
final HashMap unassignStaffToCenterResponseMap = (HashMap) CenterHelper.unassignStaff(this.requestSpec, final HashMap unassignStaffToCenterResponseMap = (HashMap) CenterHelper.unassignStaff(this.requestSpec,
this.responseSpec, groupID.toString(), this.responseSpec, groupID.toString(),
staffId.longValue()); 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); final CenterDomain centerWithStaffUnssigned = CenterHelper.retrieveByID(groupID, requestSpec, responseSpec);
Assert.assertNotNull(centerWithStaffUnssigned); Assertions.assertNotNull(centerWithStaffUnssigned);
Assert.assertTrue(centerWithStaffUnssigned.getId().intValue() == groupID); Assertions.assertTrue(centerWithStaffUnssigned.getId().intValue() == groupID);
Assert.assertTrue(centerWithStaffUnssigned.getStaffId() == null); Assertions.assertTrue(centerWithStaffUnssigned.getStaffId() == null);
} }
@@ -27,9 +27,9 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.charges.ChargesHelper; import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
@SuppressWarnings({ "rawtypes" }) @SuppressWarnings({ "rawtypes" })
public class ChargesTest { public class ChargesTest {
@@ -37,7 +37,7 @@ public class ChargesTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -50,19 +50,19 @@ public class ChargesTest {
// Retrieving all Charges // Retrieving all Charges
ArrayList<HashMap> allChargesData = ChargesHelper.getCharges(this.requestSpec, this.responseSpec); ArrayList<HashMap> allChargesData = ChargesHelper.getCharges(this.requestSpec, this.responseSpec);
Assert.assertNotNull(allChargesData); Assertions.assertNotNull(allChargesData);
// Testing Creation, Updation and Deletion of Disbursement Charge // Testing Creation, Updation and Deletion of Disbursement Charge
final Integer disbursementChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer disbursementChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanDisbursementJSON()); ChargesHelper.getLoanDisbursementJSON());
Assert.assertNotNull(disbursementChargeId); Assertions.assertNotNull(disbursementChargeId);
// Updating Charge Amount // Updating Charge Amount
HashMap changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId, HashMap changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeJSON()); ChargesHelper.getModifyChargeJSON());
HashMap chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON()); ChargesHelper.getModifyChargeAsPecentageAmountJSON());
@@ -70,10 +70,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
HashMap chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode"); 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"); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON()); ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
@@ -81,7 +81,7 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType"); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, disbursementChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON()); ChargesHelper.getModifyChargeAsPercentageInterestJSON());
@@ -89,22 +89,22 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, disbursementChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType"); 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); 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 // Testing Creation, Updation and Deletion of Specified due date Charge
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON()); ChargesHelper.getLoanSpecifiedDueDateJSON());
Assert.assertNotNull(specifiedDueDateChargeId); Assertions.assertNotNull(specifiedDueDateChargeId);
// Updating Charge Amount // Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeJSON()); ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON()); ChargesHelper.getModifyChargeAsPecentageAmountJSON());
@@ -112,10 +112,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode"); 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"); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON()); ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
@@ -123,7 +123,7 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType"); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON()); ChargesHelper.getModifyChargeAsPercentageInterestJSON());
@@ -131,10 +131,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType"); 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); 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 // Testing Creation, Updation and Deletion of Installment Fee Charge
final Integer installmentFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer installmentFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
@@ -145,7 +145,7 @@ public class ChargesTest {
ChargesHelper.getModifyChargeJSON()); ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON()); ChargesHelper.getModifyChargeAsPecentageAmountJSON());
@@ -153,10 +153,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode"); 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"); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON()); ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
@@ -164,7 +164,7 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType"); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, installmentFeeChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON()); ChargesHelper.getModifyChargeAsPercentageInterestJSON());
@@ -172,22 +172,22 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, installmentFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType"); 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); 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 // Testing Creation, Updation and Deletion of Overdue Installment Fee
// Charge // Charge
final Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanOverdueFeeJSON()); ChargesHelper.getLoanOverdueFeeJSON());
Assert.assertNotNull(overdueFeeChargeId); Assertions.assertNotNull(overdueFeeChargeId);
// Updating Charge Amount // Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId, ChargesHelper.getModifyChargeJSON()); changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId, ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageAmountJSON()); ChargesHelper.getModifyChargeAsPecentageAmountJSON());
@@ -195,10 +195,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargePaymentMode"); 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"); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON()); ChargesHelper.getModifyChargeAsPecentageLoanAmountWithInterestJSON());
@@ -206,7 +206,7 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType"); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeAsPercentageInterestJSON()); ChargesHelper.getModifyChargeAsPercentageInterestJSON());
@@ -214,7 +214,7 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType"); 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, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdueFeeChargeId,
ChargesHelper.getModifyChargeFeeFrequencyAsYearsJSON()); ChargesHelper.getModifyChargeFeeFrequencyAsYearsJSON());
@@ -222,10 +222,10 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
chargeChangedData = (HashMap) chargeDataAfterChanges.get("feeFrequency"); 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); 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 @Test
@@ -234,37 +234,37 @@ public class ChargesTest {
// Testing Creation, Updation and Deletion of Specified due date Charge // Testing Creation, Updation and Deletion of Specified due date Charge
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsSpecifiedDueDateJSON()); ChargesHelper.getSavingsSpecifiedDueDateJSON());
Assert.assertNotNull(specifiedDueDateChargeId); Assertions.assertNotNull(specifiedDueDateChargeId);
// Updating Charge Amount // Updating Charge Amount
HashMap changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId, HashMap changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, specifiedDueDateChargeId,
ChargesHelper.getModifyChargeJSON()); ChargesHelper.getModifyChargeJSON());
HashMap chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId); 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); 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 // Testing Creation, Updation and Deletion of Savings Activation Charge
final Integer savingsActivationChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer savingsActivationChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsActivationFeeJSON()); ChargesHelper.getSavingsActivationFeeJSON());
Assert.assertNotNull(savingsActivationChargeId); Assertions.assertNotNull(savingsActivationChargeId);
// Updating Charge Amount // Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, savingsActivationChargeId, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, savingsActivationChargeId,
ChargesHelper.getModifyChargeJSON()); ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, savingsActivationChargeId); 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); 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 // Testing Creation, Updation and Deletion of Charge for Withdrawal Fee
final Integer withdrawalFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer withdrawalFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsWithdrawalFeeJSON()); ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalFeeChargeId); Assertions.assertNotNull(withdrawalFeeChargeId);
// Updating Charge-Calculation-Type to Withdrawal-Fee // Updating Charge-Calculation-Type to Withdrawal-Fee
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, withdrawalFeeChargeId, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, withdrawalFeeChargeId,
@@ -273,52 +273,52 @@ public class ChargesTest {
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, withdrawalFeeChargeId); chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, withdrawalFeeChargeId);
HashMap chargeChangedData = (HashMap) chargeDataAfterChanges.get("chargeCalculationType"); 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); 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 // Testing Creation, Updation and Deletion of Charge for Annual Fee
final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsAnnualFeeJSON()); ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(annualFeeChargeId); Assertions.assertNotNull(annualFeeChargeId);
// Updating Charge Amount // Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, annualFeeChargeId, ChargesHelper.getModifyChargeJSON()); changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, annualFeeChargeId, ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, annualFeeChargeId); 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); 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 // Testing Creation, Updation and Deletion of Charge for Monthly Fee
final Integer monthlyFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer monthlyFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsMonthlyFeeJSON()); ChargesHelper.getSavingsMonthlyFeeJSON());
Assert.assertNotNull(monthlyFeeChargeId); Assertions.assertNotNull(monthlyFeeChargeId);
// Updating Charge Amount // Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, monthlyFeeChargeId, ChargesHelper.getModifyChargeJSON()); changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, monthlyFeeChargeId, ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, monthlyFeeChargeId); 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); 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 // Testing Creation, Updation and Deletion of Charge for Overdraft Fee
final Integer overdraftFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer overdraftFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsOverdraftFeeJSON()); ChargesHelper.getSavingsOverdraftFeeJSON());
Assert.assertNotNull(overdraftFeeChargeId); Assertions.assertNotNull(overdraftFeeChargeId);
// Updating Charge Amount // Updating Charge Amount
changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdraftFeeChargeId, changes = ChargesHelper.updateCharges(this.requestSpec, this.responseSpec, overdraftFeeChargeId,
ChargesHelper.getModifyChargeJSON()); ChargesHelper.getModifyChargeJSON());
chargeDataAfterChanges = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdraftFeeChargeId); 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); 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; 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 com.google.gson.JsonObject;
import io.restassured.builder.RequestSpecBuilder; 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.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker; import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -88,7 +88,7 @@ public class ClientLoanIntegrationTest {
private SavingsAccountHelper savingsAccountHelper; private SavingsAccountHelper savingsAccountHelper;
private AccountTransferHelper accountTransferHelper; private AccountTransferHelper accountTransferHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -136,7 +136,7 @@ public class ClientLoanIntegrationTest {
addCharges(charges, interestPercentage, "1", null); addCharges(charges, interestPercentage, "1", null);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -222,7 +222,7 @@ public class ClientLoanIntegrationTest {
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
disbursementDetail = loanSchedule.get(0); disbursementDetail = loanSchedule.get(0);
Assert.assertEquals(0, loanCharges.size()); Assertions.assertEquals(0, loanCharges.size());
validateNumberForEqual("0.0", String.valueOf(disbursementDetail.get("feeChargesDue"))); validateNumberForEqual("0.0", String.valueOf(disbursementDetail.get("feeChargesDue")));
} }
@@ -247,7 +247,7 @@ public class ClientLoanIntegrationTest {
addCharges(charges, interestPercentage, "1", null); addCharges(charges, interestPercentage, "1", null);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -311,7 +311,7 @@ public class ClientLoanIntegrationTest {
addCharges(charges, interestPercentage, "1", "29 September 2011"); addCharges(charges, interestPercentage, "1", "29 September 2011");
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -397,7 +397,7 @@ public class ClientLoanIntegrationTest {
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
firstInstallment = loanSchedule.get(1); firstInstallment = loanSchedule.get(1);
Assert.assertEquals(0, loanCharges.size()); Assertions.assertEquals(0, loanCharges.size());
validateNumberForEqual("0", String.valueOf(firstInstallment.get("feeChargesDue"))); validateNumberForEqual("0", String.valueOf(firstInstallment.get("feeChargesDue")));
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
@@ -477,7 +477,7 @@ public class ClientLoanIntegrationTest {
addCharges(charges, interestPercentage, "1", "29 September 2011"); addCharges(charges, interestPercentage, "1", "29 September 2011");
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -699,7 +699,7 @@ public class ClientLoanIntegrationTest {
loanSchedule.remove(0); loanSchedule.remove(0);
for (HashMap installment : loanSchedule) { for (HashMap installment : loanSchedule) {
validateNumberForEqualExcludePrecission("150", String.valueOf(installment.get("feeChargesDue"))); validateNumberForEqualExcludePrecission("150", String.valueOf(installment.get("feeChargesDue")));
if (waivePeriodnum == installment.get("period")) { if (waivePeriodnum.equals(installment.get("period"))) {
validateNumberForEqualExcludePrecission("100.0", validateNumberForEqualExcludePrecission("100.0",
String.valueOf(installment.get("feeChargesOutstanding"))); String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("50.0", String.valueOf(installment.get("feeChargesWaived"))); validateNumberForEqualExcludePrecission("50.0", String.valueOf(installment.get("feeChargesWaived")));
@@ -722,11 +722,11 @@ public class ClientLoanIntegrationTest {
loanSchedule.remove(0); loanSchedule.remove(0);
for (HashMap installment : loanSchedule) { for (HashMap installment : loanSchedule) {
validateNumberForEqualExcludePrecission("150", String.valueOf(installment.get("feeChargesDue"))); validateNumberForEqualExcludePrecission("150", String.valueOf(installment.get("feeChargesDue")));
if (payPeriodnum == installment.get("period")) { if (payPeriodnum.equals(installment.get("period"))) {
validateNumberForEqualExcludePrecission("50.0", validateNumberForEqualExcludePrecission("50.0",
String.valueOf(installment.get("feeChargesOutstanding"))); String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("100.0", String.valueOf(installment.get("feeChargesPaid"))); validateNumberForEqualExcludePrecission("100.0", String.valueOf(installment.get("feeChargesPaid")));
} else if (waivePeriodnum == installment.get("period")) { } else if (waivePeriodnum.equals(installment.get("period"))) {
validateNumberForEqualExcludePrecission("100.0", validateNumberForEqualExcludePrecission("100.0",
String.valueOf(installment.get("feeChargesOutstanding"))); String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("50.0", String.valueOf(installment.get("feeChargesWaived"))); validateNumberForEqualExcludePrecission("50.0", String.valueOf(installment.get("feeChargesWaived")));
@@ -756,7 +756,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplication(clientID, loanProductID, null, savingsId.toString(), final Integer loanID = applyForLoanApplication(clientID, loanProductID, null, savingsId.toString(),
"12,000.00"); "12,000.00");
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -768,7 +768,7 @@ public class ClientLoanIntegrationTest {
HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId); HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE); Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying opening Balance", balance, summary.get("accountBalance")); assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
// DISBURSE // DISBURSE
loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings(SavingsAccountHelper.TRANSACTION_DATE, loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings(SavingsAccountHelper.TRANSACTION_DATE,
@@ -778,7 +778,7 @@ public class ClientLoanIntegrationTest {
summary = savingsAccountHelper.getSavingsSummary(savingsId); summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf("12000"); 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); loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
@@ -786,7 +786,7 @@ public class ClientLoanIntegrationTest {
summary = savingsAccountHelper.getSavingsSummary(savingsId); summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE); 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", final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, null, null, "45,000.00",
tranches); tranches);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -847,7 +847,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, null, savingsId.toString(), final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, null, savingsId.toString(),
"45,000.00", tranches); "45,000.00", tranches);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -859,7 +859,7 @@ public class ClientLoanIntegrationTest {
HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId); HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE); 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 // DISBURSE first Tranche
loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings("1 March 2014", loanID); loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings("1 March 2014", loanID);
@@ -868,7 +868,7 @@ public class ClientLoanIntegrationTest {
summary = savingsAccountHelper.getSavingsSummary(savingsId); summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf("25000"); 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 // DISBURSE Second Tranche
loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings("23 April 2014", loanID); loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings("23 April 2014", loanID);
@@ -877,7 +877,7 @@ public class ClientLoanIntegrationTest {
summary = savingsAccountHelper.getSavingsSummary(savingsId); summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf("25000") + Float.valueOf("20000"); 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); loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
@@ -885,20 +885,20 @@ public class ClientLoanIntegrationTest {
summary = savingsAccountHelper.getSavingsSummary(savingsId); summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE); 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, private void validateCharge(Integer amountPercentage, final List<HashMap> loanCharges, final String amount,
final String outstanding, String amountPaid, String amountWaived) { final String outstanding, String amountPaid, String amountWaived) {
HashMap chargeDetail = getloanCharge(amountPercentage, loanCharges); HashMap chargeDetail = getloanCharge(amountPercentage, loanCharges);
Assert.assertTrue(Float.valueOf(amount) Assertions.assertTrue(Float.valueOf(amount)
.compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountOrPercentage")))) == 0); .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); .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); .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); .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) { final String amount, final String outstanding, String amountPaid, String amountWaived) {
DecimalFormat twoDForm = new DecimalFormat("#"); DecimalFormat twoDForm = new DecimalFormat("#");
HashMap chargeDetail = getloanCharge(amountPercentage, loanCharges); 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); .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); .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); 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); Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountWaived")))))) == 0);
} }
public void validateNumberForEqual(String val, String val2) { 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) { public void validateNumberForEqualWithMsg(String msg, String val, String val2) {
Assert.assertTrue(msg + "expected " + val + " but was " + val2, Assertions.assertTrue(Float.valueOf(val).compareTo(Float.valueOf(val2)) == 0,
Float.valueOf(val).compareTo(Float.valueOf(val2)) == 0); msg + "expected " + val + " but was " + val2);
} }
public void validateNumberForEqualExcludePrecission(String val, String val2) { public void validateNumberForEqualExcludePrecission(String val, String val2) {
DecimalFormat twoDForm = new DecimalFormat("#"); 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); .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(val2)))) == 0);
} }
@@ -1122,101 +1122,140 @@ public class ClientLoanIntegrationTest {
LOG.info( LOG.info(
"--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); "--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2011, 10, 20)), assertEquals(new ArrayList<>(Arrays.asList(2011, 10, 20)),
loanSchedule.get(1).get("dueDate")); loanSchedule.get(1).get("dueDate"),
assertEquals("Checking for Principal Due for 1st Month", Float.valueOf("2911.49"), "Checking for Due Date for 1st Month");
loanSchedule.get(1).get("principalOriginalDue")); assertEquals(Float.valueOf("2911.49"),
assertEquals("Checking for Interest Due for 1st Month", Float.valueOf("240.00"), loanSchedule.get(1).get("principalOriginalDue"),
loanSchedule.get(1).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2011, 11, 20)),
loanSchedule.get(2).get("dueDate")); loanSchedule.get(2).get("dueDate"),
assertEquals("Checking for Principal Due for 2nd Month", Float.valueOf("2969.72"), "Checking for Due Date for 2nd Month");
loanSchedule.get(2).get("principalDue")); assertEquals(Float.valueOf("2969.72"),
assertEquals("Checking for Interest Due for 2nd Month", Float.valueOf("181.77"), loanSchedule.get(2).get("principalDue"),
loanSchedule.get(2).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2011, 12, 20)),
loanSchedule.get(3).get("dueDate")); loanSchedule.get(3).get("dueDate"),
assertEquals("Checking for Principal Due for 3rd Month", Float.valueOf("3029.11"), "Checking for Due Date for 3rd Month");
loanSchedule.get(3).get("principalDue")); assertEquals(Float.valueOf("3029.11"),
assertEquals("Checking for Interest Due for 3rd Month", Float.valueOf("122.38"), loanSchedule.get(3).get("principalDue"),
loanSchedule.get(3).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2012, 1, 20)),
loanSchedule.get(4).get("dueDate")); loanSchedule.get(4).get("dueDate"),
assertEquals("Checking for Principal Due for 4th Month", Float.valueOf("3089.68"), "Checking for Due Date for 4th Month");
loanSchedule.get(4).get("principalDue")); assertEquals(Float.valueOf("3089.68"),
assertEquals("Checking for Interest Due for 4th Month", Float.valueOf("61.79"), loanSchedule.get(4).get("principalDue"),
loanSchedule.get(4).get("interestOriginalDue")); "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) { private void verifyLoanRepaymentScheduleForEqualPrincipal(final ArrayList<HashMap> loanSchedule) {
LOG.info( LOG.info(
"--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); "--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2014, 7, 2)), assertEquals(new ArrayList<>(Arrays.asList(2014, 7, 2)),
loanSchedule.get(1).get("dueDate")); loanSchedule.get(1).get("dueDate"),
assertEquals("Checking for Principal Due for 1st Month", Float.valueOf("416700"), "Checking for Due Date for 1st Month");
loanSchedule.get(1).get("principalOriginalDue")); assertEquals(Float.valueOf("416700"),
assertEquals("Checking for Interest Due for 1st Month", Float.valueOf("200000"), loanSchedule.get(1).get("principalOriginalDue"),
loanSchedule.get(1).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2014, 8, 2)),
loanSchedule.get(2).get("dueDate")); loanSchedule.get(2).get("dueDate"),
assertEquals("Checking for Principal Due for 2nd Month", Float.valueOf("416700"), "Checking for Due Date for 2nd Month");
loanSchedule.get(2).get("principalDue")); assertEquals(Float.valueOf("416700"),
assertEquals("Checking for Interest Due for 2nd Month", Float.valueOf("191700"), loanSchedule.get(2).get("principalDue"),
loanSchedule.get(2).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2014, 9, 2)),
loanSchedule.get(3).get("dueDate")); loanSchedule.get(3).get("dueDate"),
assertEquals("Checking for Principal Due for 3rd Month", Float.valueOf("416700"), "Checking for Due Date for 3rd Month");
loanSchedule.get(3).get("principalDue")); assertEquals(Float.valueOf("416700"),
assertEquals("Checking for Interest Due for 3rd Month", Float.valueOf("183300"), loanSchedule.get(3).get("principalDue"),
loanSchedule.get(3).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2014, 10, 2)),
loanSchedule.get(4).get("dueDate")); loanSchedule.get(4).get("dueDate"),
assertEquals("Checking for Principal Due for 4th Month", Float.valueOf("416700"), "Checking for Due Date for 4th Month");
loanSchedule.get(4).get("principalDue")); assertEquals(Float.valueOf("416700"),
assertEquals("Checking for Interest Due for 4th Month", Float.valueOf("175000"), loanSchedule.get(4).get("principalDue"),
loanSchedule.get(4).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2014, 11, 2)),
loanSchedule.get(5).get("dueDate")); loanSchedule.get(5).get("dueDate"),
assertEquals("Checking for Principal Due for 5th Month", Float.valueOf("416700"), "Checking for Due Date for 5th Month");
loanSchedule.get(5).get("principalDue")); assertEquals(Float.valueOf("416700"),
assertEquals("Checking for Interest Due for 5th Month", Float.valueOf("166700"), loanSchedule.get(5).get("principalDue"),
loanSchedule.get(5).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2014, 12, 2)),
loanSchedule.get(6).get("dueDate")); loanSchedule.get(6).get("dueDate"),
assertEquals("Checking for Principal Due for 6th Month", Float.valueOf("416700"), "Checking for Due Date for 6th Month");
loanSchedule.get(6).get("principalDue")); assertEquals(Float.valueOf("416700"),
assertEquals("Checking for Interest Due for 6th Month", Float.valueOf("158300"), loanSchedule.get(6).get("principalDue"),
loanSchedule.get(6).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2015, 4, 2)),
loanSchedule.get(10).get("dueDate")); loanSchedule.get(10).get("dueDate"),
assertEquals("Checking for Principal Due for 10th Month", Float.valueOf("416700"), "Checking for Due Date for 10th Month");
loanSchedule.get(10).get("principalDue")); assertEquals(Float.valueOf("416700"),
assertEquals("Checking for Interest Due for 10th Month", Float.valueOf("125000"), loanSchedule.get(10).get("principalDue"),
loanSchedule.get(10).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2016, 2, 2)),
loanSchedule.get(20).get("dueDate")); loanSchedule.get(20).get("dueDate"),
assertEquals("Checking for Principal Due for 20th Month", Float.valueOf("416700"), "Checking for Due Date for 20th Month");
loanSchedule.get(20).get("principalDue")); assertEquals(Float.valueOf("416700"),
assertEquals("Checking for Interest Due for 20th Month", Float.valueOf("41700"), loanSchedule.get(20).get("principalDue"),
loanSchedule.get(20).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2016, 6, 2)),
loanSchedule.get(24).get("dueDate")); loanSchedule.get(24).get("dueDate"),
assertEquals("Checking for Principal Due for 24th Month", Float.valueOf("415900"), "Checking for Due Date for 24th Month");
loanSchedule.get(24).get("principalDue")); assertEquals(Float.valueOf("415900"),
assertEquals("Checking for Interest Due for 24th Month", Float.valueOf("8300"), loanSchedule.get(24).get("principalDue"),
loanSchedule.get(24).get("interestOriginalDue")); "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( LOG.info(
"--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); "--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2014, 7, 2)), assertEquals(new ArrayList<>(Arrays.asList(2014, 7, 2)),
loanSchedule.get(1).get("dueDate")); loanSchedule.get(1).get("dueDate"),
validateNumberForEqualWithMsg("Checking for Principal Due for 1st Month", "0.0", "Checking for Due Date for 1st Month");
String.valueOf(loanSchedule.get(1).get("principalOriginalDue"))); validateNumberForEqualWithMsg(String.valueOf(loanSchedule.get(1).get("principalOriginalDue")),
assertEquals("Checking for Interest Due for 1st Month", Float.valueOf("200000"), "Checking for Principal Due for 1st Month", "0.0");
loanSchedule.get(1).get("interestOriginalDue")); 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)), assertEquals(new ArrayList<>(Arrays.asList(2014, 8, 2)),
loanSchedule.get(2).get("dueDate")); loanSchedule.get(2).get("dueDate"),
validateNumberForEqualWithMsg("Checking for Principal Due for 2nd Month", "0.0", "Checking for Due Date for 2nd Month");
String.valueOf(loanSchedule.get(2).get("principalOriginalDue"))); validateNumberForEqualWithMsg("0.0", String.valueOf(loanSchedule.get(2).get("principalOriginalDue")),
assertEquals("Checking for Interest Due for 2nd Month", Float.valueOf("200000"), "Checking for Principal Due for 2nd Month");
loanSchedule.get(2).get("interestOriginalDue")); 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)), assertEquals(new ArrayList<>(Arrays.asList(2014, 9, 2)),
loanSchedule.get(3).get("dueDate")); loanSchedule.get(3).get("dueDate"),
validateNumberForEqualWithMsg("Checking for Principal Due for 3rd Month", "0.0", "Checking for Due Date for 3rd Month");
String.valueOf(loanSchedule.get(3).get("principalDue"))); validateNumberForEqualWithMsg("0.0", String.valueOf(loanSchedule.get(3).get("principalDue")),
assertEquals("Checking for Interest Due for 3rd Month", Float.valueOf("200000"), "Checking for Principal Due for 3rd Month");
loanSchedule.get(3).get("interestOriginalDue")); 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)), assertEquals(new ArrayList<>(Arrays.asList(2014, 10, 2)),
loanSchedule.get(4).get("dueDate")); loanSchedule.get(4).get("dueDate"),
validateNumberForEqualWithMsg("Checking for Principal Due for 4th Month", "0", "Checking for Due Date for 4th Month");
String.valueOf(loanSchedule.get(4).get("principalDue"))); validateNumberForEqualWithMsg("0", String.valueOf(loanSchedule.get(4).get("principalDue")),
assertEquals("Checking for Interest Due for 4th Month", Float.valueOf("200000"), "Checking for Principal Due for 4th Month");
loanSchedule.get(4).get("interestOriginalDue")); 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)), assertEquals(new ArrayList<>(Arrays.asList(2014, 11, 2)),
loanSchedule.get(5).get("dueDate")); loanSchedule.get(5).get("dueDate"),
"Checking for Due Date for 5th Month");
validateNumberForEqualWithMsg("Checking for Principal Due for 5th Month", "0", validateNumberForEqualWithMsg("Checking for Principal Due for 5th Month", "0",
String.valueOf(loanSchedule.get(5).get("principalDue"))); String.valueOf(loanSchedule.get(5).get("principalDue")));
assertEquals("Checking for Interest Due for 5th Month", Float.valueOf("200000"), assertEquals(Float.valueOf("200000"),
loanSchedule.get(5).get("interestOriginalDue")); 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)), assertEquals(new ArrayList<>(Arrays.asList(2014, 12, 2)),
loanSchedule.get(6).get("dueDate")); loanSchedule.get(6).get("dueDate"),
assertEquals("Checking for Principal Due for 6th Month", Float.valueOf("526300"), "Checking for Due Date for 6th Month");
loanSchedule.get(6).get("principalDue")); assertEquals(Float.valueOf("526300"),
assertEquals("Checking for Interest Due for 6th Month", Float.valueOf("200000"), loanSchedule.get(6).get("principalDue"),
loanSchedule.get(6).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2015, 1, 2)),
loanSchedule.get(7).get("dueDate")); loanSchedule.get(7).get("dueDate"),
assertEquals("Checking for Principal Due for 7th Month", Float.valueOf("526300"), "Checking for Due Date for 7th Month");
loanSchedule.get(7).get("principalDue")); assertEquals(Float.valueOf("526300"),
assertEquals("Checking for Interest Due for 7th Month", Float.valueOf("189500"), loanSchedule.get(7).get("principalDue"),
loanSchedule.get(7).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2015, 4, 2)),
loanSchedule.get(10).get("dueDate")); loanSchedule.get(10).get("dueDate"),
assertEquals("Checking for Principal Due for 10th Month", Float.valueOf("526300"), "Checking for Due Date for 10th Month");
loanSchedule.get(10).get("principalDue")); assertEquals(Float.valueOf("526300"),
assertEquals("Checking for Interest Due for 10th Month", Float.valueOf("157900"), loanSchedule.get(10).get("principalDue"),
loanSchedule.get(10).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2016, 2, 2)),
loanSchedule.get(20).get("dueDate")); loanSchedule.get(20).get("dueDate"),
assertEquals("Checking for Principal Due for 20th Month", Float.valueOf("526300"), "Checking for Due Date for 20th Month");
loanSchedule.get(20).get("principalDue")); assertEquals(Float.valueOf("526300"),
assertEquals("Checking for Interest Due for 20th Month", Float.valueOf("52600"), loanSchedule.get(20).get("principalDue"),
loanSchedule.get(20).get("interestOriginalDue")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2016, 6, 2)),
loanSchedule.get(24).get("dueDate")); loanSchedule.get(24).get("dueDate"),
assertEquals("Checking for Principal Due for 24th Month", Float.valueOf("526600"), "Checking for Due Date for 24th Month");
loanSchedule.get(24).get("principalDue")); assertEquals(Float.valueOf("526600"),
assertEquals("Checking for Interest Due for 24th Month", Float.valueOf("10500"), loanSchedule.get(24).get("principalDue"),
loanSchedule.get(24).get("interestOriginalDue")); "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, final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount,
overpaymentAccount); overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -1572,7 +1635,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount,
overpaymentAccount); overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -1763,7 +1826,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount,
overpaymentAccount); overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -1950,7 +2013,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount); expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -2156,7 +2219,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount); expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -2356,7 +2419,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount); expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -2561,7 +2624,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount); expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -2763,7 +2826,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount); expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -2970,7 +3033,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount,
expenseAccount, overpaymentAccount); expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3183,7 +3246,7 @@ public class ClientLoanIntegrationTest {
* Create loan product with RBI strategy * Create loan product with RBI strategy
*/ */
final Integer loanProductID = createLoanProduct("100", "0", LoanProductTestBuilder.RBI_INDIA_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 * Apply for loan application and verify loan status
@@ -3192,7 +3255,7 @@ public class ClientLoanIntegrationTest {
final String principal = "12,000.00"; final String principal = "12,000.00";
final Integer loanID = applyForLoanApplicationWithPaymentStrategy(clientID, loanProductID, null, savingsId, final Integer loanID = applyForLoanApplicationWithPaymentStrategy(clientID, loanProductID, null, savingsId,
principal, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY); principal, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3342,7 +3405,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0)); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3451,7 +3514,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0)); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3535,7 +3598,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges); LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3632,7 +3695,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0)); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3768,7 +3831,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3902,7 +3965,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, REST_START_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3978,7 +4041,7 @@ public class ClientLoanIntegrationTest {
Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanOverdueFeeJSONWithCalculattionTypePercentage("10")); ChargesHelper.getLoanOverdueFeeJSONWithCalculattionTypePercentage("10"));
Assert.assertNotNull(overdueFeeChargeId); Assertions.assertNotNull(overdueFeeChargeId);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID); ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
@@ -3997,7 +4060,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, REST_START_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, null); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4107,7 +4170,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0)); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4218,7 +4281,7 @@ public class ClientLoanIntegrationTest {
LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY,
new ArrayList<HashMap>(0)); new ArrayList<HashMap>(0));
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4305,7 +4368,7 @@ public class ClientLoanIntegrationTest {
LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY,
new ArrayList<HashMap>(0)); new ArrayList<HashMap>(0));
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4356,7 +4419,7 @@ public class ClientLoanIntegrationTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -7); todaysDate.add(Calendar.DAY_OF_MONTH, -7);
loanSummary = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID); loanSummary = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
dates = (List) loanSummary.get("overdueSinceDate"); 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", LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0), "1",
null); null);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4597,8 +4660,8 @@ public class ClientLoanIntegrationTest {
LOG.info( LOG.info(
"--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); "--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
for (Map<String, Object> values : expectedvalues) { for (Map<String, Object> values : expectedvalues) {
assertEquals("Checking for Due Date for installment " + index, values.get("dueDate"), assertEquals(values.get("dueDate"), loanSchedule.get(index).get("dueDate"),
loanSchedule.get(index).get("dueDate")); "Checking for Due Date for installment " + index);
validateNumberForEqualWithMsg("Checking for Principal Due for installment " + index, validateNumberForEqualWithMsg("Checking for Principal Due for installment " + index,
String.valueOf(values.get("principalDue")), String.valueOf(values.get("principalDue")),
String.valueOf(loanSchedule.get(index).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, final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED,
assetAccount, incomeAccount, expenseAccount, overpaymentAccount); assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
/*** /***
* Apply for loan application and verify loan status * Apply for loan application and verify loan status
@@ -4660,7 +4723,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges,
savingsId, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4); savingsId, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4809,7 +4872,7 @@ public class ClientLoanIntegrationTest {
ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);// , ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);// ,
// LoanProductTestBuilder.EQUAL_INSTALLMENTS, // LoanProductTestBuilder.EQUAL_INSTALLMENTS,
// LoanProductTestBuilder.FLAT_BALANCE); // LoanProductTestBuilder.FLAT_BALANCE);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
/*** /***
* Apply for loan application and verify loan status * Apply for loan application and verify loan status
@@ -4826,7 +4889,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges,
savingsId, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4); savingsId, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4959,15 +5022,15 @@ public class ClientLoanIntegrationTest {
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
MINIMUM_OPENING_BALANCE); MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
ACCOUNT_TYPE_INDIVIDUAL); ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID, savingsProductID, savingsId, HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID, savingsProductID, savingsId,
ACCOUNT_TYPE_INDIVIDUAL); ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertTrue(modifications.containsKey("submittedOnDate")); Assertions.assertTrue(modifications.containsKey("submittedOnDate"));
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec,
savingsId); savingsId);
@@ -4990,7 +5053,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED,
assetAccount, incomeAccount, expenseAccount, overpaymentAccount); assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
/*** /***
* Apply for loan application and verify loan status * Apply for loan application and verify loan status
@@ -5007,7 +5070,7 @@ public class ClientLoanIntegrationTest {
final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges,
null, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4); null, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -5105,8 +5168,8 @@ public class ClientLoanIntegrationTest {
toSavingsBalance += TRANSFER_AMOUNT; toSavingsBalance += TRANSFER_AMOUNT;
// Verifying toSavings Account Balance after Account Transfer // Verifying toSavings Account Balance after Account Transfer
assertEquals("Verifying From Savings Account Balance after Account Transfer", toSavingsBalance, assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
toSavingsSummaryAfter.get("accountBalance")); "Verifying From Savings Account Balance after Account Transfer");
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now, this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now,
new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.CREDIT), new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.CREDIT),
@@ -5136,8 +5199,8 @@ public class ClientLoanIntegrationTest {
toSavingsBalance += TRANSFER_AMOUNT; toSavingsBalance += TRANSFER_AMOUNT;
// Verifying toSavings Account Balance after Account Transfer // Verifying toSavings Account Balance after Account Transfer
assertEquals("Verifying From Savings Account Balance after Account Transfer", toSavingsBalance, assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
toSavingsSummaryAfter.get("accountBalance")); "Verifying From Savings Account Balance after Account Transfer");
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now, this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now,
new JournalEntry(Float.valueOf("2000"), JournalEntry.TransactionType.CREDIT), new JournalEntry(Float.valueOf("2000"), JournalEntry.TransactionType.CREDIT),
@@ -5233,7 +5296,7 @@ public class ClientLoanIntegrationTest {
addCharges(charges, flatAmountChargeTwo, "100", "15 December 2011"); addCharges(charges, flatAmountChargeTwo, "100", "15 December 2011");
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "10,000.00"); 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); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.HashMap; import java.util.HashMap;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -26,9 +26,9 @@ import io.restassured.specification.ResponseSpecification;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ClientHelper; import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class ClientTest { public class ClientTest {
@@ -36,7 +36,7 @@ public class ClientTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private ClientHelper clientHelper; private ClientHelper clientHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -49,7 +49,7 @@ public class ClientTest {
public void testClientStatus() { public void testClientStatus() {
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClient(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)); HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientIsActive(status); ClientStatusChecker.verifyClientIsActive(status);
@@ -82,7 +82,7 @@ public class ClientTest {
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientAsPerson(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)); HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientIsActive(status); ClientStatusChecker.verifyClientIsActive(status);
@@ -115,7 +115,7 @@ public class ClientTest {
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientAsEntity(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)); HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientIsActive(status); ClientStatusChecker.verifyClientIsActive(status);
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants; import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
@SuppressWarnings({ "unused" }) @SuppressWarnings({ "unused" })
public class ClientUndoRejectAndWithdrawalIntegrationTest { public class ClientUndoRejectAndWithdrawalIntegrationTest {
@@ -49,7 +49,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private ClientHelper clientHelper; private ClientHelper clientHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -66,7 +66,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT // CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
// GET CLIENT STATUS // GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -90,7 +90,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT // CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
// GET CLIENT STATUS // GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -119,7 +119,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT // CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
// GET CLIENT STATUS // GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -149,7 +149,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT // CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
// GET CLIENT STATUS // GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -179,7 +179,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT // CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
// GET CLIENT STATUS // GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -204,7 +204,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT // CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
// GET CLIENT STATUS // GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -233,7 +233,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT // CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
// GET CLIENT STATUS // GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -262,7 +262,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT // CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
// GET CLIENT STATUS // GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
@@ -295,7 +295,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT // CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
// GET CLIENT STATUS // GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId)); String.valueOf(clientId));
@@ -320,7 +320,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
// CREATE CLIENT // CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
// GET CLIENT STATUS // GET CLIENT STATUS
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
String.valueOf(clientId)); 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.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder; import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -50,7 +50,7 @@ public class ConcurrencyIntegrationTest {
final int MYTHREADS = 30; final int MYTHREADS = 30;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); 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.CurrenciesHelper;
import org.apache.fineract.integrationtests.common.CurrencyDomain; import org.apache.fineract.integrationtests.common.CurrencyDomain;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
@SuppressWarnings({ "unused", "rawtypes" }) @SuppressWarnings({ "unused", "rawtypes" })
public class CurrenciesTest { public class CurrenciesTest {
@@ -38,7 +38,7 @@ public class CurrenciesTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -52,13 +52,13 @@ public class CurrenciesTest {
CurrencyDomain currency = CurrenciesHelper.getCurrencybyCode(requestSpec, responseSpec, "USD"); CurrencyDomain currency = CurrenciesHelper.getCurrencybyCode(requestSpec, responseSpec, "USD");
CurrencyDomain usd = CurrencyDomain.create("USD", "US Dollar", 2, "$", "currency.USD", "US Dollar ($)").build(); CurrencyDomain usd = CurrencyDomain.create("USD", "US Dollar", 2, "$", "currency.USD", "US Dollar ($)").build();
Assert.assertTrue(currency.getDecimalPlaces() >= 0); Assertions.assertTrue(currency.getDecimalPlaces() >= 0);
Assert.assertNotNull(currency.getName()); Assertions.assertNotNull(currency.getName());
Assert.assertNotNull(currency.getDisplaySymbol()); Assertions.assertNotNull(currency.getDisplaySymbol());
Assert.assertNotNull(currency.getDisplayLabel()); Assertions.assertNotNull(currency.getDisplayLabel());
Assert.assertNotNull(currency.getNameCode()); Assertions.assertNotNull(currency.getNameCode());
Assert.assertEquals(usd, currency); Assertions.assertEquals(usd, currency);
} }
@Test @Test
@@ -76,9 +76,9 @@ public class CurrenciesTest {
ArrayList<String> currenciesOutput = CurrenciesHelper.updateSelectedCurrencies(this.requestSpec, this.responseSpec, ArrayList<String> currenciesOutput = CurrenciesHelper.updateSelectedCurrencies(this.requestSpec, this.responseSpec,
currenciestoUpdate); 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 // Test that output matches updation
ArrayList<CurrencyDomain> currenciesBeforeUpdate = new ArrayList<CurrencyDomain>(); ArrayList<CurrencyDomain> currenciesBeforeUpdate = new ArrayList<CurrencyDomain>();
@@ -88,8 +88,8 @@ public class CurrenciesTest {
Collections.sort(currenciesBeforeUpdate); Collections.sort(currenciesBeforeUpdate);
ArrayList<CurrencyDomain> currenciesAfterUpdate = CurrenciesHelper.getSelectedCurrencies(requestSpec, responseSpec); 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 io.restassured.specification.ResponseSpecification;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper; import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
public class CurrencyIntegrationTest { public class CurrencyIntegrationTest {
@@ -34,7 +34,7 @@ public class CurrencyIntegrationTest {
private SavingsAccountHelper savingsAccountHelper; private SavingsAccountHelper savingsAccountHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,8 +18,8 @@
*/ */
package org.apache.fineract.integrationtests; package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.LoanRescheduleRequestTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Ignore; import org.junit.jupiter.api.Disabled;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Tests loan schedule change based on group meeting changes and loan * Tests loan schedule change based on group meeting changes and loan
* rescheduling * rescheduling
**/ **/
@SuppressWarnings({ "rawtypes" }) @SuppressWarnings({ "rawtypes" })
@Ignore @Disabled
public class DisbursalAndRepaymentScheduleTest { public class DisbursalAndRepaymentScheduleTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
@@ -71,7 +71,7 @@ public class DisbursalAndRepaymentScheduleTest {
private final SimpleDateFormat dateFormatterStandard = new SimpleDateFormat("dd MMMM yyyy"); private final SimpleDateFormat dateFormatterStandard = new SimpleDateFormat("dd MMMM yyyy");
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
} }
@@ -148,7 +148,7 @@ public class DisbursalAndRepaymentScheduleTest {
this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON); this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
// Test for loan account is created // Test for loan account is created
Assert.assertNotNull(this.loanId); Assertions.assertNotNull(this.loanId);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
this.loanId); this.loanId);
@@ -185,8 +185,8 @@ public class DisbursalAndRepaymentScheduleTest {
dueDateCalendar.setFirstDayOfWeek(Calendar.MONDAY); dueDateCalendar.setFirstDayOfWeek(Calendar.MONDAY);
dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1, dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
(Integer) dueDateLoanSchedule.get(2)); (Integer) dueDateLoanSchedule.get(2));
assertEquals("AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY", 3, assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
dueDateCalendar.get(Calendar.DAY_OF_WEEK)); "AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY");
// system.out.println("---------------------------------CREATING LOAN RESCHEDULE // system.out.println("---------------------------------CREATING LOAN RESCHEDULE
// REQUEST------------------------------------------"); // REQUEST------------------------------------------");
@@ -205,8 +205,8 @@ public class DisbursalAndRepaymentScheduleTest {
dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate"); dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1, dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
(Integer) dueDateLoanSchedule.get(2)); (Integer) dueDateLoanSchedule.get(2));
assertEquals("AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY, EVEN AFTER LOAN RESCHEDULE REQUEST WAS SENT", assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
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: " + // system.out.println("Successfully created loan reschedule request (ID: " +
// this.loanRescheduleRequestId + ")"); // this.loanRescheduleRequestId + ")");
@@ -229,8 +229,8 @@ public class DisbursalAndRepaymentScheduleTest {
dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate"); dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1, dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
(Integer) dueDateLoanSchedule.get(2)); (Integer) dueDateLoanSchedule.get(2));
assertEquals("AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY, EVEN AFTER RESCHEDULE", assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
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: " + // system.out.println("Successfully changed group meeting date (CAELNDAR ID: " +
// this.groupCalendarId // this.groupCalendarId
// + ") and rescheduled loan (RESCHEDULE ID: " + this.loanRescheduleRequestId + // + ") and rescheduled loan (RESCHEDULE ID: " + this.loanRescheduleRequestId +
@@ -308,7 +308,7 @@ public class DisbursalAndRepaymentScheduleTest {
this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON); this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
// Test for loan account is created // Test for loan account is created
Assert.assertNotNull(this.loanId); Assertions.assertNotNull(this.loanId);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
this.loanId); this.loanId);
@@ -346,8 +346,8 @@ public class DisbursalAndRepaymentScheduleTest {
expectedMaturityCalendar.set((Integer) expectedMaturityDate.get(0), expectedMaturityCalendar.set((Integer) expectedMaturityDate.get(0),
(Integer) expectedMaturityDate.get(1) - 1, (Integer) expectedMaturityDate.get(2)); (Integer) expectedMaturityDate.get(1) - 1, (Integer) expectedMaturityDate.get(2));
assertEquals("AFTER MEETING CHANGE DATE THE EXPECTED MATURITY SHOULD BE ON TUESDAY", 3, assertEquals(3, expectedMaturityCalendar.get(Calendar.DAY_OF_WEEK),
expectedMaturityCalendar.get(Calendar.DAY_OF_WEEK)); "AFTER MEETING CHANGE DATE THE EXPECTED MATURITY SHOULD BE ON TUESDAY");
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec,
this.responseSpecForStatusCode403); this.responseSpecForStatusCode403);
@@ -27,9 +27,9 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.ExternalServicesConfigurationHelper; import org.apache.fineract.integrationtests.common.ExternalServicesConfigurationHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -41,7 +41,7 @@ public class ExternalServicesConfigurationTest {
private ExternalServicesConfigurationHelper externalServicesConfigurationHelper; private ExternalServicesConfigurationHelper externalServicesConfigurationHelper;
private ResponseSpecification httpStatusForidden; private ResponseSpecification httpStatusForidden;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -59,7 +59,7 @@ public class ExternalServicesConfigurationTest {
String configName = "s3_access_key"; String configName = "s3_access_key";
ArrayList<HashMap> externalServicesConfig = this.externalServicesConfigurationHelper ArrayList<HashMap> externalServicesConfig = this.externalServicesConfigurationHelper
.getExternalServicesConfigurationByServiceName(requestSpec, responseSpec, "S3"); .getExternalServicesConfigurationByServiceName(requestSpec, responseSpec, "S3");
Assert.assertNotNull(externalServicesConfig); Assertions.assertNotNull(externalServicesConfig);
for (Integer configIndex = 0; configIndex < externalServicesConfig.size(); configIndex++) { for (Integer configIndex = 0; configIndex < externalServicesConfig.size(); configIndex++) {
String name = (String) externalServicesConfig.get(configIndex).get("name"); String name = (String) externalServicesConfig.get(configIndex).get("name");
String value = null; String value = null;
@@ -72,12 +72,12 @@ public class ExternalServicesConfigurationTest {
LOG.info( "{} : {}",name, value); LOG.info( "{} : {}",name, value);
HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec, HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
responseSpec, "S3", name, newValue); responseSpec, "S3", name, newValue);
Assert.assertNotNull(arrayListValue.get("value")); Assertions.assertNotNull(arrayListValue.get("value"));
Assert.assertEquals(arrayListValue.get("value"), newValue); Assertions.assertEquals(arrayListValue.get("value"), newValue);
HashMap arrayListValue1 = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec, HashMap arrayListValue1 = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
responseSpec, "S3", name, value); responseSpec, "S3", name, value);
Assert.assertNotNull(arrayListValue1.get("value")); Assertions.assertNotNull(arrayListValue1.get("value"));
Assert.assertEquals(arrayListValue1.get("value"), value); Assertions.assertEquals(arrayListValue1.get("value"), value);
} }
} }
@@ -87,7 +87,7 @@ public class ExternalServicesConfigurationTest {
configName = "username"; configName = "username";
externalServicesConfig = this.externalServicesConfigurationHelper.getExternalServicesConfigurationByServiceName(requestSpec, externalServicesConfig = this.externalServicesConfigurationHelper.getExternalServicesConfigurationByServiceName(requestSpec,
responseSpec, "SMTP"); responseSpec, "SMTP");
Assert.assertNotNull(externalServicesConfig); Assertions.assertNotNull(externalServicesConfig);
for (Integer configIndex = 0; configIndex < externalServicesConfig.size(); configIndex++) { for (Integer configIndex = 0; configIndex < externalServicesConfig.size(); configIndex++) {
String name = (String) externalServicesConfig.get(configIndex).get("name"); String name = (String) externalServicesConfig.get(configIndex).get("name");
String value = null; String value = null;
@@ -100,12 +100,12 @@ public class ExternalServicesConfigurationTest {
LOG.info("{} : {}",name,value); LOG.info("{} : {}",name,value);
HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec, HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
responseSpec, "SMTP", name, newValue); responseSpec, "SMTP", name, newValue);
Assert.assertNotNull(arrayListValue.get("value")); Assertions.assertNotNull(arrayListValue.get("value"));
Assert.assertEquals(arrayListValue.get("value"), newValue); Assertions.assertEquals(arrayListValue.get("value"), newValue);
HashMap arrayListValue1 = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec, HashMap arrayListValue1 = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
responseSpec, "SMTP", name, value); responseSpec, "SMTP", name, value);
Assert.assertNotNull(arrayListValue1.get("value")); Assertions.assertNotNull(arrayListValue1.get("value"));
Assert.assertEquals(arrayListValue1.get("value"), value); Assertions.assertEquals(arrayListValue1.get("value"), value);
} }
} }
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.Account;
import org.apache.fineract.integrationtests.common.accounting.AccountHelper; import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper; import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public class FinancialActivityAccountsTest { public class FinancialActivityAccountsTest {
@@ -53,7 +53,7 @@ public class FinancialActivityAccountsTest {
private final Integer assetTransferFinancialActivityId = FinancialActivity.ASSET_TRANSFER.getValue(); private final Integer assetTransferFinancialActivityId = FinancialActivity.ASSET_TRANSFER.getValue();
public static final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID = FinancialActivity.LIABILITY_TRANSFER.getValue(); public static final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID = FinancialActivity.LIABILITY_TRANSFER.getValue();
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -73,14 +73,14 @@ public class FinancialActivityAccountsTest {
/** Create a Liability and an Asset Transfer Account **/ /** Create a Liability and an Asset Transfer Account **/
Account liabilityTransferAccount = accountHelper.createLiabilityAccount(); Account liabilityTransferAccount = accountHelper.createLiabilityAccount();
Account assetTransferAccount = accountHelper.createAssetAccount(); Account assetTransferAccount = accountHelper.createAssetAccount();
Assert.assertNotNull(assetTransferAccount); Assertions.assertNotNull(assetTransferAccount);
Assert.assertNotNull(liabilityTransferAccount); Assertions.assertNotNull(liabilityTransferAccount);
/*** Create A Financial Activity to Account Mapping **/ /*** Create A Financial Activity to Account Mapping **/
Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount( Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount.getAccountID(), responseSpec, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount.getAccountID(), responseSpec,
CommonConstants.RESPONSE_RESOURCE_ID); CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId); Assertions.assertNotNull(financialActivityAccountId);
/*** /***
* Fetch Created Financial Activity to Account Mapping and validate * Fetch Created Financial Activity to Account Mapping and validate
@@ -93,12 +93,12 @@ public class FinancialActivityAccountsTest {
* changes * changes
**/ **/
Account newLiabilityTransferAccount = accountHelper.createLiabilityAccount(); Account newLiabilityTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(newLiabilityTransferAccount); Assertions.assertNotNull(newLiabilityTransferAccount);
HashMap changes = (HashMap) financialActivityAccountHelper.updateFinancialActivityAccount(financialActivityAccountId, HashMap changes = (HashMap) financialActivityAccountHelper.updateFinancialActivityAccount(financialActivityAccountId,
LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, newLiabilityTransferAccount.getAccountID(), responseSpec, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, newLiabilityTransferAccount.getAccountID(), responseSpec,
CommonConstants.RESPONSE_CHANGES); CommonConstants.RESPONSE_CHANGES);
Assert.assertEquals(newLiabilityTransferAccount.getAccountID(), changes.get("glAccountId")); Assertions.assertEquals(newLiabilityTransferAccount.getAccountID(), changes.get("glAccountId"));
/** Validate update works correctly **/ /** Validate update works correctly **/
assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, 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 **/ /** Should be able to delete a Financial Activity to Account Mapping **/
Integer deletedFinancialActivityAccountId = financialActivityAccountHelper.deleteFinancialActivityAccount( Integer deletedFinancialActivityAccountId = financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, responseSpec, CommonConstants.RESPONSE_RESOURCE_ID); financialActivityAccountId, responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId); Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId); Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
/*** Trying to fetch a Deleted Account Mapping should give me a 404 **/ /*** Trying to fetch a Deleted Account Mapping should give me a 404 **/
financialActivityAccountHelper.getFinancialActivityAccount(deletedFinancialActivityAccountId, responseSpecForResourceNotFoundError); financialActivityAccountHelper.getFinancialActivityAccount(deletedFinancialActivityAccountId, responseSpecForResourceNotFoundError);
@@ -140,22 +140,22 @@ public class FinancialActivityAccountsTest {
private void assertFinancialActivityAccountCreation(Integer financialActivityAccountId, Integer financialActivityId, Account glAccount) { private void assertFinancialActivityAccountCreation(Integer financialActivityAccountId, Integer financialActivityId, Account glAccount) {
HashMap mappingDetails = financialActivityAccountHelper.getFinancialActivityAccount(financialActivityAccountId, responseSpec); HashMap mappingDetails = financialActivityAccountHelper.getFinancialActivityAccount(financialActivityAccountId, responseSpec);
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id")); Assertions.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id")); Assertions.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
} }
/** /**
* Delete the Financial activities * Delete the Financial activities
*/ */
@After @AfterEach
public void tearDown() { public void tearDown() {
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec); List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
for (HashMap financialActivity : financialActivities) { for (HashMap financialActivity : financialActivities) {
Integer financialActivityAccountId = (Integer) financialActivity.get("id"); Integer financialActivityAccountId = (Integer) financialActivity.get("id");
Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper.deleteFinancialActivityAccount( Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID); financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId); Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId); Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
} }
} }
} }
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.Months; import org.joda.time.Months;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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, // digits. A proper solution would be to implement the exact interest calculation in this test,
// and then to compare the exact results // and then to compare the exact results
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); 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()); final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
/*** /***
* Create FD product with CashBased accounting enabled * Create FD product with CashBased accounting enabled
@@ -168,14 +168,14 @@ public class FixedDepositTest {
final String accountingRule = CASH_BASED; final String accountingRule = CASH_BASED;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount, Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount,
incomeAccount, expenseAccount); incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
/*** /***
* Apply for FD account with created product and verify status * Apply for FD account with created product and verify status
*/ */
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -210,13 +210,13 @@ public class FixedDepositTest {
* Update interest earned of FD account * Update interest earned of FD account
*/ */
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId); fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
/*** /***
* Post interest and verify the account summary * Post interest and verify the account summary
*/ */
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId); Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest); Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId); accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted"); Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -234,7 +234,7 @@ public class FixedDepositTest {
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit( Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID); fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId); Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -296,7 +296,7 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime()); final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
/*** /***
* Create FD product with CashBased accounting enabled * Create FD product with CashBased accounting enabled
@@ -305,14 +305,14 @@ public class FixedDepositTest {
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax); final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
Integer fixedDepositProductId = createFixedDepositProductWithWithHoldTax(VALID_FROM, VALID_TO, String.valueOf(taxGroupId), Integer fixedDepositProductId = createFixedDepositProductWithWithHoldTax(VALID_FROM, VALID_TO, String.valueOf(taxGroupId),
accountingRule, assetAccount, liabilityAccount, incomeAccount, expenseAccount); accountingRule, assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
/*** /***
* Apply for FD account with created product and verify status * Apply for FD account with created product and verify status
*/ */
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
SUBMITTED_ON_DATE, WHOLE_TERM); SUBMITTED_ON_DATE, WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -347,17 +347,17 @@ public class FixedDepositTest {
* Update interest earned of FD account * Update interest earned of FD account
*/ */
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId); fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
/*** /***
* Post interest and verify the account summary * Post interest and verify the account summary
*/ */
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId); Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest); Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId); accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted"); Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
Assert.assertNull(accountSummary.get("totalWithholdTax")); Assertions.assertNull(accountSummary.get("totalWithholdTax"));
/*** /***
* Verify journal entries transactions for interest posting transaction * Verify journal entries transactions for interest posting transaction
@@ -372,7 +372,7 @@ public class FixedDepositTest {
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit( Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID); fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId); Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -386,7 +386,7 @@ public class FixedDepositTest {
Float maturityAmount = Float.valueOf(accountDetails.get("maturityAmount").toString()); Float maturityAmount = Float.valueOf(accountDetails.get("maturityAmount").toString());
HashMap summary = (HashMap) accountDetails.get("summary"); HashMap summary = (HashMap) accountDetails.get("summary");
Assert.assertNotNull(summary.get("totalWithholdTax")); Assertions.assertNotNull(summary.get("totalWithholdTax"));
Float withHoldTax = (Float) summary.get("totalWithholdTax"); Float withHoldTax = (Float) summary.get("totalWithholdTax");
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount, 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()); final String CLOSED_ON_DATE = dateFormat.format(closedOn.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
/*** /***
* Create FD product with CashBased accounting enabled * Create FD product with CashBased accounting enabled
@@ -450,14 +450,14 @@ public class FixedDepositTest {
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax); final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
Integer fixedDepositProductId = createFixedDepositProductWithWithHoldTax(VALID_FROM, VALID_TO, String.valueOf(taxGroupId), Integer fixedDepositProductId = createFixedDepositProductWithWithHoldTax(VALID_FROM, VALID_TO, String.valueOf(taxGroupId),
accountingRule, assetAccount, liabilityAccount, incomeAccount, expenseAccount); accountingRule, assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
/*** /***
* Apply for FD account with created product and verify status * Apply for FD account with created product and verify status
*/ */
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
SUBMITTED_ON_DATE, WHOLE_TERM); SUBMITTED_ON_DATE, WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -492,17 +492,17 @@ public class FixedDepositTest {
* Update interest earned of FD account * Update interest earned of FD account
*/ */
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId); fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
/*** /***
* Post interest and verify the account summary * Post interest and verify the account summary
*/ */
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId); Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest); Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId); accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
accountSummary.get("totalInterestPosted"); accountSummary.get("totalInterestPosted");
Assert.assertNull(accountSummary.get("totalWithholdTax")); Assertions.assertNull(accountSummary.get("totalWithholdTax"));
/*** /***
* FD account verify whether account is matured * FD account verify whether account is matured
@@ -516,7 +516,7 @@ public class FixedDepositTest {
fixedDepositAccountId); fixedDepositAccountId);
HashMap summary = (HashMap) accountDetails.get("summary"); HashMap summary = (HashMap) accountDetails.get("summary");
Assert.assertNotNull(summary.get("totalWithholdTax")); Assertions.assertNotNull(summary.get("totalWithholdTax"));
Float withHoldTax = (Float) summary.get("totalWithholdTax"); Float withHoldTax = (Float) summary.get("totalWithholdTax");
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax, this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
JournalEntry.TransactionType.CREDIT)); JournalEntry.TransactionType.CREDIT));
@@ -651,21 +651,21 @@ public class FixedDepositTest {
final String ACTIVATION_DATE = "01 March 2015"; final String ACTIVATION_DATE = "01 March 2015";
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
/*** /***
* Create FD product with CashBased accounting enabled * Create FD product with CashBased accounting enabled
*/ */
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, chartToUse); 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 * Apply for FD account with created product and verify status
*/ */
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM, depositAmount, depositPeriod); WHOLE_TERM, depositAmount, depositPeriod);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -685,7 +685,7 @@ public class FixedDepositTest {
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositDetails(fixedDepositAccountId); 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()); final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
/*** /***
* Create Savings product with CashBased accounting enabled * Create Savings product with CashBased accounting enabled
@@ -740,10 +740,10 @@ public class FixedDepositTest {
final String accountingRule = CASH_BASED; final String accountingRule = CASH_BASED;
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, accountingRule, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, accountingRule,
assetAccount, liabilityAccount, incomeAccount, expenseAccount); assetAccount, liabilityAccount, incomeAccount, expenseAccount);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientId, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL); 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); HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -759,11 +759,11 @@ public class FixedDepositTest {
*/ */
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount, Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount,
incomeAccount, expenseAccount); incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -792,13 +792,13 @@ public class FixedDepositTest {
* Update interest earned of FD account * Update interest earned of FD account
*/ */
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId); fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
/*** /***
* Post interest and verify the account summary * Post interest and verify the account summary
*/ */
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId); Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest); Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId); accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted"); Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -827,7 +827,7 @@ public class FixedDepositTest {
*/ */
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit( Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_TRANSFER_TO_SAVINGS, savingsId, CommonConstants.RESPONSE_RESOURCE_ID); 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, fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -852,7 +852,7 @@ public class FixedDepositTest {
Float balanceAfter = (Float) savingsSummaryAfter.get("accountBalance"); Float balanceAfter = (Float) savingsSummaryAfter.get("accountBalance");
Float expectedSavingsBalance = balanceBefore + prematurityAmount; 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()); final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
/*** /***
* Create FD product with CashBased accounting enabled * Create FD product with CashBased accounting enabled
@@ -911,11 +911,11 @@ public class FixedDepositTest {
final String accountingRule = CASH_BASED; final String accountingRule = CASH_BASED;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount, Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount,
incomeAccount, expenseAccount); incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -941,10 +941,10 @@ public class FixedDepositTest {
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, ACTIVATION_DATE, liablilityAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, ACTIVATION_DATE, liablilityAccountInitialEntry);
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId); fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId); Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
Assert.assertNotNull(transactionIdForPostInterest); Assertions.assertNotNull(transactionIdForPostInterest);
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId); accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted"); Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
@@ -988,11 +988,11 @@ public class FixedDepositTest {
String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
this.fixedDepositProductHelper.retrieveAllFixedDepositProducts(this.requestSpec, this.fixedDepositProductHelper.retrieveAllFixedDepositProducts(this.requestSpec,
this.responseSpec); this.responseSpec);
@@ -1001,13 +1001,13 @@ public class FixedDepositTest {
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
todaysDate.add(Calendar.DATE, -1); todaysDate.add(Calendar.DATE, -1);
SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateFixedDepositAccount(clientId.toString(), HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateFixedDepositAccount(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), VALID_FROM, VALID_TO, WHOLE_TERM, SUBMITTED_ON_DATE); 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()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -1075,15 +1075,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -1116,15 +1116,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -1155,22 +1155,22 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap); FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
fixedDepositAccountId = (Integer) this.fixedDepositAccountHelper.deleteFixedDepositApplication(fixedDepositAccountId, "resourceId"); fixedDepositAccountId = (Integer) this.fixedDepositAccountHelper.deleteFixedDepositApplication(fixedDepositAccountId, "resourceId");
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
} }
@Test @Test
@@ -1198,15 +1198,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -1238,7 +1238,7 @@ public class FixedDepositTest {
principal = (float) Math.floor(principal); principal = (float) Math.floor(principal);
maturityAmount = (float) Math.floor(maturityAmount); maturityAmount = (float) Math.floor(maturityAmount);
LOG.info("{}",principal.toString()); 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 @Test
@@ -1266,15 +1266,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360, 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); principal = (float) Math.floor(principal);
maturityAmount = (float) Math.floor(maturityAmount); maturityAmount = (float) Math.floor(maturityAmount);
LOG.info("{}",principal.toString()); 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 @Test
@@ -1342,15 +1342,15 @@ public class FixedDepositTest {
final String CLOSED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String CLOSED_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -1399,7 +1399,7 @@ public class FixedDepositTest {
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit( Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID); fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId); Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -1411,7 +1411,7 @@ public class FixedDepositTest {
principal = (float) Math.floor(principal); principal = (float) Math.floor(principal);
Float maturityAmount = (float) Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); 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()); final String CLOSED_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360, 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( Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID); fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId); Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -1517,7 +1517,7 @@ public class FixedDepositTest {
principal = (float) Math.floor(principal); principal = (float) Math.floor(principal);
Float maturityAmount = (float) Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); 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()); final String CLOSED_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
TILL_PREMATURE_WITHDRAWAL); TILL_PREMATURE_WITHDRAWAL);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -1616,7 +1616,7 @@ public class FixedDepositTest {
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit( Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID); fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId); Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -1628,7 +1628,7 @@ public class FixedDepositTest {
Double expectedPrematureAmount = Math.floor(principal); Double expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((float) fixedDepositAccountData.get("maturityAmount")); 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()); final String CLOSED_ON_DATE = dateFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
TILL_PREMATURE_WITHDRAWAL); TILL_PREMATURE_WITHDRAWAL);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360, 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( Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID); fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(prematureClosureTransactionId); Assertions.assertNotNull(prematureClosureTransactionId);
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -1743,7 +1743,7 @@ public class FixedDepositTest {
Float expectedPrematureAmount = (float) Math.floor(principal); Float expectedPrematureAmount = (float) Math.floor(principal);
Float maturityAmount = (float) Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); 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()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_365, 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); principal = (float) Math.floor(principal);
maturityAmount = (float) Math.floor(maturityAmount); maturityAmount = (float) Math.floor(maturityAmount);
LOG.info("{}",principal.toString()); 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); LOG.info("Submitted Date: {}" , SUBMITTED_ON_DATE);
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360, 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(); principal = new BigDecimal(principal).setScale(0, RoundingMode.FLOOR).floatValue();
maturityAmount = new BigDecimal(maturityAmount).setScale(0, RoundingMode.FLOOR).floatValue(); maturityAmount = new BigDecimal(maturityAmount).setScale(0, RoundingMode.FLOOR).floatValue();
LOG.info("{}",principal.toString()); 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()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_365, 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 expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); 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()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360, 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 expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); 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()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_365, 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 expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); 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()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360, 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 expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); 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()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_365, 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 expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); 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 @Test
@@ -2336,15 +2336,15 @@ public class FixedDepositTest {
monthDayFormat.format(todaysDate.getTime()); monthDayFormat.format(todaysDate.getTime());
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
final String accountingRule = NONE; final String accountingRule = NONE;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM); WHOLE_TERM);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360, 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 expectedPrematureAmount = Math.floor(principal);
Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); 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); todaysDate.add(Calendar.DATE, numberOfDaysLeft);
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
/*** /***
* Create FD product with CashBased accounting enabled * Create FD product with CashBased accounting enabled
@@ -2433,7 +2433,7 @@ public class FixedDepositTest {
final String accountingRule = CASH_BASED; final String accountingRule = CASH_BASED;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount, Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount,
incomeAccount, expenseAccount); incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
/*** /***
* Set maturityInstructionId as re-invest principal+interest * Set maturityInstructionId as re-invest principal+interest
@@ -2446,7 +2446,7 @@ public class FixedDepositTest {
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM, maturityInstructionId); WHOLE_TERM, maturityInstructionId);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -2507,7 +2507,7 @@ public class FixedDepositTest {
todaysDate.add(Calendar.DATE, numberOfDaysLeft); todaysDate.add(Calendar.DATE, numberOfDaysLeft);
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
/*** /***
* Create FD product with CashBased accounting enabled * Create FD product with CashBased accounting enabled
@@ -2515,7 +2515,7 @@ public class FixedDepositTest {
final String accountingRule = CASH_BASED; final String accountingRule = CASH_BASED;
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount, Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, assetAccount, liabilityAccount,
incomeAccount, expenseAccount); incomeAccount, expenseAccount);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
/*** /***
* Set maturityInstructionId as re-invest principal * Set maturityInstructionId as re-invest principal
@@ -2528,7 +2528,7 @@ public class FixedDepositTest {
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE, Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
WHOLE_TERM, maturityInstructionId); WHOLE_TERM, maturityInstructionId);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec, HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString()); this.responseSpec, fixedDepositAccountId.toString());
@@ -2700,7 +2700,7 @@ public class FixedDepositTest {
Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount( Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping.getAccountID(), this.responseSpec, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping.getAccountID(), this.responseSpec,
CommonConstants.RESPONSE_RESOURCE_ID); CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId); Assertions.assertNotNull(financialActivityAccountId);
assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping); assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping);
return liabilityAccountForMapping; return liabilityAccountForMapping;
} }
@@ -2708,8 +2708,8 @@ public class FixedDepositTest {
private void assertFinancialActivityAccountCreation(Integer financialActivityAccountId, Integer financialActivityId, Account glAccount) { private void assertFinancialActivityAccountCreation(Integer financialActivityAccountId, Integer financialActivityId, Account glAccount) {
HashMap mappingDetails = this.financialActivityAccountHelper.getFinancialActivityAccount(financialActivityAccountId, HashMap mappingDetails = this.financialActivityAccountHelper.getFinancialActivityAccount(financialActivityAccountId,
this.responseSpec); this.responseSpec);
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id")); Assertions.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id")); Assertions.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
} }
private Integer createTaxGroup(final String percentage, final Account liabilityAccountForTax){ private Integer createTaxGroup(final String percentage, final Account liabilityAccountForTax){
@@ -2721,15 +2721,15 @@ public class FixedDepositTest {
/** /**
* Delete the Liability transfer account * Delete the Liability transfer account
*/ */
@After @AfterEach
public void tearDown() { public void tearDown() {
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec); List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
for (HashMap financialActivity : financialActivities) { for (HashMap financialActivity : financialActivities) {
Integer financialActivityAccountId = (Integer) financialActivity.get("id"); Integer financialActivityAccountId = (Integer) financialActivity.get("id");
Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper.deleteFinancialActivityAccount( Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID); financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId); Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId); Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
} }
} }
} }
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper; import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker; import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -52,7 +52,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
private SavingsProductHelper savingsProductHelper; private SavingsProductHelper savingsProductHelper;
private SavingsAccountHelper savingsAccountHelper; private SavingsAccountHelper savingsAccountHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -67,7 +67,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
// client activation, savings activation and 1st transaction date // client activation, savings activation and 1st transaction date
final String startDate = "01 December 2013"; final String startDate = "01 December 2013";
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, startDate); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, startDate);
Assert.assertNotNull(clientID); Assertions.assertNotNull(clientID);
// Configuring global config flags // Configuring global config flags
configureInterestPosting(true, 4); configureInterestPosting(true, 4);
@@ -97,10 +97,10 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
private Integer createSavingsAccount(final Integer clientID, final String startDate) { private Integer createSavingsAccount(final Integer clientID, final String startDate) {
final Integer savingsProductID = createSavingsProduct(); final Integer savingsProductID = createSavingsProduct();
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplicationOnDate(clientID, savingsProductID, final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplicationOnDate(clientID, savingsProductID,
ACCOUNT_TYPE_INDIVIDUAL, startDate); ACCOUNT_TYPE_INDIVIDUAL, startDate);
Assert.assertNotNull(savingsId); Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = this.savingsAccountHelper.approveSavingsOnDate(savingsId, startDate); HashMap savingsStatusHashMap = this.savingsAccountHelper.approveSavingsOnDate(savingsId, startDate);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavingsAccount(savingsId, startDate); savingsStatusHashMap = this.savingsAccountHelper.activateSavingsAccount(savingsId, startDate);
@@ -110,15 +110,15 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
private void configureInterestPosting(final Boolean periodEndEnable, final Integer financialYearBeginningMonth) { private void configureInterestPosting(final Boolean periodEndEnable, final Integer financialYearBeginningMonth) {
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec); final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
Assert.assertNotNull(globalConfig); Assertions.assertNotNull(globalConfig);
// Updating flag for interest posting at period end // Updating flag for interest posting at period end
Integer periodEndConfigId = (Integer) globalConfig.get(10).get("id"); Integer periodEndConfigId = (Integer) globalConfig.get(10).get("id");
Assert.assertNotNull(periodEndConfigId); Assertions.assertNotNull(periodEndConfigId);
HashMap periodEndConfigData = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec, HashMap periodEndConfigData = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
periodEndConfigId.toString()); periodEndConfigId.toString());
Assert.assertNotNull(periodEndConfigData); Assertions.assertNotNull(periodEndConfigData);
Boolean enabled = (Boolean) globalConfig.get(10).get("enabled"); Boolean enabled = (Boolean) globalConfig.get(10).get("enabled");
@@ -129,15 +129,15 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
// Updating value for financial year beginning month // Updating value for financial year beginning month
Integer financialYearBeginningConfigId = (Integer) globalConfig.get(11).get("id"); Integer financialYearBeginningConfigId = (Integer) globalConfig.get(11).get("id");
Assert.assertNotNull(financialYearBeginningConfigId); Assertions.assertNotNull(financialYearBeginningConfigId);
HashMap financialYearBeginningConfigData = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, HashMap financialYearBeginningConfigData = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec,
this.responseSpec, financialYearBeginningConfigId.toString()); this.responseSpec, financialYearBeginningConfigId.toString());
Assert.assertNotNull(financialYearBeginningConfigData); Assertions.assertNotNull(financialYearBeginningConfigData);
financialYearBeginningConfigId = GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, financialYearBeginningConfigId = GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
financialYearBeginningConfigId.toString(), financialYearBeginningMonth.toString()); financialYearBeginningConfigId.toString(), financialYearBeginningMonth.toString());
Assert.assertNotNull(financialYearBeginningConfigId); Assertions.assertNotNull(financialYearBeginningConfigId);
} }
private Integer createSavingsProduct() { private Integer createSavingsProduct() {
@@ -147,7 +147,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
} }
// Reset configuration fields // Reset configuration fields
@After @AfterEach
public void tearDown() { public void tearDown() {
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec); GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(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.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.hasItem; 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.Gson;
import com.google.gson.reflect.TypeToken; 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.Utils;
import org.apache.fineract.integrationtests.common.funds.FundsHelper; import org.apache.fineract.integrationtests.common.funds.FundsHelper;
import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler; import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Funds Integration Test for checking Funds Application. * Funds Integration Test for checking Funds Application.
@@ -47,7 +47,7 @@ public class FundsIntegrationTest {
private ResponseSpecification statusOkResponseSpec; private ResponseSpecification statusOkResponseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -64,7 +64,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
} }
@Test @Test
@@ -77,7 +77,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(400).build(); ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(400).build();
final Long fundID = createFund(jsonData, this.requestSpec, responseSpec); final Long fundID = createFund(jsonData, this.requestSpec, responseSpec);
Assert.assertNull(fundID); Assertions.assertNull(fundID);
} }
@Test @Test
@@ -89,7 +89,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
} }
@Test @Test
@@ -101,7 +101,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
FundsHelper fh2 = FundsHelper FundsHelper fh2 = FundsHelper
.create(fh.getName()) .create(fh.getName())
@@ -111,7 +111,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(403).build(); ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(403).build();
final Long fundID2 = createFund(jsonData, this.requestSpec, responseSpec); final Long fundID2 = createFund(jsonData, this.requestSpec, responseSpec);
Assert.assertNull(fundID2); Assertions.assertNull(fundID2);
} }
@Test @Test
@@ -123,7 +123,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
FundsHelper fh2 = FundsHelper FundsHelper fh2 = FundsHelper
.create(Utils.randomNameGenerator("", 10)) .create(Utils.randomNameGenerator("", 10))
@@ -133,7 +133,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(403).build(); ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(403).build();
final Long fundID2 = createFund(jsonData, this.requestSpec, responseSpec); final Long fundID2 = createFund(jsonData, this.requestSpec, responseSpec);
Assert.assertNull(fundID2); Assertions.assertNull(fundID2);
} }
@Test @Test
@@ -146,7 +146,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(400).build(); ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(400).build();
final Long fundID = createFund(jsonData, this.requestSpec, responseSpec); final Long fundID = createFund(jsonData, this.requestSpec, responseSpec);
Assert.assertNull(fundID); Assertions.assertNull(fundID);
} }
@Test @Test
@@ -159,7 +159,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(400).build(); ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(400).build();
final Long fundID = createFund(jsonData, this.requestSpec, responseSpec); final Long fundID = createFund(jsonData, this.requestSpec, responseSpec);
Assert.assertNull(fundID); Assertions.assertNull(fundID);
} }
@Test @Test
@@ -171,7 +171,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
jsonData = FundsResourceHandler.retrieveFund(fundID, this.requestSpec, this.statusOkResponseSpec); jsonData = FundsResourceHandler.retrieveFund(fundID, this.requestSpec, this.statusOkResponseSpec);
FundsHelper fh2 = FundsHelper.fromJSON(jsonData); FundsHelper fh2 = FundsHelper.fromJSON(jsonData);
@@ -188,11 +188,11 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
List<FundsHelper> fhList = FundsResourceHandler.retrieveAllFunds(this.requestSpec, this.statusOkResponseSpec); List<FundsHelper> fhList = FundsResourceHandler.retrieveAllFunds(this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fhList); Assertions.assertNotNull(fhList);
assertThat(fhList.size(), greaterThanOrEqualTo(1)); assertThat(fhList.size(), greaterThanOrEqualTo(1));
assertThat(fhList, hasItem(fh)); assertThat(fhList, hasItem(fh));
} }
@@ -214,14 +214,14 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
String newName = Utils.randomNameGenerator("", 10); String newName = Utils.randomNameGenerator("", 10);
String newExternalId = Utils.randomNameGenerator("fund-", 5); String newExternalId = Utils.randomNameGenerator("fund-", 5);
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, newExternalId, this.requestSpec, this.statusOkResponseSpec); FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, newExternalId, this.requestSpec, this.statusOkResponseSpec);
Assert.assertEquals(newName, fh2.getName()); Assertions.assertEquals(newName, fh2.getName());
Assert.assertEquals(newExternalId, fh2.getExternalId()); Assertions.assertEquals(newExternalId, fh2.getExternalId());
} }
@Test @Test
@@ -231,7 +231,7 @@ public class FundsIntegrationTest {
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(404).build(); ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(404).build();
FundsHelper fh = FundsResourceHandler.updateFund(Long.MAX_VALUE, newName, newExternalId, this.requestSpec, FundsHelper fh = FundsResourceHandler.updateFund(Long.MAX_VALUE, newName, newExternalId, this.requestSpec,
responseSpec); responseSpec);
Assert.assertNull(fh); Assertions.assertNull(fh);
} }
@Test @Test
@@ -243,7 +243,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
String newName = Utils.randomNameGenerator("", 120); String newName = Utils.randomNameGenerator("", 120);
String newExternalId = Utils.randomNameGenerator("fund-", 5); String newExternalId = Utils.randomNameGenerator("fund-", 5);
@@ -251,7 +251,7 @@ public class FundsIntegrationTest {
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, newExternalId, this.requestSpec, FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, newExternalId, this.requestSpec,
responseSpec); responseSpec);
Assert.assertNull(fh2); Assertions.assertNull(fh2);
} }
@Test @Test
@@ -263,12 +263,12 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
String newExternalId = Utils.randomNameGenerator("fund-", 5); String newExternalId = Utils.randomNameGenerator("fund-", 5);
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, null, newExternalId, this.requestSpec, this.statusOkResponseSpec); FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, null, newExternalId, this.requestSpec, this.statusOkResponseSpec);
Assert.assertEquals(newExternalId, fh2.getExternalId()); Assertions.assertEquals(newExternalId, fh2.getExternalId());
} }
@Test @Test
@@ -280,7 +280,7 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
String newName = Utils.randomNameGenerator("", 10); String newName = Utils.randomNameGenerator("", 10);
String newExternalId = Utils.randomNameGenerator("fund-", 120); String newExternalId = Utils.randomNameGenerator("fund-", 120);
@@ -288,7 +288,7 @@ public class FundsIntegrationTest {
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, newExternalId, this.requestSpec, FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, newExternalId, this.requestSpec,
responseSpec); responseSpec);
Assert.assertNull(fh2); Assertions.assertNull(fh2);
} }
@Test @Test
@@ -300,12 +300,12 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNotNull(fundID); Assertions.assertNotNull(fundID);
String newName = Utils.randomNameGenerator("", 10); String newName = Utils.randomNameGenerator("", 10);
FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, null, this.requestSpec, this.statusOkResponseSpec); FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, newName, null, this.requestSpec, this.statusOkResponseSpec);
Assert.assertEquals(newName, fh2.getName()); Assertions.assertEquals(newName, fh2.getName());
} }
@Test @Test
@@ -317,20 +317,20 @@ public class FundsIntegrationTest {
String jsonData = fh.toJSON(); String jsonData = fh.toJSON();
final Long fundID = createFund(jsonData, this.requestSpec, this.statusOkResponseSpec); 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); FundsHelper fh2 = FundsResourceHandler.updateFund(fundID, null, null, this.requestSpec, this.statusOkResponseSpec);
Assert.assertNull(fh2.getName()); Assertions.assertNull(fh2.getName());
Assert.assertNull(fh2.getExternalId()); Assertions.assertNull(fh2.getExternalId());
// assert that there was no change in // assert that there was no change in
// the name and external ID of the fund // the name and external ID of the fund
jsonData = FundsResourceHandler.retrieveFund(fundID, this.requestSpec, this.statusOkResponseSpec); jsonData = FundsResourceHandler.retrieveFund(fundID, this.requestSpec, this.statusOkResponseSpec);
FundsHelper fh3 = new Gson().fromJson(jsonData, FundsHelper.class); FundsHelper fh3 = new Gson().fromJson(jsonData, FundsHelper.class);
Assert.assertEquals(fh.getName(), fh3.getName()); Assertions.assertEquals(fh.getName(), fh3.getName());
Assert.assertEquals(fh.getExternalId(), fh3.getExternalId()); Assertions.assertEquals(fh.getExternalId(), fh3.getExternalId());
} }
private Long createFund(final String fundJSON, private Long createFund(final String fundJSON,
@@ -27,10 +27,10 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper; import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest { public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
@@ -39,7 +39,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private GlobalConfigurationHelper globalConfigurationHelper; private GlobalConfigurationHelper globalConfigurationHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -47,7 +47,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
} }
@After @AfterEach
public void tearDown() { public void tearDown() {
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec); GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec); GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
@@ -61,7 +61,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
// Retrieving All Global Configuration details // Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper
.getAllGlobalConfigurations(this.requestSpec, this.responseSpec); .getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
Assert.assertNotNull(globalConfig); Assertions.assertNotNull(globalConfig);
String configName = "interest-charged-from-date-same-as-disbursal-date"; String configName = "interest-charged-from-date-same-as-disbursal-date";
boolean newBooleanValue = true; boolean newBooleanValue = true;
@@ -74,7 +74,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
Integer updateConfigId = this.globalConfigurationHelper Integer updateConfigId = this.globalConfigurationHelper
.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, .updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
configId.toString(), newBooleanValue); configId.toString(), newBooleanValue);
Assert.assertNotNull(updateConfigId); Assertions.assertNotNull(updateConfigId);
break; break;
} }
} }
@@ -28,10 +28,10 @@ import java.util.HashMap;
import org.apache.fineract.integrationtests.common.CommonConstants; import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper; import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
@SuppressWarnings({ "rawtypes", "unchecked", "static-access" }) @SuppressWarnings({ "rawtypes", "unchecked", "static-access" })
public class GlobalConfigurationTest { public class GlobalConfigurationTest {
@@ -41,7 +41,7 @@ public class GlobalConfigurationTest {
private GlobalConfigurationHelper globalConfigurationHelper; private GlobalConfigurationHelper globalConfigurationHelper;
private ResponseSpecification httpStatusForidden; private ResponseSpecification httpStatusForidden;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -50,7 +50,7 @@ public class GlobalConfigurationTest {
this.httpStatusForidden = new ResponseSpecBuilder().expectStatusCode(403).build(); this.httpStatusForidden = new ResponseSpecBuilder().expectStatusCode(403).build();
} }
@After @AfterEach
public void tearDown() { public void tearDown() {
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec); GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec); GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
@@ -63,30 +63,30 @@ public class GlobalConfigurationTest {
// Retrieving All Global Configuration details // Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
this.responseSpec); this.responseSpec);
Assert.assertNotNull(globalConfig); Assertions.assertNotNull(globalConfig);
String configName = "penalty-wait-period"; String configName = "penalty-wait-period";
for (Integer configIndex = 0; configIndex < globalConfig.size() - 1; configIndex++) { for (Integer configIndex = 0; configIndex < globalConfig.size() - 1; configIndex++) {
if (globalConfig.get(configIndex).get("name").equals(configName)) { if (globalConfig.get(configIndex).get("name").equals(configName)) {
Integer configId = (Integer) globalConfig.get(configIndex).get("id"); Integer configId = (Integer) globalConfig.get(configIndex).get("id");
Assert.assertNotNull(configId); Assertions.assertNotNull(configId);
HashMap configDataBefore = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec, HashMap configDataBefore = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
configId.toString()); configId.toString());
Assert.assertNotNull(configDataBefore); Assertions.assertNotNull(configDataBefore);
Integer value = (Integer) configDataBefore.get("value") + 1; Integer value = (Integer) configDataBefore.get("value") + 1;
// Updating Value for penalty-wait-period Global Configuration // Updating Value for penalty-wait-period Global Configuration
configId = this.globalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, configId = this.globalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
configId.toString(), value.toString()); configId.toString(), value.toString());
Assert.assertNotNull(configId); Assertions.assertNotNull(configId);
HashMap configDataAfter = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec, HashMap configDataAfter = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
configId.toString()); configId.toString());
// Verifying Value for penalty-wait-period after Updation // 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 // Updating Enabled Flag for penalty-wait-period Global
// Configuration // Configuration
@@ -105,7 +105,7 @@ public class GlobalConfigurationTest {
configId.toString()); configId.toString());
// Verifying Enabled Flag for penalty-wait-period after Updation // 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; break;
} }
} }
@@ -118,13 +118,13 @@ public class GlobalConfigurationTest {
// Retrieving Is Cache Enabled Global Configuration details // Retrieving Is Cache Enabled Global Configuration details
ArrayList<HashMap> isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec, ArrayList<HashMap> isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec,
this.responseSpec); this.responseSpec);
Assert.assertNotNull(isCacheGlobalConfig); Assertions.assertNotNull(isCacheGlobalConfig);
for (Integer cacheType = 0; cacheType <= isCacheGlobalConfig.size() - 1; cacheType++) { for (Integer cacheType = 0; cacheType <= isCacheGlobalConfig.size() - 1; cacheType++) {
// Retrieving Is Cache Enabled Global Configuration details // Retrieving Is Cache Enabled Global Configuration details
isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec, this.responseSpec); isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec, this.responseSpec);
Assert.assertNotNull(isCacheGlobalConfig); Assertions.assertNotNull(isCacheGlobalConfig);
HashMap cacheTypeAsHashMap = (HashMap) isCacheGlobalConfig.get(cacheType).get("cacheType"); HashMap cacheTypeAsHashMap = (HashMap) isCacheGlobalConfig.get(cacheType).get("cacheType");
Integer cacheTypeId = (Integer) cacheTypeAsHashMap.get("id"); Integer cacheTypeId = (Integer) cacheTypeAsHashMap.get("id");
@@ -139,7 +139,7 @@ public class GlobalConfigurationTest {
HashMap changes = this.globalConfigurationHelper.updateIsCacheEnabledForGlobalConfiguration(this.requestSpec, HashMap changes = this.globalConfigurationHelper.updateIsCacheEnabledForGlobalConfiguration(this.requestSpec,
this.responseSpec, cacheTypeId.toString()); 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 // Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper
.getAllGlobalConfigurations(this.requestSpec, this.responseSpec); .getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
Assert.assertNotNull(globalConfig); Assertions.assertNotNull(globalConfig);
String configName = "force-password-reset-days"; String configName = "force-password-reset-days";
String newValue = "0"; String newValue = "0";
@@ -159,7 +159,7 @@ public class GlobalConfigurationTest {
if (globalConfig.get(configIndex).get("name").equals(configName)) { if (globalConfig.get(configIndex).get("name").equals(configName)) {
Integer configId = (Integer) globalConfig.get(configIndex).get( Integer configId = (Integer) globalConfig.get(configIndex).get(
"id"); "id");
Assert.assertNotNull(configId); Assertions.assertNotNull(configId);
/* /*
* Update force-password-reset-days with value as 0 and Enable * Update force-password-reset-days with value as 0 and Enable
@@ -172,10 +172,10 @@ public class GlobalConfigurationTest {
CommonConstants.RESPONSE_ERROR); CommonConstants.RESPONSE_ERROR);
HashMap hash = (HashMap) error.get(0); HashMap hash = (HashMap) error.get(0);
Assert.assertEquals( Assertions.assertEquals(
"Force Password Reset days value must be greater than zero.",
"error.msg.password.reset.days.value.must.be.greater.than.zero", "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 * Update force-password-reset-days with value as 50 and Enable
@@ -185,14 +185,14 @@ public class GlobalConfigurationTest {
.updatePasswordResetDaysForGlobalConfiguration( .updatePasswordResetDaysForGlobalConfiguration(
this.requestSpec, this.responseSpec, configId, this.requestSpec, this.responseSpec, configId,
"50", newBooleanValue, "changes"); "50", newBooleanValue, "changes");
Assert.assertNotNull(updateSuccess); Assertions.assertNotNull(updateSuccess);
/* Update with value as 0 and Enable as false - success case */ /* Update with value as 0 and Enable as false - success case */
final HashMap updateSuccess1 = (HashMap) this.globalConfigurationHelper final HashMap updateSuccess1 = (HashMap) this.globalConfigurationHelper
.updatePasswordResetDaysForGlobalConfiguration( .updatePasswordResetDaysForGlobalConfiguration(
this.requestSpec, this.responseSpec, configId, this.requestSpec, this.responseSpec, configId,
newValue, "false", "changes"); newValue, "false", "changes");
Assert.assertNotNull(updateSuccess1); Assertions.assertNotNull(updateSuccess1);
/* Update without sending value and Enable as true - failure case*/ /* Update without sending value and Enable as true - failure case*/
ArrayList failure = (ArrayList) this.globalConfigurationHelper ArrayList failure = (ArrayList) this.globalConfigurationHelper
@@ -200,10 +200,10 @@ public class GlobalConfigurationTest {
this.requestSpec, this.httpStatusForidden, configId, this.requestSpec, this.httpStatusForidden, configId,
null, newBooleanValue, CommonConstants.RESPONSE_ERROR); null, newBooleanValue, CommonConstants.RESPONSE_ERROR);
HashMap failureHash = (HashMap) failure.get(0); HashMap failureHash = (HashMap) failure.get(0);
Assert.assertEquals( Assertions.assertEquals(
"Force Password Reset days value must be greater than zero.",
"error.msg.password.reset.days.value.must.be.greater.than.zero", "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; break;
} }
@@ -218,7 +218,7 @@ public class GlobalConfigurationTest {
Integer updateConfigId = this.globalConfigurationHelper Integer updateConfigId = this.globalConfigurationHelper
.updateValueForGlobalConfiguration(this.requestSpec, .updateValueForGlobalConfiguration(this.requestSpec,
this.responseSpec, configId, newValue); this.responseSpec, configId, newValue);
Assert.assertNotNull(updateConfigId); Assertions.assertNotNull(updateConfigId);
break; break;
} }
} }
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -55,7 +55,7 @@ public class GroupLoanIntegrationTest {
private LoanTransactionHelper loanTransactionHelper; private LoanTransactionHelper loanTransactionHelper;
private final static Logger LOG = LoggerFactory.getLogger(GroupLoanIntegrationTest.class); private final static Logger LOG = LoggerFactory.getLogger(GroupLoanIntegrationTest.class);
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -125,16 +125,16 @@ public class GroupLoanIntegrationTest {
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final Integer loanProductID = createLoanProduct(); final Integer loanProductID = createLoanProduct();
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
HashMap<String,Integer> glim = applyForGlimApplication(clientID, groupID, loanProductID); HashMap<String,Integer> glim = applyForGlimApplication(clientID, groupID, loanProductID);
LOG.info("Glim Loan Application: {} ", glim); LOG.info("Glim Loan Application: {} ", glim);
@@ -146,7 +146,7 @@ public class GroupLoanIntegrationTest {
LOG.info("LoanId: {} ", loanId); LOG.info("LoanId: {} ", loanId);
final List<String> retrievedGlimId=GroupHelper.verifyRetrieveGlimAccountsByGroupId(this.requestSpec, this.responseSpec, groupID); final List<String> retrievedGlimId=GroupHelper.verifyRetrieveGlimAccountsByGroupId(this.requestSpec, this.responseSpec, groupID);
Assert.assertNotNull(retrievedGlimId.toString()); Assertions.assertNotNull(retrievedGlimId.toString());
} }
@Test @Test
@@ -154,16 +154,16 @@ public class GroupLoanIntegrationTest {
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final Integer loanProductID = createLoanProduct(); final Integer loanProductID = createLoanProduct();
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
HashMap<String,Integer> glim = applyForGlimApplication(clientID, groupID, loanProductID); HashMap<String,Integer> glim = applyForGlimApplication(clientID, groupID, loanProductID);
LOG.info("Glim Loan Application: {} ", glim); LOG.info("Glim Loan Application: {} ", glim);
@@ -175,7 +175,7 @@ public class GroupLoanIntegrationTest {
LOG.info("LoanId: {} ", loanId); LOG.info("LoanId: {} ", loanId);
final List<String> retrievedGlimAccountId=GroupHelper.verifyRetrieveGlimAccountsByGlimId(this.requestSpec, this.responseSpec, glimId); 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) { 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) { private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
LOG.info("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); LOG.info("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2011, 10, 20)), assertEquals(new ArrayList<>(Arrays.asList(2011, 10, 20)), loanSchedule.get(1).get("dueDate"),
loanSchedule.get(1).get("dueDate")); "Checking for Due Date for 1st Month");
assertEquals("Checking for Principal Due for 1st Month", Float.valueOf("2911.49"), loanSchedule.get(1).get("principalOriginalDue")); assertEquals(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")); "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)), assertEquals(new ArrayList<>(Arrays.asList(2011, 11, 20)), loanSchedule.get(2).get("dueDate"),
loanSchedule.get(2).get("dueDate")); "Checking for Due Date for 2nd Month");
assertEquals("Checking for Principal Due for 2nd Month", Float.valueOf("2969.72"), loanSchedule.get(2).get("principalDue")); assertEquals(Float.valueOf("2969.72"), loanSchedule.get(2).get("principalDue"), "Checking for Principal Due for 2nd Month");
assertEquals("Checking for Interest Due for 2nd Month", Float.valueOf("181.77"), loanSchedule.get(2).get("interestOriginalDue")); 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)), assertEquals(new ArrayList<>(Arrays.asList(2011, 12, 20)), loanSchedule.get(3).get("dueDate"),
loanSchedule.get(3).get("dueDate")); "Checking for Due Date for 3rd Month");
assertEquals("Checking for Principal Due for 3rd Month", Float.valueOf("3029.11"), loanSchedule.get(3).get("principalDue")); assertEquals(Float.valueOf("3029.11"), loanSchedule.get(3).get("principalDue"), "Checking for Principal Due for 3rd Month");
assertEquals("Checking for Interest Due for 3rd Month", Float.valueOf("122.38"), loanSchedule.get(3).get("interestOriginalDue")); 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)), assertEquals(new ArrayList<>(Arrays.asList(2012, 1, 20)), loanSchedule.get(4).get("dueDate"),
loanSchedule.get(4).get("dueDate")); "Checking for Due Date for 4th Month");
assertEquals("Checking for Principal Due for 4th Month", Float.valueOf("3089.68"), loanSchedule.get(4).get("principalDue")); assertEquals(Float.valueOf("3089.68"), loanSchedule.get(4).get("principalDue"), "Checking for Principal Due for 4th Month");
assertEquals("Checking for Interest Due for 4th Month", Float.valueOf("61.79"), loanSchedule.get(4).get("interestOriginalDue")); 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; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker; import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -67,7 +67,7 @@ public class GroupSavingsIntegrationTest {
private SavingsAccountHelper savingsAccountHelper; private SavingsAccountHelper savingsAccountHelper;
private final static Logger LOG = LoggerFactory.getLogger(GroupSavingsIntegrationTest.class); private final static Logger LOG = LoggerFactory.getLogger(GroupSavingsIntegrationTest.class);
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -80,26 +80,26 @@ public class GroupSavingsIntegrationTest {
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null; final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false"; final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP); 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); 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); HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -117,7 +117,7 @@ public class GroupSavingsIntegrationTest {
this.savingsAccountHelper.postInterestForSavings(savingsId); this.savingsAccountHelper.postInterestForSavings(savingsId);
summary = this.savingsAccountHelper.getSavingsSummary(savingsId); summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Assert.assertFalse(summaryBefore.equals(summary)); Assertions.assertFalse(summaryBefore.equals(summary));
final Object savingsInterest = this.savingsAccountHelper.getSavingsInterest(savingsId); final Object savingsInterest = this.savingsAccountHelper.getSavingsInterest(savingsId);
@@ -131,23 +131,23 @@ public class GroupSavingsIntegrationTest {
final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, errorResponse); final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, errorResponse);
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = "1000.0"; final String minRequiredBalance = "1000.0";
final String enforceMinRequiredBalance = "true"; final String enforceMinRequiredBalance = "true";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP); 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); HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -182,23 +182,23 @@ public class GroupSavingsIntegrationTest {
new ResponseSpecBuilder().build()); new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null; final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false"; final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP); 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); HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -232,20 +232,20 @@ public class GroupSavingsIntegrationTest {
new ResponseSpecBuilder().build()); new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null; final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false"; final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
List<Map<String, Object>> clientArray = new ArrayList<>(); List<Map<String, Object>> clientArray = new ArrayList<>();
clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013")); clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013"));
@@ -282,27 +282,27 @@ public class GroupSavingsIntegrationTest {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null; final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false"; final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
List<Map<String, Object>> clientArray = new ArrayList<>(); List<Map<String, Object>> clientArray = new ArrayList<>();
clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013")); clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013"));
LOG.info("client Array : {} ", clientArray); LOG.info("client Array : {} ", clientArray);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP); 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 name = PaymentTypeHelper.randomNameGenerator("P_T", 5);
String description = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15); String description = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15);
@@ -310,7 +310,7 @@ public class GroupSavingsIntegrationTest {
Integer position = 1; Integer position = 1;
Integer paymentTypeId = PaymentTypeHelper.createPaymentType(requestSpec, responseSpec, name, description, isCashPayment, position); Integer paymentTypeId = PaymentTypeHelper.createPaymentType(requestSpec, responseSpec, name, description, isCashPayment, position);
Assert.assertNotNull(paymentTypeId); Assertions.assertNotNull(paymentTypeId);
List<Map<String, Object>> savingsArray = new ArrayList<>(); List<Map<String, Object>> savingsArray = new ArrayList<>();
final Integer transactionAmount=2500; final Integer transactionAmount=2500;
@@ -326,7 +326,7 @@ public class GroupSavingsIntegrationTest {
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final Integer depositId = this.savingsAccountHelper.depositGsimApplication(savingsId, savingsArray); 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 SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, errorResponse);
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = "1000.0"; final String minRequiredBalance = "1000.0";
final String enforceMinRequiredBalance = "true"; final String enforceMinRequiredBalance = "true";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
List<Map<String, Object>> clientArray = new ArrayList<>(); List<Map<String, Object>> clientArray = new ArrayList<>();
clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013")); 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 ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = "1000.0"; final String minRequiredBalance = "1000.0";
final String enforceMinRequiredBalance = "true"; final String enforceMinRequiredBalance = "true";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
List<Map<String, Object>> clientArray = new ArrayList<>(); List<Map<String, Object>> clientArray = new ArrayList<>();
clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013")); 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); HashMap savingsStatusHashMap = this.savingsAccountHelper.updateGsimApplication(gsimID, clientID, groupID, savingsProductID);
LOG.info("savingsStatusHashMap: {} ",savingsStatusHashMap); 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 ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = "1000.0"; final String minRequiredBalance = "1000.0";
final String enforceMinRequiredBalance = "true"; final String enforceMinRequiredBalance = "true";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
List<Map<String, Object>> clientArray = new ArrayList<>(); List<Map<String, Object>> clientArray = new ArrayList<>();
clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013")); clientArray.add(clientArray(clientID, groupID, savingsProductID,"08 January 2013"));
final Integer gsimID = this.savingsAccountHelper.applyForGsimApplication(clientArray); final Integer gsimID = this.savingsAccountHelper.applyForGsimApplication(clientArray);
final List<String> retrievedGsimId=GroupHelper.verifyRetrieveGsimAccounts(this.requestSpec, this.responseSpec, groupID); final List<String> retrievedGsimId=GroupHelper.verifyRetrieveGsimAccounts(this.requestSpec, this.responseSpec, groupID);
Assert.assertNotNull(retrievedGsimId.toString()); Assertions.assertNotNull(retrievedGsimId.toString());
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -451,23 +451,23 @@ public class GroupSavingsIntegrationTest {
new ResponseSpecBuilder().build()); new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null; final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false"; final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP); 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); HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -502,23 +502,23 @@ public class GroupSavingsIntegrationTest {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null; final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false"; final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP); 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); HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -536,23 +536,23 @@ public class GroupSavingsIntegrationTest {
new ResponseSpecBuilder().build()); new ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null; final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false"; final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP); 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); HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -575,39 +575,39 @@ public class GroupSavingsIntegrationTest {
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId); HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE); 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, Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID); SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId); HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT); balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals("Verifying Deposit Amount", Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount")); assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
assertEquals("Verifying Balance after Deposit", balance, depositTransaction.get("runningBalance")); assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT, Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID); SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId); HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT); balance -= Float.valueOf(WITHDRAW_AMOUNT);
assertEquals("Verifying Withdrawal Amount", Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount")); assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
assertEquals("Verifying Balance after Withdrawal", balance, withdrawTransaction.get("runningBalance")); assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
Integer newWithdrawTransactionId = this.savingsAccountHelper.updateSavingsAccountTransaction(savingsId, withdrawTransactionId, Integer newWithdrawTransactionId = this.savingsAccountHelper.updateSavingsAccountTransaction(savingsId, withdrawTransactionId,
WITHDRAW_AMOUNT_ADJUSTED); WITHDRAW_AMOUNT_ADJUSTED);
HashMap newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, newWithdrawTransactionId); HashMap newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, newWithdrawTransactionId);
balance = balance + Float.valueOf(WITHDRAW_AMOUNT) - Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED); balance = balance + Float.valueOf(WITHDRAW_AMOUNT) - Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals("Verifying adjusted Amount", Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount")); assertEquals(Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount"), "Verifying adjusted Amount");
assertEquals("Verifying Balance after adjust", balance, newWithdrawTransaction.get("runningBalance")); assertEquals(balance, newWithdrawTransaction.get("runningBalance"), "Verifying Balance after adjust");
summary = this.savingsAccountHelper.getSavingsSummary(savingsId); 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); withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
Assert.assertTrue((Boolean) withdrawTransaction.get("reversed")); Assertions.assertTrue((Boolean) withdrawTransaction.get("reversed"));
this.savingsAccountHelper.undoSavingsAccountTransaction(savingsId, newWithdrawTransactionId); this.savingsAccountHelper.undoSavingsAccountTransaction(savingsId, newWithdrawTransactionId);
newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId); newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
Assert.assertTrue((Boolean) newWithdrawTransaction.get("reversed")); Assertions.assertTrue((Boolean) newWithdrawTransaction.get("reversed"));
summary = this.savingsAccountHelper.getSavingsSummary(savingsId); summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
balance += Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED); 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", error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR); SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_ERROR);
@@ -640,44 +640,44 @@ public class GroupSavingsIntegrationTest {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(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); 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()); groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientID.toString());
Assert.assertNotNull(groupID); Assertions.assertNotNull(groupID);
final String minBalanceForInterestCalculation = null; final String minBalanceForInterestCalculation = null;
final String minRequiredBalance = null; final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false"; final String enforceMinRequiredBalance = "false";
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(groupID, savingsProductID, ACCOUNT_TYPE_GROUP); 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); HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsWithdrawalFeeJSON()); ChargesHelper.getSavingsWithdrawalFeeJSON());
Assert.assertNotNull(withdrawalChargeId); Assertions.assertNotNull(withdrawalChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId, false); this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId, false);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId); 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"); Integer savingsChargeId = (Integer) chargesPendingState.get(0).get("id");
HashMap chargeChanges = this.savingsAccountHelper.updateCharges(savingsChargeId, savingsId); HashMap chargeChanges = this.savingsAccountHelper.updateCharges(savingsChargeId, savingsId);
Assert.assertTrue(chargeChanges.containsKey("amount")); Assertions.assertTrue(chargeChanges.containsKey("amount"));
Integer deletedChargeId = this.savingsAccountHelper.deleteCharge(savingsChargeId, savingsId); Integer deletedChargeId = this.savingsAccountHelper.deleteCharge(savingsChargeId, savingsId);
assertEquals(savingsChargeId, deletedChargeId); assertEquals(savingsChargeId, deletedChargeId);
chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId); chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertTrue(chargesPendingState == null || chargesPendingState.size() == 0); Assertions.assertTrue(chargesPendingState == null || chargesPendingState.size() == 0);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId); savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
@@ -686,14 +686,14 @@ public class GroupSavingsIntegrationTest {
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final Integer chargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsAnnualFeeJSON()); final Integer chargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(chargeId); Assertions.assertNotNull(chargeId);
ArrayList<HashMap> charges = this.savingsAccountHelper.getSavingsCharges(savingsId); 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); this.savingsAccountHelper.addChargesForSavings(savingsId, chargeId, true);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId); charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, charges.size()); Assertions.assertEquals(1, charges.size());
HashMap savingsChargeForPay = charges.get(0); HashMap savingsChargeForPay = charges.get(0);
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.DATE_FORMAT, Locale.US); 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, final Integer monthlyFeechargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsMonthlyFeeJSON()); ChargesHelper.getSavingsMonthlyFeeJSON());
Assert.assertNotNull(monthlyFeechargeId); Assertions.assertNotNull(monthlyFeechargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId, true); this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId, true);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId); charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(2, charges.size()); Assertions.assertEquals(2, charges.size());
HashMap savingsChargeForWaive = charges.get(1); HashMap savingsChargeForWaive = charges.get(1);
this.savingsAccountHelper.waiveCharge((Integer) savingsChargeForWaive.get("id"), savingsId); this.savingsAccountHelper.waiveCharge((Integer) savingsChargeForWaive.get("id"), savingsId);
@@ -728,11 +728,11 @@ public class GroupSavingsIntegrationTest {
assertEquals(totalWaiveAmount.floatValue(), waiveCharge.get("amountWaived")); assertEquals(totalWaiveAmount.floatValue(), waiveCharge.get("amountWaived"));
final Integer weeklyFeeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsWeeklyFeeJSON()); final Integer weeklyFeeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsWeeklyFeeJSON());
Assert.assertNotNull(weeklyFeeId); Assertions.assertNotNull(weeklyFeeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, weeklyFeeId, true); this.savingsAccountHelper.addChargesForSavings(savingsId, weeklyFeeId, true);
charges = this.savingsAccountHelper.getSavingsCharges(savingsId); charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(3, charges.size()); Assertions.assertEquals(3, charges.size());
savingsChargeForPay = charges.get(2); savingsChargeForPay = charges.get(2);
cal = Calendar.getInstance(); cal = Calendar.getInstance();
@@ -744,7 +744,7 @@ public class GroupSavingsIntegrationTest {
// Depositing huge amount as scheduler job deducts the fee amount // Depositing huge amount as scheduler job deducts the fee amount
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, "100000", Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, "100000",
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID); SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(depositTransactionId); Assertions.assertNotNull(depositTransactionId);
this.savingsAccountHelper.payCharge((Integer) savingsChargeForPay.get("id"), savingsId, this.savingsAccountHelper.payCharge((Integer) savingsChargeForPay.get("id"), savingsId,
((Float) savingsChargeForPay.get("amount")).toString(), sdf.format(cal.getTime())); ((Float) savingsChargeForPay.get("amount")).toString(), sdf.format(cal.getTime()));
@@ -18,8 +18,8 @@
*/ */
package org.apache.fineract.integrationtests; package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals;
import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper; import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -54,7 +54,7 @@ public class GroupTest {
private final String numberOfRepayments = "5"; private final String numberOfRepayments = "5";
private final String interestRatePerPeriod = "18"; private final String interestRatePerPeriod = "18";
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -110,21 +110,21 @@ public class GroupTest {
// create staff // create staff
Integer createStaffId1 = StaffHelper.createStaff(this.requestSpec, this.responseSpec); Integer createStaffId1 = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
LOG.info("--------------creating first staff with id------------- {}" , createStaffId1); LOG.info("--------------creating first staff with id------------- {}" , createStaffId1);
Assert.assertNotNull(createStaffId1); Assertions.assertNotNull(createStaffId1);
Integer createStaffId2 = StaffHelper.createStaff(this.requestSpec, this.responseSpec); Integer createStaffId2 = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
LOG.info("--------------creating second staff with id------------- {}" , createStaffId2); LOG.info("--------------creating second staff with id------------- {}" , createStaffId2);
Assert.assertNotNull(createStaffId2); Assertions.assertNotNull(createStaffId2);
// assign staff "createStaffId1" to group // assign staff "createStaffId1" to group
HashMap assignStaffGroupId = (HashMap) GroupHelper.assignStaff(this.requestSpec, this.responseSpec, groupID.toString(), HashMap assignStaffGroupId = (HashMap) GroupHelper.assignStaff(this.requestSpec, this.responseSpec, groupID.toString(),
createStaffId1.longValue()); 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 // assign staff "createStaffId2" to client
final HashMap assignStaffToClientChanges = (HashMap) ClientHelper.assignStaffToClient(this.requestSpec, this.responseSpec, final HashMap assignStaffToClientChanges = (HashMap) ClientHelper.assignStaffToClient(this.requestSpec, this.responseSpec,
clientID.toString(), createStaffId2.toString()); 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(); final Integer loanProductId = this.createLoanProduct();
@@ -139,13 +139,13 @@ public class GroupTest {
// assert if client staff officer has change Note client was assigned // assert if client staff officer has change Note client was assigned
// staff with createStaffId2 // staff with createStaffId2
assertNotEquals("Verify if client stuff has changed", assignStaffAndInheritStaffForClientAccounts.get("staffId"), createStaffId2); assertNotEquals(assignStaffAndInheritStaffForClientAccounts.get("staffId"), createStaffId2, "Verify if client stuff has changed");
assertEquals("Verify if client inherited staff assigned above", assignStaffAndInheritStaffForClientAccounts.get("staffId"), assertEquals(assignStaffAndInheritStaffForClientAccounts.get("staffId"), getClientStaffId,
getClientStaffId); "Verify if client inherited staff assigned above");
// assert if clients loan officer has changed // assert if clients loan officer has changed
final Integer loanOfficerId = this.loanTransactionHelper.getLoanOfficerId(loanId.toString()); 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; 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.RestAssured;
import io.restassured.builder.RequestSpecBuilder; 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.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.http.conn.HttpHostConnectException; import org.apache.http.conn.HttpHostConnectException;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -47,7 +47,7 @@ public class HookIntegrationTest {
private HookHelper hookHelper; private HookHelper hookHelper;
private OfficeHelper officeHelper; private OfficeHelper officeHelper;
@Before @BeforeEach
public void setUp() throws Exception { public void setUp() throws Exception {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -77,8 +77,8 @@ public class HookIntegrationTest {
try { try {
final String json = RestAssured.get(payloadURL.replace("?", "")).asString(); final String json = RestAssured.get(payloadURL.replace("?", "")).asString();
final Integer notificationOfficeId = JsonPath.with(json).get("officeId"); final Integer notificationOfficeId = JsonPath.with(json).get("officeId");
Assert.assertEquals("Equality check for created officeId and hook received payload officeId", createdOfficeID, Assertions.assertEquals(createdOfficeID, notificationOfficeId,
notificationOfficeId); "Equality check for created officeId and hook received payload officeId");
LOG.info("Notification Office Id - {}" , notificationOfficeId); LOG.info("Notification Office Id - {}" , notificationOfficeId);
i = 6; i = 6;
} catch (Exception e) { } catch (Exception e) {
@@ -102,7 +102,7 @@ public class HookIntegrationTest {
final String updateURL = "http://localhost"; final String updateURL = "http://localhost";
Long hookId = this.hookHelper.createHook(payloadURL).longValue(); Long hookId = this.hookHelper.createHook(payloadURL).longValue();
Assert.assertNotNull(hookId); Assertions.assertNotNull(hookId);
this.hookHelper.verifyHookCreatedOnServer(hookId); this.hookHelper.verifyHookCreatedOnServer(hookId);
LOG.info("---------------------SUCCESSFULLY CREATED AND VERIFIED HOOK------------------------- {}",hookId); LOG.info("---------------------SUCCESSFULLY CREATED AND VERIFIED HOOK------------------------- {}",hookId);
this.hookHelper.updateHook(updateURL, hookId); this.hookHelper.updateHook(updateURL, hookId);
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -49,7 +49,7 @@ public class LoanApplicationApprovalTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper; private LoanTransactionHelper loanTransactionHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -46,7 +46,7 @@ public class LoanApplicationUndoLastTrancheTest {
private LoanTransactionHelper loanTransactionHelper; private LoanTransactionHelper loanTransactionHelper;
private LoanApplicationApprovalTest loanApplicationApprovalTest; private LoanApplicationApprovalTest loanApplicationApprovalTest;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -125,7 +125,7 @@ public class LoanApplicationUndoLastTrancheTest {
} }
private void validateDisbursedAmount(Float disbursedAmount) { 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -46,7 +46,7 @@ public class LoanDisbursalDateValidationTest {
private LoanTransactionHelper loanTransactionHelper; private LoanTransactionHelper loanTransactionHelper;
private ResponseSpecification responseForbiddenError; private ResponseSpecification responseForbiddenError;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -94,8 +94,8 @@ public class LoanDisbursalDateValidationTest {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<HashMap> disbursalError = (List<HashMap>) this.loanTransactionHelper.disburseLoan(disbursalDate, loanID, this.responseForbiddenError); 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", Assertions.assertEquals(disbursalError.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE),
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; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -55,7 +55,7 @@ public class LoanDisbursementDetailsIntegrationTest {
final String proposedAmount = "5000"; final String proposedAmount = "5000";
final String approvalAmount = "5000"; final String approvalAmount = "5000";
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -52,7 +52,7 @@ public class LoanRepaymentRescheduleAtDisbursementTest {
private LoanApplicationApprovalTest loanApplicationApprovalTest; private LoanApplicationApprovalTest loanApplicationApprovalTest;
private ResponseSpecification generalResponseSpec; private ResponseSpecification generalResponseSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,8 +18,8 @@
*/ */
package org.apache.fineract.integrationtests; package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder; import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -59,7 +59,7 @@ public class LoanRescheduleRequestTest {
private String interestRatePerPeriod = "18"; private String interestRatePerPeriod = "18";
private String dateString = "4 September 2014"; private String dateString = "4 September 2014";
@Before @BeforeEach
public void initialize() { public void initialize() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -19,7 +19,7 @@
package org.apache.fineract.integrationtests; 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 com.google.gson.Gson;
import io.restassured.builder.RequestSpecBuilder; 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.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper; import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -63,7 +63,7 @@ public class LoanReschedulingWithinCenterTest {
private ResponseSpecification generalResponseSpec; private ResponseSpecification generalResponseSpec;
private LoanApplicationApprovalTest loanApplicationApprovalTest; private LoanApplicationApprovalTest loanApplicationApprovalTest;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -90,9 +90,9 @@ public class LoanReschedulingWithinCenterTest {
responseSpec); responseSpec);
CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec); CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec);
Integer groupId = groupMembers[0]; Integer groupId = groupMembers[0];
Assert.assertNotNull(center); Assertions.assertNotNull(center);
Assert.assertTrue(center.getStaffId() == staffId); Assertions.assertTrue(center.getStaffId() == staffId);
Assert.assertTrue(center.isActive() == true); Assertions.assertTrue(center.isActive() == true);
Integer calendarId = createCalendarMeeting(centerId); Integer calendarId = createCalendarMeeting(centerId);
@@ -122,7 +122,7 @@ public class LoanReschedulingWithinCenterTest {
recalculationRestFrequencyDate, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0), null); recalculationRestFrequencyDate, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0), null);
// Test for loan account is created // Test for loan account is created
Assert.assertNotNull(loanId); Assertions.assertNotNull(loanId);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanId); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanId);
// Test for loan account is created, can be approved // Test for loan account is created, can be approved
@@ -201,9 +201,9 @@ public class LoanReschedulingWithinCenterTest {
responseSpec); responseSpec);
CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec); CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec);
Integer groupId = groupMembers[0]; Integer groupId = groupMembers[0];
Assert.assertNotNull(center); Assertions.assertNotNull(center);
Assert.assertTrue(center.getStaffId() == staffId); Assertions.assertTrue(center.getStaffId() == staffId);
Assert.assertTrue(center.isActive() == true); Assertions.assertTrue(center.isActive() == true);
Integer calendarId = createCalendarMeeting(centerId); 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -62,7 +62,7 @@ public class LoanWithWaiveInterestAndWriteOffIntegrationTest {
private final String INTEREST_VALUE_AMOUNT = "40.00"; private final String INTEREST_VALUE_AMOUNT = "40.00";
private LoanTransactionHelper loanTransactionHelper; private LoanTransactionHelper loanTransactionHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); 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); this.loanTransactionHelper.makeRepayment("1 January 2011", repayment_with_interest, loanID);
HashMap toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID); HashMap toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID);
Assert.assertTrue("Checking for Principal paid ", Assertions.assertTrue(Float.valueOf("500.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("principalPaid")))) == 0,
Float.valueOf("500.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("principalPaid")))) == 0); "Checking for Principal paid ");
Assert.assertTrue("Checking for interestPaid paid ", Assertions.assertTrue(Float.valueOf("180.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("interestPaid")))) == 0,
Float.valueOf("180.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("interestPaid")))) == 0); "Checking for interestPaid paid ");
Assert.assertTrue("Checking for total paid ", Assertions.assertTrue(Float.valueOf("680.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("totalRepayment")))) == 0,
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 // WRITE OFF LOAN AND CHECK ACCOUNT IS CLOSED
LoanStatusChecker.verifyLoanAccountIsClosed(this.loanTransactionHelper.writeOffLoan("1 January 2011", loanID)); LoanStatusChecker.verifyLoanAccountIsClosed(this.loanTransactionHelper.writeOffLoan("1 January 2011", loanID));
toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID); toLoanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID);
Assert.assertTrue("Checking for Principal written off ", Assertions.assertTrue(Float.valueOf("4000.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("principalWrittenOff")))) == 0,
Float.valueOf("4000.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("principalWrittenOff")))) == 0); "Checking for Principal written off ");
Assert.assertTrue("Checking for interestPaid written off ", Assertions.assertTrue(Float.valueOf("1440.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("interestWrittenOff")))) == 0,
Float.valueOf("1440.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("interestWrittenOff")))) == 0); "Checking for interestPaid written off ");
Assert.assertTrue("Checking for total written off ", Assertions.assertTrue(Float.valueOf("5440.0").compareTo(Float.valueOf(String.valueOf(toLoanSummaryAfter.get("totalWrittenOff")))) == 0,
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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public class LoanWithdrawnByApplicantIntegrationTest { public class LoanWithdrawnByApplicantIntegrationTest {
@@ -40,7 +40,7 @@ public class LoanWithdrawnByApplicantIntegrationTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper; private LoanTransactionHelper loanTransactionHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Test the creation, approval and rejection of a loan reschedule request * 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 interestRatePerPeriod = "18";
private final String groupActivationDate = "1 August 2014"; private final String groupActivationDate = "1 August 2014";
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
} }
@@ -95,7 +95,7 @@ public class MinimumDaysBetweenDisbursalAndFirstRepaymentTest {
this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON); this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
// Test for loan account is created // Test for loan account is created
Assert.assertNotNull(this.loanId); Assertions.assertNotNull(this.loanId);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -26,9 +26,9 @@ import io.restassured.specification.ResponseSpecification;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.NotificationHelper; import org.apache.fineract.integrationtests.common.NotificationHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -37,7 +37,7 @@ public class NotificationApiTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setUp() { public void setUp() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); 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, HashMap<String, Object> response = (HashMap<String, Object>) NotificationHelper.getNotifications(this.requestSpec,
this.responseSpec, ""); this.responseSpec, "");
LOG.info("Response : {}" , response.toString()); 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.OfficeDomain;
import org.apache.fineract.integrationtests.common.OfficeHelper; import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class OfficeIntegrationTest { public class OfficeIntegrationTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType( this.requestSpec = new RequestSpecBuilder().setContentType(
@@ -59,7 +59,7 @@ public class OfficeIntegrationTest {
oh.updateOffice(officeId, name, date); oh.updateOffice(officeId, name, date);
OfficeDomain newOffice = oh.retrieveOfficeByID(officeId); OfficeDomain newOffice = oh.retrieveOfficeByID(officeId);
Assert.assertTrue(name.equals(newOffice.getName())); Assertions.assertTrue(name.equals(newOffice.getName()));
Assert.assertArrayEquals(dateArr, newOffice.getOpeningDate()); Assertions.assertArrayEquals(dateArr, newOffice.getOpeningDate());
} }
} }
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.CommonConstants;
import org.apache.fineract.integrationtests.common.PasswordPreferencesHelper; import org.apache.fineract.integrationtests.common.PasswordPreferencesHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -42,7 +42,7 @@ public class PasswordPreferencesIntegrationTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private ResponseSpecification generalResponseSpec; private ResponseSpecification generalResponseSpec;
@Before @BeforeEach
public void setUp() { public void setUp() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -71,8 +71,8 @@ public class PasswordPreferencesIntegrationTest {
String invalidValidationPolicyId = "2000"; String invalidValidationPolicyId = "2000";
final List<HashMap> error = (List) PasswordPreferencesHelper.updateWithInvalidValidationPolicyId(requestSpec, generalResponseSpec, invalidValidationPolicyId, final List<HashMap> error = (List) PasswordPreferencesHelper.updateWithInvalidValidationPolicyId(requestSpec, generalResponseSpec, invalidValidationPolicyId,
CommonConstants.RESPONSE_ERROR); CommonConstants.RESPONSE_ERROR);
assertEquals("Password Validation Policy with identifier 2000 does not exist", "error.msg.password.validation.policy.id.invalid", assertEquals("error.msg.password.validation.policy.id.invalid", error.get(0).get("userMessageGlobalisationCode"),
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.PaymentTypeDomain;
import org.apache.fineract.integrationtests.common.PaymentTypeHelper; import org.apache.fineract.integrationtests.common.PaymentTypeHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class PaymentTypeIntegrationTest { public class PaymentTypeIntegrationTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -54,13 +54,13 @@ public class PaymentTypeIntegrationTest {
Integer position = 1; Integer position = 1;
Integer paymentTypeId = PaymentTypeHelper.createPaymentType(requestSpec, responseSpec, name, description, isCashPayment, position); Integer paymentTypeId = PaymentTypeHelper.createPaymentType(requestSpec, responseSpec, name, description, isCashPayment, position);
Assert.assertNotNull(paymentTypeId); Assertions.assertNotNull(paymentTypeId);
PaymentTypeHelper.verifyPaymentTypeCreatedOnServer(requestSpec, responseSpec, paymentTypeId); PaymentTypeHelper.verifyPaymentTypeCreatedOnServer(requestSpec, responseSpec, paymentTypeId);
PaymentTypeDomain paymentTypeResponse = PaymentTypeHelper.retrieveById(requestSpec, responseSpec, paymentTypeId); PaymentTypeDomain paymentTypeResponse = PaymentTypeHelper.retrieveById(requestSpec, responseSpec, paymentTypeId);
Assert.assertEquals(name, paymentTypeResponse.getName()); Assertions.assertEquals(name, paymentTypeResponse.getName());
Assert.assertEquals(description, paymentTypeResponse.getDescription()); Assertions.assertEquals(description, paymentTypeResponse.getDescription());
Assert.assertEquals(isCashPayment, paymentTypeResponse.getIsCashPayment()); Assertions.assertEquals(isCashPayment, paymentTypeResponse.getIsCashPayment());
Assert.assertEquals(position, paymentTypeResponse.getPosition()); Assertions.assertEquals(position, paymentTypeResponse.getPosition());
// Update Payment Type // Update Payment Type
String newName = PaymentTypeHelper.randomNameGenerator("P_TU", 5); String newName = PaymentTypeHelper.randomNameGenerator("P_TU", 5);
@@ -75,14 +75,14 @@ public class PaymentTypeIntegrationTest {
request.put("position", newPosition); request.put("position", newPosition);
PaymentTypeHelper.updatePaymentType(paymentTypeId, request, requestSpec, responseSpec); PaymentTypeHelper.updatePaymentType(paymentTypeId, request, requestSpec, responseSpec);
PaymentTypeDomain paymentTypeUpdatedResponse = PaymentTypeHelper.retrieveById(requestSpec, responseSpec, paymentTypeId); PaymentTypeDomain paymentTypeUpdatedResponse = PaymentTypeHelper.retrieveById(requestSpec, responseSpec, paymentTypeId);
Assert.assertEquals(newName, paymentTypeUpdatedResponse.getName()); Assertions.assertEquals(newName, paymentTypeUpdatedResponse.getName());
Assert.assertEquals(newDescription, paymentTypeUpdatedResponse.getDescription()); Assertions.assertEquals(newDescription, paymentTypeUpdatedResponse.getDescription());
Assert.assertEquals(isCashPaymentUpdatedValue, paymentTypeUpdatedResponse.getIsCashPayment()); Assertions.assertEquals(isCashPaymentUpdatedValue, paymentTypeUpdatedResponse.getIsCashPayment());
Assert.assertEquals(newPosition, paymentTypeUpdatedResponse.getPosition()); Assertions.assertEquals(newPosition, paymentTypeUpdatedResponse.getPosition());
// Delete // Delete
Integer deletedPaymentTypeId = PaymentTypeHelper.deletePaymentType(paymentTypeId, requestSpec, responseSpec); Integer deletedPaymentTypeId = PaymentTypeHelper.deletePaymentType(paymentTypeId, requestSpec, responseSpec);
Assert.assertEquals(paymentTypeId, deletedPaymentTypeId); Assertions.assertEquals(paymentTypeId, deletedPaymentTypeId);
ResponseSpecification responseSpecification = new ResponseSpecBuilder().expectStatusCode(404).build(); ResponseSpecification responseSpecification = new ResponseSpecBuilder().expectStatusCode(404).build();
PaymentTypeHelper.retrieveById(requestSpec, responseSpecification, paymentTypeId); PaymentTypeHelper.retrieveById(requestSpec, responseSpecification, paymentTypeId);
@@ -27,9 +27,9 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.rates.RatesHelper; import org.apache.fineract.integrationtests.common.rates.RatesHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
@SuppressWarnings({"rawtypes"}) @SuppressWarnings({"rawtypes"})
public class RatesTest { public class RatesTest {
@@ -37,7 +37,7 @@ public class RatesTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -51,12 +51,12 @@ public class RatesTest {
// Retrieving all Rates // Retrieving all Rates
ArrayList<HashMap> allRatesData = RatesHelper.getRates(this.requestSpec, this.responseSpec); ArrayList<HashMap> allRatesData = RatesHelper.getRates(this.requestSpec, this.responseSpec);
Assert.assertNotNull(allRatesData); Assertions.assertNotNull(allRatesData);
// Testing Creation and Update of Loan Rate // Testing Creation and Update of Loan Rate
final Integer loanRateId = RatesHelper.createRates(this.requestSpec, this.responseSpec, final Integer loanRateId = RatesHelper.createRates(this.requestSpec, this.responseSpec,
RatesHelper.getLoanRateJSON()); RatesHelper.getLoanRateJSON());
Assert.assertNotNull(loanRateId); Assertions.assertNotNull(loanRateId);
//Update Rate percentage //Update Rate percentage
HashMap changes = RatesHelper.updateRates(this.requestSpec, this.responseSpec, loanRateId, HashMap changes = RatesHelper.updateRates(this.requestSpec, this.responseSpec, loanRateId,
@@ -64,8 +64,8 @@ public class RatesTest {
HashMap rateDataAfterChanges = RatesHelper HashMap rateDataAfterChanges = RatesHelper
.getRateById(this.requestSpec, this.responseSpec, loanRateId); .getRateById(this.requestSpec, this.responseSpec, loanRateId);
Assert.assertEquals("Verifying Rate after modification", rateDataAfterChanges.get("percentage"), Assertions.assertEquals(rateDataAfterChanges.get("percentage"),
changes.get("percentage")); changes.get("percentage"), "Verifying Rate after modification");
} }
@@ -18,8 +18,8 @@
*/ */
package org.apache.fineract.integrationtests; package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals;
import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.common.organisation.StaffHelper;
import org.apache.fineract.integrationtests.useradministration.roles.RolesHelper; import org.apache.fineract.integrationtests.useradministration.roles.RolesHelper;
import org.apache.fineract.integrationtests.useradministration.users.UserHelper; import org.apache.fineract.integrationtests.useradministration.users.UserHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -42,7 +42,7 @@ public class RolesTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -56,7 +56,7 @@ public class RolesTest {
LOG.info("---------------------------------CREATING A ROLE---------------------------------------------"); LOG.info("---------------------------------CREATING A ROLE---------------------------------------------");
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId); Assertions.assertNotNull(roleId);
LOG.info("--------------------------------- Getting ROLE -------------------------------"); LOG.info("--------------------------------- Getting ROLE -------------------------------");
HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId);
@@ -70,7 +70,7 @@ public class RolesTest {
LOG.info("---------------------------------CREATING A ROLE---------------------------------------------"); LOG.info("---------------------------------CREATING A ROLE---------------------------------------------");
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId); Assertions.assertNotNull(roleId);
LOG.info("--------------------------------- Getting ROLE -------------------------------"); LOG.info("--------------------------------- Getting ROLE -------------------------------");
HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId);
@@ -91,7 +91,7 @@ public class RolesTest {
LOG.info("---------------------------------CREATING A ROLE---------------------------------------------"); LOG.info("---------------------------------CREATING A ROLE---------------------------------------------");
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId); Assertions.assertNotNull(roleId);
LOG.info("--------------------------------- Getting ROLE -------------------------------"); LOG.info("--------------------------------- Getting ROLE -------------------------------");
HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId);
@@ -119,7 +119,7 @@ public class RolesTest {
LOG.info("-------------------------------- CREATING A ROLE---------------------------------------------"); LOG.info("-------------------------------- CREATING A ROLE---------------------------------------------");
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId); Assertions.assertNotNull(roleId);
LOG.info("--------------------------------- Getting ROLE -------------------------------"); LOG.info("--------------------------------- Getting ROLE -------------------------------");
HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId); HashMap<String, Object> role = RolesHelper.getRoleDetails(requestSpec, responseSpec, roleId);
@@ -133,16 +133,16 @@ public class RolesTest {
@Test @Test
public void testRoleShouldGetDeletedIfNoActiveUserExists() { public void testRoleShouldGetDeletedIfNoActiveUserExists() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId); Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); 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); 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); 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); final Integer deletedRoleId = RolesHelper.deleteRole(this.requestSpec, this.responseSpec, roleId);
assertEquals(deletedRoleId, roleId); assertEquals(deletedRoleId, roleId);
@@ -151,13 +151,13 @@ public class RolesTest {
@Test @Test
public void testRoleShouldNotGetDeletedIfActiveUserExists() { public void testRoleShouldNotGetDeletedIfActiveUserExists() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId); Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); 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); final Integer userId = UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId);
Assert.assertNotNull(userId); Assertions.assertNotNull(userId);
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(403).build(); this.responseSpec = new ResponseSpecBuilder().expectStatusCode(403).build();
final Integer deletedRoleId = RolesHelper.deleteRole(this.requestSpec, this.responseSpec, roleId); final Integer deletedRoleId = RolesHelper.deleteRole(this.requestSpec, this.responseSpec, roleId);
@@ -19,7 +19,7 @@
package org.apache.fineract.integrationtests; package org.apache.fineract.integrationtests;
import static org.awaitility.Awaitility.await; 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.builder.RequestSpecBuilder;
import io.restassured.http.ContentType; 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.infrastructure.jobs.service.JobName;
import org.apache.fineract.integrationtests.common.SchedulerJobHelper; import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class SchedulerJobsTest { public class SchedulerJobsTest {
@@ -42,7 +42,7 @@ public class SchedulerJobsTest {
private Boolean originalSchedulerStatus; private Boolean originalSchedulerStatus;
private final Map<Integer, Boolean> originalJobStatus = new HashMap<>(); private final Map<Integer, Boolean> originalJobStatus = new HashMap<>();
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -57,7 +57,7 @@ public class SchedulerJobsTest {
} }
} }
@After @AfterEach
public void tearDown() { public void tearDown() {
schedulerJobHelper.updateSchedulerStatus(originalSchedulerStatus); schedulerJobHelper.updateSchedulerStatus(originalSchedulerStatus);
for (int jobId = 1; jobId < JobName.values().length; jobId++) { for (int jobId = 1; jobId < JobName.values().length; jobId++) {
@@ -85,19 +85,19 @@ public class SchedulerJobsTest {
schedulerJobHelper.updateSchedulerStatus(false); schedulerJobHelper.updateSchedulerStatus(false);
schedulerStatus = schedulerJobHelper.getSchedulerStatus(); schedulerStatus = schedulerJobHelper.getSchedulerStatus();
// Verifying Status of the Scheduler after stopping // Verifying Status of the Scheduler after stopping
assertEquals("Verifying Scheduler Job Status", false, schedulerStatus); assertEquals(false, schedulerStatus, "Verifying Scheduler Job Status");
} else { } else {
schedulerJobHelper.updateSchedulerStatus(true); schedulerJobHelper.updateSchedulerStatus(true);
schedulerStatus = schedulerJobHelper.getSchedulerStatus(); schedulerStatus = schedulerJobHelper.getSchedulerStatus();
// Verifying Status of the Scheduler after starting // Verifying Status of the Scheduler after starting
assertEquals("Verifying Scheduler Job Status", true, schedulerStatus); assertEquals(true, schedulerStatus, "Verifying Scheduler Job Status");
} }
} }
@Test @Test
public void testNumberOfJobs() { public void testNumberOfJobs() {
List<Integer> jobIds = schedulerJobHelper.getAllSchedulerJobIds(); 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 @Test
@@ -118,10 +118,10 @@ public class SchedulerJobsTest {
Map<String, Object> changes = schedulerJobHelper.updateSchedulerJob(jobId, active); Map<String, Object> changes = schedulerJobHelper.updateSchedulerJob(jobId, active);
// Verifying Scheduler Job updates // 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); 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; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.integrationtests.common.savings.SavingsStatusChecker;
import org.apache.fineract.portfolio.account.PortfolioAccountType; import org.apache.fineract.portfolio.account.PortfolioAccountType;
import org.apache.fineract.portfolio.account.domain.AccountTransferType; import org.apache.fineract.portfolio.account.domain.AccountTransferType;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Ignore; import org.junit.jupiter.api.Disabled;
import org.junit.Test; import org.junit.jupiter.api.Test;
@SuppressWarnings({ "unused", "unchecked", "rawtypes", "static-access", "cast" }) @SuppressWarnings({ "unused", "unchecked", "rawtypes", "static-access", "cast" })
public class SchedulerJobsTestResults { public class SchedulerJobsTestResults {
@@ -93,7 +93,7 @@ public class SchedulerJobsTestResults {
private JournalEntryHelper journalEntryHelper; private JournalEntryHelper journalEntryHelper;
private StandingInstructionsHelper standingInstructionsHelper; private StandingInstructionsHelper standingInstructionsHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -106,28 +106,28 @@ public class SchedulerJobsTestResults {
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec); this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
} }
@After @AfterEach
public void tearDown() { public void tearDown() {
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec); GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec); GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
} }
@Test @Test
@Ignore // TODO FINERACT-924 @Disabled // TODO FINERACT-924
public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException { public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
final Integer clientID = ClientHelper.createClient(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, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE); ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL); savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId); this.responseSpec, savingsId);
@@ -135,11 +135,11 @@ public class SchedulerJobsTestResults {
final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getSavingsAnnualFeeJSON()); ChargesHelper.getSavingsAnnualFeeJSON());
Assert.assertNotNull(annualFeeChargeId); Assertions.assertNotNull(annualFeeChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, annualFeeChargeId, true); this.savingsAccountHelper.addChargesForSavings(savingsId, annualFeeChargeId, true);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId); ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size()); Assertions.assertEquals(1, chargesPendingState.size());
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId); savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
@@ -162,27 +162,27 @@ public class SchedulerJobsTestResults {
annualFeeDueDateAsArrayList.get(1), annualFeeDueDateAsArrayList.get(2)); annualFeeDueDateAsArrayList.get(1), annualFeeDueDateAsArrayList.get(2));
LocalDate todaysDate = LocalDate.now(ZoneId.of("Asia/Kolkata")); LocalDate todaysDate = LocalDate.now(ZoneId.of("Asia/Kolkata"));
Assert.assertTrue("Verifying that all due Annual Fees have been paid ", Assertions.assertTrue(nextDueDateForAnnualFee.isAfter(todaysDate),
nextDueDateForAnnualFee.isAfter(todaysDate)); "Verifying that all due Annual Fees have been paid ");
} }
@Test @Test
@Ignore @Disabled
public void testInterestPostingForSavingsJobOutcome() throws InterruptedException { public void testInterestPostingForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
final Integer clientID = ClientHelper.createClient(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, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE); ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL); savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId); this.responseSpec, savingsId);
@@ -201,28 +201,28 @@ public class SchedulerJobsTestResults {
this.schedulerJobHelper.executeJob(JobName); this.schedulerJobHelper.executeJob(JobName);
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId); final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
Assert.assertNotSame("Verifying the Balance after running Post Interest for Savings Job", Assertions.assertNotSame(summaryBefore.get("accountBalance"), summaryAfter.get("accountBalance"),
summaryBefore.get("accountBalance"), summaryAfter.get("accountBalance")); "Verifying the Balance after running Post Interest for Savings Job");
} }
@Test @Test
@Ignore // TODO FINERACT-857 @Disabled // TODO FINERACT-857
public void testTransferFeeForLoansFromSavingsJobOutcome() throws InterruptedException { public void testTransferFeeForLoansFromSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(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, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE); ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL); savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId); this.responseSpec, savingsId);
@@ -235,11 +235,11 @@ public class SchedulerJobsTestResults {
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
final Integer loanProductID = createLoanProduct(null); final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(),
savingsId.toString()); savingsId.toString());
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID); loanID);
@@ -251,13 +251,13 @@ public class SchedulerJobsTestResults {
Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanSpecifiedDueDateWithAccountTransferJSON()); ChargesHelper.getLoanSpecifiedDueDateWithAccountTransferJSON());
Assert.assertNotNull(specifiedDueDateChargeId); Assertions.assertNotNull(specifiedDueDateChargeId);
this.loanTransactionHelper.addChargesForLoan(loanID, this.loanTransactionHelper.addChargesForLoan(loanID,
LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON( LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
specifiedDueDateChargeId.toString(), "12 March 2013", "100")); specifiedDueDateChargeId.toString(), "12 March 2013", "100"));
ArrayList<HashMap> chargesPendingState = this.loanTransactionHelper.getLoanCharges(loanID); 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, loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_DISBURSAL_DATE,
loanID); loanID);
@@ -275,13 +275,13 @@ public class SchedulerJobsTestResults {
final Float balance = (Float) summaryBefore.get("accountBalance") - chargeAmount; final Float balance = (Float) summaryBefore.get("accountBalance") - chargeAmount;
Assert.assertEquals("Verifying the Balance after running Transfer Fee for Loans from Savings", balance, Assertions.assertEquals(balance, (Float) summaryAfter.get("accountBalance"),
(Float) summaryAfter.get("accountBalance")); "Verifying the Balance after running Transfer Fee for Loans from Savings");
} }
@Test @Test
@Ignore // TODO FINERACT-923 @Disabled // TODO FINERACT-923
public void testApplyHolidaysToLoansJobOutcome() throws InterruptedException { public void testApplyHolidaysToLoansJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
@@ -289,16 +289,16 @@ public class SchedulerJobsTestResults {
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec); this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(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); Integer holidayId = this.holidayHelper.createHolidays(this.requestSpec, this.responseSpec);
Assert.assertNotNull(holidayId); Assertions.assertNotNull(holidayId);
final Integer loanProductID = createLoanProduct(null); final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null); final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID); loanID);
@@ -315,16 +315,16 @@ public class SchedulerJobsTestResults {
// Retrieving All Global Configuration details // Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper
.getAllGlobalConfigurations(this.requestSpec, this.responseSpec); .getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
Assert.assertNotNull(globalConfig); Assertions.assertNotNull(globalConfig);
// Updating Value for reschedule-repayments-on-holidays Global // Updating Value for reschedule-repayments-on-holidays Global
// Configuration // Configuration
Integer configId = (Integer) globalConfig.get(3).get("id"); Integer configId = (Integer) globalConfig.get(3).get("id");
Assert.assertNotNull(configId); Assertions.assertNotNull(configId);
HashMap configData = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, HashMap configData = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec,
this.responseSpec, configId.toString()); this.responseSpec, configId.toString());
Assert.assertNotNull(configData); Assertions.assertNotNull(configData);
Boolean enabled = (Boolean) globalConfig.get(3).get("enabled"); Boolean enabled = (Boolean) globalConfig.get(3).get("enabled");
@@ -338,7 +338,7 @@ public class SchedulerJobsTestResults {
holidayId = this.holidayHelper.activateHolidays(this.requestSpec, this.responseSpec, holidayId = this.holidayHelper.activateHolidays(this.requestSpec, this.responseSpec,
holidayId.toString()); holidayId.toString());
Assert.assertNotNull(holidayId); Assertions.assertNotNull(holidayId);
String JobName = "Apply Holidays To Loans"; String JobName = "Apply Holidays To Loans";
@@ -354,28 +354,27 @@ public class SchedulerJobsTestResults {
ArrayList<Integer> rescheduleDateAfter = (ArrayList<Integer>) repaymentScheduleDataAfterJob.get(2) ArrayList<Integer> rescheduleDateAfter = (ArrayList<Integer>) repaymentScheduleDataAfterJob.get(2)
.get("fromDate"); .get("fromDate");
Assert.assertEquals( Assertions.assertEquals(repaymentsRescheduledDate, repaymentsRescheduledDate,
"Verifying Repayment Rescheduled Date after Running Apply Holidays to Loans Scheduler Job", "Verifying Repayment Rescheduled Date after Running Apply Holidays to Loans Scheduler Job");
repaymentsRescheduledDate, repaymentsRescheduledDate);
} }
@Test @Test
@Ignore // TODO FINERACT-857 @Disabled // TODO FINERACT-857
public void testApplyDueFeeChargesForSavingsJobOutcome() throws InterruptedException { public void testApplyDueFeeChargesForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
final Integer clientID = ClientHelper.createClient(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, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE); ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL); savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId); this.responseSpec, savingsId);
@@ -383,11 +382,11 @@ public class SchedulerJobsTestResults {
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec,
this.responseSpec, ChargesHelper.getSavingsSpecifiedDueDateJSON()); this.responseSpec, ChargesHelper.getSavingsSpecifiedDueDateJSON());
Assert.assertNotNull(specifiedDueDateChargeId); Assertions.assertNotNull(specifiedDueDateChargeId);
this.savingsAccountHelper.addChargesForSavings(savingsId, specifiedDueDateChargeId, true); this.savingsAccountHelper.addChargesForSavings(savingsId, specifiedDueDateChargeId, true);
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId); ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
Assert.assertEquals(1, chargesPendingState.size()); Assertions.assertEquals(1, chargesPendingState.size());
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId); savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
@@ -409,12 +408,12 @@ public class SchedulerJobsTestResults {
final Float balance = (Float) summaryBefore.get("accountBalance") - chargeAmount; final Float balance = (Float) summaryBefore.get("accountBalance") - chargeAmount;
Assert.assertEquals("Verifying the Balance after running Pay due Savings Charges", balance, Assertions.assertEquals(balance, (Float) summaryAfter.get("accountBalance"),
(Float) summaryAfter.get("accountBalance")); "Verifying the Balance after running Pay due Savings Charges");
} }
@Test @Test
@Ignore // TODO FINERACT-857 @Disabled // TODO FINERACT-857
public void testUpdateAccountingRunningBalancesJobOutcome() throws InterruptedException { public void testUpdateAccountingRunningBalancesJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
@@ -462,26 +461,25 @@ public class SchedulerJobsTestResults {
final Integer INT_BALANCE = Integer.valueOf(MINIMUM_OPENING_BALANCE); final Integer INT_BALANCE = Integer.valueOf(MINIMUM_OPENING_BALANCE);
Assert.assertEquals( Assertions.assertEquals(INT_BALANCE, runningBalanceAfter.get("organizationRunningBalance"),
"Verifying Account Running Balance after running Update Accounting Running Balances Scheduler Job", "Verifying Account Running Balance after running Update Accounting Running Balances Scheduler Job");
INT_BALANCE, runningBalanceAfter.get("organizationRunningBalance"));
} }
@Test @Test
@Ignore // TODO FINERACT-857 @Disabled // TODO FINERACT-857
public void testUpdateLoanArrearsAgingJobOutcome() throws InterruptedException { public void testUpdateLoanArrearsAgingJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID); Assertions.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null); final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null); final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID); loanID);
@@ -504,13 +502,13 @@ public class SchedulerJobsTestResults {
Float totalLoanArrearsAging = (Float) loanSummaryData.get("principalOverdue") Float totalLoanArrearsAging = (Float) loanSummaryData.get("principalOverdue")
+ (Float) loanSummaryData.get("interestOverdue"); + (Float) loanSummaryData.get("interestOverdue");
Assert.assertEquals("Verifying Arrears Aging after Running Update Loan Arrears Aging Scheduler Job", Assertions.assertEquals(totalLoanArrearsAging, loanSummaryData.get("totalOverdue"),
totalLoanArrearsAging, loanSummaryData.get("totalOverdue")); "Verifying Arrears Aging after Running Update Loan Arrears Aging Scheduler Job");
} }
@Test @Test
@Ignore // TODO FINERACT-857 @Disabled // TODO FINERACT-857
public void testUpdateLoanPaidInAdvanceJobOutcome() throws InterruptedException { public void testUpdateLoanPaidInAdvanceJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); 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 String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todayDate.getTime());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID); Assertions.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null); final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null); final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID); loanID);
@@ -569,15 +567,14 @@ public class SchedulerJobsTestResults {
Float totalPaidInAdvance = (Float) loanScheduleAfter.get(1).get("totalPaidInAdvanceForPeriod"); Float totalPaidInAdvance = (Float) loanScheduleAfter.get(1).get("totalPaidInAdvanceForPeriod");
Assert.assertEquals( Assertions.assertEquals(totalDueForCurrentPeriod, totalPaidInAdvance,
"Verifying Loan Repayment in Advance after Running Update Loan Paid in Advance Scheduler Job", "Verifying Loan Repayment in Advance after Running Update Loan Paid in Advance Scheduler Job");
totalDueForCurrentPeriod, totalPaidInAdvance);
} }
// Invalid test case as it won't affect summary (Loan summary is properly // Invalid test case as it won't affect summary (Loan summary is properly
// updated before running this job) // updated before running this job)
@Ignore @Disabled
@Test @Test
public void testUpdateLoanSummaryJobOutcome() throws InterruptedException { public void testUpdateLoanSummaryJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
@@ -596,22 +593,22 @@ public class SchedulerJobsTestResults {
final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todaysDate.getTime()); final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID); Assertions.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null); final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null); final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
Integer disburseChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, Integer disburseChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanDisbursementJSON()); ChargesHelper.getLoanDisbursementJSON());
Assert.assertNotNull(disburseChargeId); Assertions.assertNotNull(disburseChargeId);
this.loanTransactionHelper.addChargesForLoan(loanID, this.loanTransactionHelper.addChargesForLoan(loanID,
LoanTransactionHelper.getDisbursementChargesForLoanAsJSON(disburseChargeId.toString())); LoanTransactionHelper.getDisbursementChargesForLoanAsJSON(disburseChargeId.toString()));
ArrayList<HashMap> chargesPendingState = this.loanTransactionHelper.getLoanCharges(loanID); 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, HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID); loanID);
@@ -633,13 +630,13 @@ public class SchedulerJobsTestResults {
/* - (Float) loanSummaryBefore.get("feeChargesPaid") */; /* - (Float) loanSummaryBefore.get("feeChargesPaid") */;
HashMap loanSummaryAfter = this.loanTransactionHelper.getLoanSummary(this.requestSpec, HashMap loanSummaryAfter = this.loanTransactionHelper.getLoanSummary(this.requestSpec,
this.responseSpec, loanID); this.responseSpec, loanID);
Assert.assertEquals("Verifying Loan Summary after Running Update Loan Summary Scheduler Job", Assertions.assertEquals(expectedSummaryAfterJob, (Float) loanSummaryAfter.get("totalExpectedRepayment"),
expectedSummaryAfterJob, (Float) loanSummaryAfter.get("totalExpectedRepayment")); "Verifying Loan Summary after Running Update Loan Summary Scheduler Job");
} }
@Test @Test
@Ignore // TODO FINERACT-857 @Disabled // TODO FINERACT-857
public void testExecuteStandingInstructionsJobOutcome() throws InterruptedException { public void testExecuteStandingInstructionsJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
@@ -658,15 +655,15 @@ public class SchedulerJobsTestResults {
final String VALID_TO = dateFormat.format(todaysDate.getTime()); final String VALID_TO = dateFormat.format(todaysDate.getTime());
final Integer clientID = ClientHelper.createClient(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, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE); ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer fromSavingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, final Integer fromSavingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL); savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, fromSavingsId); this.responseSpec, fromSavingsId);
@@ -680,7 +677,7 @@ public class SchedulerJobsTestResults {
final Integer toSavingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, final Integer toSavingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL); savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, toSavingsId); this.responseSpec, toSavingsId);
@@ -701,7 +698,7 @@ public class SchedulerJobsTestResults {
Integer standingInstructionId = this.standingInstructionsHelper.createStandingInstruction( Integer standingInstructionId = this.standingInstructionsHelper.createStandingInstruction(
clientID.toString(), fromSavingsId.toString(), toSavingsId.toString(), clientID.toString(), fromSavingsId.toString(), toSavingsId.toString(),
FROM_ACCOUNT_TYPE_SAVINGS, TO_ACCOUNT_TYPE_SAVINGS, VALID_FROM, VALID_TO, MONTH_DAY); 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"; String JobName = "Execute Standing Instruction";
this.schedulerJobHelper.executeJob(JobName); this.schedulerJobHelper.executeJob(JobName);
@@ -717,42 +714,42 @@ public class SchedulerJobsTestResults {
- (Float) standingInstructionData.get("amount"); - (Float) standingInstructionData.get("amount");
Float expectedToSavingsBalance = toSavingsBalanceBefore + (Float) standingInstructionData.get("amount"); Float expectedToSavingsBalance = toSavingsBalanceBefore + (Float) standingInstructionData.get("amount");
Assert.assertEquals("Verifying From Savings Balance after Successful completion of Scheduler Job", Assertions.assertEquals(expectedFromSavingsBalance, fromSavingsBalanceAfter,
expectedFromSavingsBalance, fromSavingsBalanceAfter); "Verifying From Savings Balance after Successful completion of Scheduler Job");
Assert.assertEquals("Verifying To Savings Balance after Successful completion of Scheduler Job", Assertions.assertEquals(expectedToSavingsBalance, toSavingsBalanceAfter,
expectedToSavingsBalance, toSavingsBalanceAfter); "Verifying To Savings Balance after Successful completion of Scheduler Job");
Integer fromAccountType = PortfolioAccountType.SAVINGS.getValue(); Integer fromAccountType = PortfolioAccountType.SAVINGS.getValue();
Integer transferType = AccountTransferType.ACCOUNT_TRANSFER.getValue(); Integer transferType = AccountTransferType.ACCOUNT_TRANSFER.getValue();
List<HashMap> standinInstructionHistoryData = this.standingInstructionsHelper List<HashMap> standinInstructionHistoryData = this.standingInstructionsHelper
.getStandingInstructionHistory(fromSavingsId, fromAccountType, clientID, transferType); .getStandingInstructionHistory(fromSavingsId, fromAccountType, clientID, transferType);
Assert.assertEquals("Verifying the no of stainding instruction transactions logged for the client", 1, Assertions.assertEquals(1, standinInstructionHistoryData.size(),
standinInstructionHistoryData.size()); "Verifying the no of stainding instruction transactions logged for the client");
HashMap loggedTransaction = standinInstructionHistoryData.get(0); HashMap loggedTransaction = standinInstructionHistoryData.get(0);
Assert.assertEquals("Verifying transferred amount and logged transaction amounts", Assertions.assertEquals((Float) standingInstructionData.get("amount"), (Float) loggedTransaction.get("amount"),
(Float) standingInstructionData.get("amount"), (Float) loggedTransaction.get("amount")); "Verifying transferred amount and logged transaction amounts");
} }
@Test @Test
@Ignore @Disabled
public void testApplyPenaltyForOverdueLoansJobOutcome() throws InterruptedException { public void testApplyPenaltyForOverdueLoansJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(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, Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanOverdueFeeJSON()); ChargesHelper.getLoanOverdueFeeJSON());
Assert.assertNotNull(overdueFeeChargeId); Assertions.assertNotNull(overdueFeeChargeId);
final Integer loanProductID = createLoanProduct(overdueFeeChargeId.toString()); final Integer loanProductID = createLoanProduct(overdueFeeChargeId.toString());
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null); final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID); loanID);
@@ -780,9 +777,8 @@ public class SchedulerJobsTestResults {
ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper
.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); .getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
Assert.assertEquals( Assertions.assertEquals(chargeAmount, (Float) repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"),
"Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job", "Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job");
chargeAmount, (Float) repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"));
loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID); loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
@@ -791,24 +787,24 @@ public class SchedulerJobsTestResults {
} }
@Test @Test
@Ignore // TODO FINERACT-857 @Disabled // TODO FINERACT-857
public void testAvoidUnncessaryPenaltyWhenAmountZeroForOverdueLoansJobOutcome() throws InterruptedException { public void testAvoidUnncessaryPenaltyWhenAmountZeroForOverdueLoansJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(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, Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanOverdueFeeJSONWithCalculattionTypePercentage("0.000001")); ChargesHelper.getLoanOverdueFeeJSONWithCalculattionTypePercentage("0.000001"));
Assert.assertNotNull(overdueFeeChargeId); Assertions.assertNotNull(overdueFeeChargeId);
final Integer loanProductID = createLoanProduct(overdueFeeChargeId.toString()); final Integer loanProductID = createLoanProduct(overdueFeeChargeId.toString());
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null); final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID); loanID);
@@ -832,11 +828,11 @@ public class SchedulerJobsTestResults {
Map<String, Object> schedulerJob = this.schedulerJobHelper.getSchedulerJobById(jobId); Map<String, Object> schedulerJob = this.schedulerJobHelper.getSchedulerJobById(jobId);
Assert.assertNotNull(schedulerJob); Assertions.assertNotNull(schedulerJob);
while ((Boolean) schedulerJob.get("currentlyRunning") == true) { while ((Boolean) schedulerJob.get("currentlyRunning") == true) {
Thread.sleep(15000); Thread.sleep(15000);
schedulerJob = this.schedulerJobHelper.getSchedulerJobById(jobId); schedulerJob = this.schedulerJobHelper.getSchedulerJobById(jobId);
Assert.assertNotNull(schedulerJob); Assertions.assertNotNull(schedulerJob);
} }
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec,
@@ -845,14 +841,13 @@ public class SchedulerJobsTestResults {
ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper
.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); .getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
Assert.assertEquals( Assertions.assertEquals(0, repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"),
"Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job", "Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job");
0, repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"));
final ArrayList loanCharges = this.loanTransactionHelper.getLoanCharges(this.requestSpec, final ArrayList loanCharges = this.loanTransactionHelper.getLoanCharges(this.requestSpec,
this.responseSpec, loanID); 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); loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID);
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap); LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
@@ -861,19 +856,19 @@ public class SchedulerJobsTestResults {
} }
@Test @Test
@Ignore // TODO FINERACT-857 @Disabled // TODO FINERACT-857
public void testUpdateOverdueDaysForNPA() throws InterruptedException { public void testUpdateOverdueDaysForNPA() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientID); Assertions.assertNotNull(clientID);
final Integer loanProductID = createLoanProduct(null); final Integer loanProductID = createLoanProduct(null);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null); final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
loanID); loanID);
@@ -889,17 +884,17 @@ public class SchedulerJobsTestResults {
final Boolean isNPABefore = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec, final Boolean isNPABefore = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec,
responseSpec, loanID, "isNPA"); responseSpec, loanID, "isNPA");
Assert.assertFalse(isNPABefore); Assertions.assertFalse(isNPABefore);
// Integer jobId = (Integer) allSchedulerJobsData.get(1).get("jobId"); // Integer jobId = (Integer) allSchedulerJobsData.get(1).get("jobId");
String JobName = "Update Non Performing Assets"; String JobName = "Update Non Performing Assets";
this.schedulerJobHelper.executeJob(JobName); this.schedulerJobHelper.executeJob(JobName);
final Boolean isNPAAfter = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec, responseSpec, final Boolean isNPAAfter = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec, responseSpec,
loanID, "isNPA"); loanID, "isNPA");
Assert.assertTrue(isNPAAfter); Assertions.assertTrue(isNPAAfter);
} }
@Test @Test
@Ignore // TODO FINERACT-857 @Disabled // TODO FINERACT-857
public void testInterestTransferForSavings() throws InterruptedException { public void testInterestTransferForSavings() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec); this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
@@ -928,16 +923,16 @@ public class SchedulerJobsTestResults {
final String WHOLE_TERM = "1"; final String WHOLE_TERM = "1";
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE) Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE)
+ Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT); + Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
String.valueOf(balance)); String.valueOf(balance));
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientId, final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientId,
savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL); savingsProductID, ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsId); Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec,
this.responseSpec, savingsId); this.responseSpec, savingsId);
@@ -949,15 +944,15 @@ public class SchedulerJobsTestResults {
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId); savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId); 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); Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO);
Assert.assertNotNull(fixedDepositProductId); Assertions.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(),
fixedDepositProductId.toString(), VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, fixedDepositProductId.toString(), VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM,
savingsId.toString(), true, fixedDepositAccountHelper); savingsId.toString(), true, fixedDepositAccountHelper);
Assert.assertNotNull(fixedDepositAccountId); Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker
.getStatusOfFixedDepositAccount(this.requestSpec, this.responseSpec, .getStatusOfFixedDepositAccount(this.requestSpec, this.responseSpec,
@@ -973,7 +968,7 @@ public class SchedulerJobsTestResults {
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap); FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
summary = savingsAccountHelper.getSavingsSummary(savingsId); summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE); balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
assertEquals("Verifying Balance", balance, summary.get("accountBalance")); assertEquals(balance, summary.get("accountBalance"), "Verifying Balance");
fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId); fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
@@ -984,8 +979,9 @@ public class SchedulerJobsTestResults {
String JobName = "Transfer Interest To Savings"; String JobName = "Transfer Interest To Savings";
this.schedulerJobHelper.executeJob(JobName); this.schedulerJobHelper.executeJob(JobName);
fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId); fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
assertEquals("Verifying opening Balance", Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT), assertEquals(Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT),
fixedDepositSummary.get("accountBalance")); fixedDepositSummary.get("accountBalance"),
"Verifying opening Balance");
summary = savingsAccountHelper.getSavingsSummary(savingsId); summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + interestPosted; balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + interestPosted;
@@ -1086,7 +1082,7 @@ public class SchedulerJobsTestResults {
private void validateNumberForEqualExcludePrecission(String val, String val2) { private void validateNumberForEqualExcludePrecission(String val, String val2) {
DecimalFormat twoDForm = new DecimalFormat("#", new DecimalFormatSymbols(Locale.US)); 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); .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(val2)))) == 0);
} }
} }
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; import io.restassured.builder.ResponseSpecBuilder;
@@ -28,7 +28,6 @@ import io.restassured.specification.ResponseSpecification;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import junit.framework.Assert;
import org.apache.fineract.integrationtests.common.CalendarHelper; import org.apache.fineract.integrationtests.common.CalendarHelper;
import org.apache.fineract.integrationtests.common.ClientHelper; import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper; 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.LoanApplicationTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder; import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Before; import org.junit.jupiter.api.Assertions;
import org.junit.Test; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -52,7 +52,7 @@ public class SkipRepaymentOnMonthFirstTest {
private LoanTransactionHelper loanTransactionHelper; private LoanTransactionHelper loanTransactionHelper;
private CalendarHelper calendarHelper; private CalendarHelper calendarHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -61,7 +61,7 @@ public class SkipRepaymentOnMonthFirstTest {
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
} }
@After @AfterEach
public void tearDown() { public void tearDown() {
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec); GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec); GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
@@ -74,7 +74,7 @@ public class SkipRepaymentOnMonthFirstTest {
// Retrieving All Global Configuration details // Retrieving All Global Configuration details
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper
.getAllGlobalConfigurations(this.requestSpec, this.responseSpec); .getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
Assert.assertNotNull(globalConfig); Assertions.assertNotNull(globalConfig);
String configName = "skip-repayment-on-first-day-of-month"; String configName = "skip-repayment-on-first-day-of-month";
boolean newBooleanValue = true; boolean newBooleanValue = true;
@@ -84,7 +84,7 @@ public class SkipRepaymentOnMonthFirstTest {
String configId = globalConfig.get(configIndex).get("id").toString(); String configId = globalConfig.get(configIndex).get("id").toString();
Integer updateConfigId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration( Integer updateConfigId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(
this.requestSpec, this.responseSpec, configId.toString(), newBooleanValue); this.requestSpec, this.responseSpec, configId.toString(), newBooleanValue);
Assert.assertNotNull(updateConfigId); Assertions.assertNotNull(updateConfigId);
break; break;
} }
} }
@@ -155,20 +155,20 @@ public class SkipRepaymentOnMonthFirstTest {
private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) { private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
LOG.info("--------------------VERIFYING THE REPAYMENT DATE--------------------------"); LOG.info("--------------------VERIFYING THE REPAYMENT DATE--------------------------");
assertEquals("Checking for Repayment Date for 1st Month", new ArrayList<>(Arrays.asList(2011, 10, 15)), assertEquals(new ArrayList<>(Arrays.asList(2011, 10, 15)), loanSchedule.get(1).get("dueDate"),
loanSchedule.get(1).get("dueDate")); "Checking for Repayment Date for 1st Month");
LOG.info("Repayment Date for 1st Month-- {}" , loanSchedule.get(1).get("dueDate")); 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)), assertEquals(new ArrayList<>(Arrays.asList(2011, 11, 15)), loanSchedule.get(2).get("dueDate"),
loanSchedule.get(2).get("dueDate")); "Checking for Repayment Date for 2nd Month");
LOG.info("Repayment Date for 2nd Month-- {}" , loanSchedule.get(2).get("dueDate")); 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)), assertEquals(new ArrayList<>(Arrays.asList(2011, 12, 15)), loanSchedule.get(3).get("dueDate"),
loanSchedule.get(3).get("dueDate")); "Checking for Repayment Date for 3rd Month");
LOG.info("Repayment Date for 3rd Month-- {}" , loanSchedule.get(3).get("dueDate")); 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)), assertEquals(new ArrayList<>(Arrays.asList(2012, 1, 15)), loanSchedule.get(4).get("dueDate"),
loanSchedule.get(4).get("dueDate")); "Checking for Repayment Date for 4th Month");
LOG.info("Repayment Date for 4th Month-- {}" , loanSchedule.get(4).get("dueDate")); LOG.info("Repayment Date for 4th Month-- {}" , loanSchedule.get(4).get("dueDate"));
} }
@@ -18,8 +18,8 @@
*/ */
package org.apache.fineract.integrationtests; package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.ImageHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper; import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class StaffImageApiTest { public class StaffImageApiTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -49,14 +49,14 @@ public class StaffImageApiTest {
public void createStaffImage() { public void createStaffImage() {
Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Integer imageId = ImageHelper.createImageForStaff(this.requestSpec, this.responseSpec, staffId); 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 @Test
public void getStaffImage(){ public void getStaffImage(){
Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Integer imageId = ImageHelper.createImageForStaff(this.requestSpec, this.responseSpec, staffId); 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); String imageAsText = ImageHelper.getStaffImageAsText(this.requestSpec, this.responseSpec, staffId);
assertNotNull("Image id should not be null", imageAsText); assertNotNull("Image id should not be null", imageAsText);
assertEquals(ImageHelper.generateImageAsText(), imageAsText); assertEquals(ImageHelper.generateImageAsText(), imageAsText);
@@ -66,9 +66,9 @@ public class StaffImageApiTest {
public void getStaffImageAsBinary(){ public void getStaffImageAsBinary(){
Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Integer imageId = ImageHelper.createImageForStaff(this.requestSpec, this.responseSpec, staffId); 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); 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); assertEquals(251, imageAsBytes.length);
} }
@@ -76,17 +76,17 @@ public class StaffImageApiTest {
public void updateImage() { public void updateImage() {
Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Integer imageId = ImageHelper.createImageForStaff(this.requestSpec, this.responseSpec, staffId); 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); 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 @Test
public void deleteStaffImage() { public void deleteStaffImage() {
Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Integer imageId = ImageHelper.createImageForStaff(this.requestSpec, this.responseSpec, staffId); 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); 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 java.util.Map;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper; import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class StaffTest { public class StaffTest {
@@ -40,7 +40,7 @@ public class StaffTest {
private ResponseSpecification responseSpecForValidationError; private ResponseSpecification responseSpecForValidationError;
private ResponseSpecification responseSpecForNotFoundError; private ResponseSpecification responseSpecForNotFoundError;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -54,9 +54,9 @@ public class StaffTest {
public void testStaffCreate() { public void testStaffCreate() {
Map<String, Object> response = StaffHelper.createStaffMap(requestSpec, responseSpec); Map<String, Object> response = StaffHelper.createStaffMap(requestSpec, responseSpec);
Assert.assertNotNull(response); Assertions.assertNotNull(response);
Assert.assertEquals(1, response.get("officeId")); Assertions.assertEquals(1, response.get("officeId"));
Assert.assertNotNull(response.get("resourceId")); Assertions.assertNotNull(response.get("resourceId"));
} }
@Test @Test
@@ -118,9 +118,9 @@ public class StaffTest {
@Test @Test
public void testStaffFetch() { public void testStaffFetch() {
Map<String, Object> response = StaffHelper.getStaff(requestSpec, responseSpec, 1); Map<String, Object> response = StaffHelper.getStaff(requestSpec, responseSpec, 1);
Assert.assertNotNull(response); Assertions.assertNotNull(response);
Assert.assertNotNull(response.get("id")); Assertions.assertNotNull(response.get("id"));
Assert.assertEquals(1, response.get("id")); Assertions.assertEquals(1, response.get("id"));
} }
@Test @Test
@@ -137,8 +137,8 @@ public class StaffTest {
public void testStaffListStatusActive() { public void testStaffListStatusActive() {
List<Map<String, Object>> responseActive = StaffHelper.getStaffListWithState(requestSpec, responseSpec, "active"); List<Map<String, Object>> responseActive = StaffHelper.getStaffListWithState(requestSpec, responseSpec, "active");
for(final Map<String, Object> staff : responseActive) { for(final Map<String, Object> staff : responseActive) {
Assert.assertNotNull(staff.get("id")); Assertions.assertNotNull(staff.get("id"));
Assert.assertEquals(true, staff.get("isActive")); Assertions.assertEquals(true, staff.get("isActive"));
} }
} }
@@ -146,14 +146,16 @@ public class StaffTest {
public void testStaffListStatusInactive() { public void testStaffListStatusInactive() {
List<Map<String, Object>> responseInactive = StaffHelper.getStaffListWithState(requestSpec, responseSpec, "inactive"); List<Map<String, Object>> responseInactive = StaffHelper.getStaffListWithState(requestSpec, responseSpec, "inactive");
for(final Map<String, Object> staff : responseInactive) { for(final Map<String, Object> staff : responseInactive) {
Assert.assertNotNull(staff.get("id")); Assertions.assertNotNull(staff.get("id"));
Assert.assertEquals(false, staff.get("isActive")); Assertions.assertEquals(false, staff.get("isActive"));
} }
} }
@Test(expected = ClassCastException.class) // because "xyz" will return an error, not a List @Test // because "xyz" will return an error, not a List
public void testStaffListFetchWrongState() { public void testStaffListFetchWrongState() throws ClassCastException {
StaffHelper.getStaffListWithState(requestSpec, responseSpecForValidationError, "xyz"); Assertions.assertThrows(ClassCastException.class, () -> {
StaffHelper.getStaffListWithState(requestSpec, responseSpecForValidationError, "xyz");
});
} }
@Test @Test
@@ -178,11 +180,11 @@ public class StaffTest {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Map<String, Object> changes = (Map<String, Object>) response.get("changes"); Map<String, Object> changes = (Map<String, Object>) response.get("changes");
Assert.assertEquals(1, response.get("resourceId")); Assertions.assertEquals(1, response.get("resourceId"));
Assert.assertEquals(firstname, changes.get("firstname")); Assertions.assertEquals(firstname, changes.get("firstname"));
Assert.assertEquals(lastname, changes.get("lastname")); Assertions.assertEquals(lastname, changes.get("lastname"));
Assert.assertEquals(externalId, changes.get("externalId")); Assertions.assertEquals(externalId, changes.get("externalId"));
Assert.assertEquals(mobileNo, changes.get("mobileNo")); Assertions.assertEquals(mobileNo, changes.get("mobileNo"));
} }
@Test @Test
@@ -25,7 +25,7 @@ import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification; import io.restassured.specification.ResponseSpecification;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; 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 * Client Loan Integration Test for checking Loan Application Repayment
@@ -38,7 +38,7 @@ public class SurveyIntegrationTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private LoanTransactionHelper loanTransactionHelper; private LoanTransactionHelper loanTransactionHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,8 +18,8 @@
*/ */
package org.apache.fineract.integrationtests; package org.apache.fineract.integrationtests;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.system.CodeHelper; import org.apache.fineract.integrationtests.common.system.CodeHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Ignore; import org.junit.jupiter.api.Disabled;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Test for creating, updating, deleting codes and code values * Test for creating, updating, deleting codes and code values
@@ -48,7 +48,7 @@ public class SystemCodeTest {
private ResponseSpecification generalResponseSpec; private ResponseSpecification generalResponseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); 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, ""); final HashMap newCodeAttributes = (HashMap) CodeHelper.getCodeById(this.requestSpec, this.responseSpec, createResponseId, "");
Assert.assertNotNull(newCodeAttributes); Assertions.assertNotNull(newCodeAttributes);
assertEquals("Verify value of codeId", createResponseId, newCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME)); 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(codeName, newCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME), "Verify code name");
assertEquals("Verify system defined is false", false, newCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME)); assertEquals(false, newCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME), "Verify system defined is false");
// update code // update code
final HashMap updateChangeResponse = (HashMap) CodeHelper.updateCode(this.requestSpec, this.responseSpec, createResponseId, final HashMap updateChangeResponse = (HashMap) CodeHelper.updateCode(this.requestSpec, this.responseSpec, createResponseId,
codeName + "(CHANGE)", "changes"); 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 // delete code
final Integer deleteResponseId = (Integer) CodeHelper.deleteCodeById(this.requestSpec, this.responseSpec, createResponseId, final Integer deleteResponseId = (Integer) CodeHelper.deleteCodeById(this.requestSpec, this.responseSpec, createResponseId,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME); CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
assertEquals("Verify code deleted", createResponseId, deleteResponseId); assertEquals(createResponseId, deleteResponseId, "Verify code deleted");
// verify code deleted // verify code deleted
final HashMap deletedCodeValues = (HashMap) CodeHelper final HashMap deletedCodeValues = (HashMap) CodeHelper
.getCodeById(this.requestSpec, this.generalResponseSpec, deleteResponseId, ""); .getCodeById(this.requestSpec, this.generalResponseSpec, deleteResponseId, "");
Assert.assertNotNull(deletedCodeValues); Assertions.assertNotNull(deletedCodeValues);
assertNull("Verify value of codeId", deletedCodeValues.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME)); assertNull(deletedCodeValues.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME), "Verify value of codeId");
assertNull("Verify code name", deletedCodeValues.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME)); assertNull(deletedCodeValues.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME), "Verify code name");
assertNull("Verify system defined is false", deletedCodeValues.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME)); assertNull(deletedCodeValues.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME), "Verify system defined is false");
} }
// @Ignore() // @Ignore()
@@ -113,33 +113,33 @@ public class SystemCodeTest {
// verify code created // verify code created
final HashMap newCodeAttributes = (HashMap) CodeHelper.getCodeById(this.requestSpec, this.responseSpec, createResponseId, ""); final HashMap newCodeAttributes = (HashMap) CodeHelper.getCodeById(this.requestSpec, this.responseSpec, createResponseId, "");
Assert.assertNotNull(newCodeAttributes); Assertions.assertNotNull(newCodeAttributes);
assertEquals("Verify value of codeId", createResponseId, newCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME)); 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(codeName, newCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME), "Verify code name");
assertEquals("Verify system defined is false", false, newCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME)); assertEquals(false, newCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_NAME), "Verify system defined is false");
// try to create duplicate-- should fail // try to create duplicate-- should fail
final List<HashMap> error = (List) CodeHelper.createCode(this.requestSpec, this.generalResponseSpec, codeName, final List<HashMap> error = (List) CodeHelper.createCode(this.requestSpec, this.generalResponseSpec, codeName,
CommonConstants.RESPONSE_ERROR); 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 // delete code that was just created
final Integer deleteResponseId = (Integer) CodeHelper.deleteCodeById(this.requestSpec, this.responseSpec, createResponseId, final Integer deleteResponseId = (Integer) CodeHelper.deleteCodeById(this.requestSpec, this.responseSpec, createResponseId,
CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME); CodeHelper.RESPONSE_ID_ATTRIBUTE_NAME);
assertEquals("Verify code deleted", createResponseId, deleteResponseId); assertEquals(createResponseId, deleteResponseId, "Verify code deleted");
// verify code deleted // verify code deleted
final HashMap deletedCodeAttributes = (HashMap) CodeHelper.getCodeById(this.requestSpec, this.generalResponseSpec, final HashMap deletedCodeAttributes = (HashMap) CodeHelper.getCodeById(this.requestSpec, this.generalResponseSpec,
deleteResponseId, ""); deleteResponseId, "");
Assert.assertNotNull(deletedCodeAttributes); Assertions.assertNotNull(deletedCodeAttributes);
assertNull("Verify value of codeId", deletedCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME)); assertNull(deletedCodeAttributes.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME), "Verify value of codeId");
assertNull("Verify code name", deletedCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME)); assertNull(deletedCodeAttributes.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME), "Verify code name");
assertNull("Verify system defined is false", deletedCodeAttributes.get(CodeHelper.CODE_SYSTEM_DEFINED_ATTRIBUTE_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, final List<HashMap> error = (List) CodeHelper.deleteCodeById(this.requestSpec, this.generalResponseSpec,
(Integer) systemDefinedCode.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME), CommonConstants.RESPONSE_ERROR); (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 // update system-defined code should fail
@@ -162,8 +162,8 @@ public class SystemCodeTest {
(Integer) systemDefinedCode.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME), (Integer) systemDefinedCode.get(CodeHelper.CODE_ID_ATTRIBUTE_NAME),
systemDefinedCode.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME) + "CHANGE", CommonConstants.RESPONSE_ERROR); systemDefinedCode.get(CodeHelper.CODE_NAME_ATTRIBUTE_NAME) + "CHANGE", CommonConstants.RESPONSE_ERROR);
assertEquals("Cannot update system-defined code", "error.msg.code.systemdefined", assertEquals("error.msg.code.systemdefined", updateError.get(0).get("userMessageGlobalisationCode"),
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, final List<HashMap> codeValuesList = (List) CodeHelper.getCodeValuesForCode(this.requestSpec, this.responseSpec,
createCodeResponseId, ""); 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 // verify values of first code value
final HashMap codeValuesAttributes1 = (HashMap) CodeHelper.getCodeValueById(this.requestSpec, this.responseSpec, final HashMap codeValuesAttributes1 = (HashMap) CodeHelper.getCodeValueById(this.requestSpec, this.responseSpec,
createCodeResponseId, createCodeValueResponseId1, ""); createCodeResponseId, createCodeValueResponseId1, "");
Assert.assertNotNull(codeValuesAttributes1); Assertions.assertNotNull(codeValuesAttributes1);
assertEquals("Verify value of codeValueId", createCodeValueResponseId1, assertEquals(createCodeValueResponseId1,
codeValuesAttributes1.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME)); 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, assertEquals(codeDescription1, codeValuesAttributes1.get(CodeHelper.CODE_VALUE_DESCRIPTION_ATTRIBUTE_NAME),
codeValuesAttributes1.get(CodeHelper.CODE_VALUE_DESCRIPTION_ATTRIBUTE_NAME)); "Verify value of code description");
assertEquals("Verify position of code value", codeValue1Position, assertEquals(codeValue1Position, codeValuesAttributes1.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME),
codeValuesAttributes1.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME)); "Verify position of code value");
// verify values of second code value // verify values of second code value
final HashMap codeValuesAttributes2 = (HashMap) CodeHelper.getCodeValueById(this.requestSpec, this.responseSpec, final HashMap codeValuesAttributes2 = (HashMap) CodeHelper.getCodeValueById(this.requestSpec, this.responseSpec,
createCodeResponseId, createCodeValueResponseId2, ""); createCodeResponseId, createCodeValueResponseId2, "");
Assert.assertNotNull(codeValuesAttributes2); Assertions.assertNotNull(codeValuesAttributes2);
assertEquals("Verify value of codeValueId", createCodeValueResponseId2, assertEquals(createCodeValueResponseId2, codeValuesAttributes2.get(CodeHelper.CODE_VALUE_ID_ATTRIBUTE_NAME),
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, assertEquals(codeDescription2, codeValuesAttributes2.get(CodeHelper.CODE_VALUE_DESCRIPTION_ATTRIBUTE_NAME),
codeValuesAttributes2.get(CodeHelper.CODE_VALUE_DESCRIPTION_ATTRIBUTE_NAME)); "Verify value of code description");
assertEquals("Verify position of code value", codeValue2Position, assertEquals(codeValue2Position, codeValuesAttributes2.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME),
codeValuesAttributes2.get(CodeHelper.CODE_VALUE_POSITION_ATTRIBUTE_NAME)); "Verify position of code value");
// update code value 1 // update code value 1
final HashMap codeValueChanges = (HashMap) CodeHelper.updateCodeValue(this.requestSpec, this.responseSpec, createCodeResponseId, final HashMap codeValueChanges = (HashMap) CodeHelper.updateCodeValue(this.requestSpec, this.responseSpec, createCodeResponseId,
createCodeValueResponseId1, codeValue1 + "CHANGE", codeDescription1 + "CHANGE", 4, "changes"); 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 // delete code value
Integer deletedCodeValueResponseId1 = (Integer) CodeHelper.deleteCodeValueById(this.requestSpec, this.generalResponseSpec, 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, final List<HashMap> deletedCodeValuesList = (List) CodeHelper.getCodeValuesForCode(this.requestSpec, this.responseSpec,
createCodeResponseId, ""); 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, final Integer deletedCodeValueResponseId2 = (Integer) CodeHelper.deleteCodeValueById(this.requestSpec, this.generalResponseSpec,
createCodeResponseId, createCodeValueResponseId2, CodeHelper.SUBRESPONSE_ID_ATTRIBUTE_NAME); createCodeResponseId, createCodeValueResponseId2, CodeHelper.SUBRESPONSE_ID_ATTRIBUTE_NAME);
@@ -263,16 +264,16 @@ public class SystemCodeTest {
final ArrayList<HashMap> deletedCodeValueAttributes2 = (ArrayList<HashMap>) CodeHelper.getCodeValueById(this.requestSpec, final ArrayList<HashMap> deletedCodeValueAttributes2 = (ArrayList<HashMap>) CodeHelper.getCodeValueById(this.requestSpec,
this.generalResponseSpec, createCodeResponseId, deletedCodeValueResponseId2, CommonConstants.RESPONSE_ERROR); 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, final List<HashMap> deletedCodeValuesList1 = (List) CodeHelper.getCodeValuesForCode(this.requestSpec, this.responseSpec,
createCodeResponseId, ""); createCodeResponseId, "");
assertEquals("Number of code values is 0", 0, deletedCodeValuesList1.size()); assertEquals(0, deletedCodeValuesList1.size(), "Number of code values is 0");
} }
@Ignore @Disabled
@Test @Test
public void testCodeValuesAssignedToTable() { public void testCodeValuesAssignedToTable() {
@@ -27,10 +27,10 @@ import io.restassured.specification.ResponseSpecification;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Ignore; import org.junit.jupiter.api.Disabled;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class TemplateIntegrationTest { public class TemplateIntegrationTest {
@@ -41,7 +41,7 @@ public class TemplateIntegrationTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
@@ -50,7 +50,7 @@ public class TemplateIntegrationTest {
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
} }
@Ignore @Disabled
@Test @Test
public void 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); 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, ""); Utils.performServerDelete(this.requestSpec, this.responseSpec, templateUrlForId, "");
get = Utils.performServerGet(this.requestSpec, this.responseSpec, this.GET_TEMPLATES_URL, ""); get = Utils.performServerGet(this.requestSpec, this.responseSpec, this.GET_TEMPLATES_URL, "");
final int entriesAfterTest = get.size(); 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.common.organisation.StaffHelper;
import org.apache.fineract.integrationtests.useradministration.roles.RolesHelper; import org.apache.fineract.integrationtests.useradministration.roles.RolesHelper;
import org.apache.fineract.integrationtests.useradministration.users.UserHelper; import org.apache.fineract.integrationtests.useradministration.users.UserHelper;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -49,7 +49,7 @@ public class UserAdministrationTest {
return new ResponseSpecBuilder().expectStatusCode(code).build(); return new ResponseSpecBuilder().expectStatusCode(code).build();
} }
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -57,7 +57,7 @@ public class UserAdministrationTest {
this.responseSpec = expectStatusCode(200); this.responseSpec = expectStatusCode(200);
} }
@After @AfterEach
public void tearDown() { public void tearDown() {
for(Integer userId : this.transientUsers) { for(Integer userId : this.transientUsers) {
UserHelper.deleteUser(this.requestSpec, this.responseSpec, userId); UserHelper.deleteUser(this.requestSpec, this.responseSpec, userId);
@@ -69,81 +69,81 @@ public class UserAdministrationTest {
public void testCreateNewUserBlocksDuplicateUsername() { public void testCreateNewUserBlocksDuplicateUsername() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId); Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); 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"); final Integer userId = (Integer) UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId, "alphabet", "resourceId");
Assert.assertNotNull(userId); Assertions.assertNotNull(userId);
this.transientUsers.add(userId); this.transientUsers.add(userId);
final List errors = (List) UserHelper.createUser(this.requestSpec, expectStatusCode(403), roleId, staffId, "alphabet", "errors"); final List errors = (List) UserHelper.createUser(this.requestSpec, expectStatusCode(403), roleId, staffId, "alphabet", "errors");
Map reason = (Map) errors.get(0); Map reason = (Map) errors.get(0);
LOG.info("Reason: {}" , reason.get("defaultUserMessage")); LOG.info("Reason: {}" , reason.get("defaultUserMessage"));
LOG.info("Code: {}" , reason.get("userMessageGlobalisationCode")); LOG.info("Code: {}" , reason.get("userMessageGlobalisationCode"));
Assert.assertEquals("User with username alphabet already exists.", reason.get("defaultUserMessage")); Assertions.assertEquals("User with username alphabet already exists.", reason.get("defaultUserMessage"));
Assert.assertEquals("error.msg.user.duplicate.username", reason.get("userMessageGlobalisationCode")); Assertions.assertEquals("error.msg.user.duplicate.username", reason.get("userMessageGlobalisationCode"));
} }
@Test @Test
public void testUpdateUserAcceptsNewOrSameUsername() { public void testUpdateUserAcceptsNewOrSameUsername() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId); Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); 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"); final Integer userId = (Integer) UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId, "alphabet", "resourceId");
Assert.assertNotNull(userId); Assertions.assertNotNull(userId);
this.transientUsers.add(userId); this.transientUsers.add(userId);
final Integer userId2 = (Integer) UserHelper.updateUser(this.requestSpec, this.responseSpec, userId, "renegade", "resourceId"); 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"); final Integer userId3 = (Integer) UserHelper.updateUser(this.requestSpec, this.responseSpec, userId, "renegade", "resourceId");
Assert.assertNotNull(userId3); Assertions.assertNotNull(userId3);
} }
@Test @Test
public void testUpdateUserBlockDuplicateUsername() { public void testUpdateUserBlockDuplicateUsername() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId); Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); 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"); final Integer userId = (Integer) UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId, "alphabet", "resourceId");
Assert.assertNotNull(userId); Assertions.assertNotNull(userId);
this.transientUsers.add(userId); this.transientUsers.add(userId);
final Integer userId2 = (Integer) UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId, "bilingual", "resourceId"); final Integer userId2 = (Integer) UserHelper.createUser(this.requestSpec, this.responseSpec, roleId, staffId, "bilingual", "resourceId");
Assert.assertNotNull(userId2); Assertions.assertNotNull(userId2);
this.transientUsers.add(userId2); this.transientUsers.add(userId2);
final List errors = (List) UserHelper.updateUser(this.requestSpec, expectStatusCode(403), userId2, "alphabet", "errors"); final List errors = (List) UserHelper.updateUser(this.requestSpec, expectStatusCode(403), userId2, "alphabet", "errors");
Map reason = (Map) errors.get(0); Map reason = (Map) errors.get(0);
Assert.assertEquals("User with username alphabet already exists.", reason.get("defaultUserMessage")); Assertions.assertEquals("User with username alphabet already exists.", reason.get("defaultUserMessage"));
Assert.assertEquals("error.msg.user.duplicate.username", reason.get("userMessageGlobalisationCode")); Assertions.assertEquals("error.msg.user.duplicate.username", reason.get("userMessageGlobalisationCode"));
} }
@Test @Test
public void testCreateNewUserBlocksDuplicateClientId() { public void testCreateNewUserBlocksDuplicateClientId() {
final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec);
Assert.assertNotNull(roleId); Assertions.assertNotNull(roleId);
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
Assert.assertNotNull(staffId); Assertions.assertNotNull(staffId);
final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); 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"); final Integer userId = (Integer) UserHelper.createUserForSelfService(this.requestSpec, this.responseSpec, roleId, staffId, clientId, "resourceId");
Assert.assertNotNull(userId); Assertions.assertNotNull(userId);
this.transientUsers.add(userId); this.transientUsers.add(userId);
final List errors = (List) UserHelper.createUserForSelfService(this.requestSpec, expectStatusCode(403), roleId, staffId, clientId, "errors"); final List errors = (List) UserHelper.createUserForSelfService(this.requestSpec, expectStatusCode(403), roleId, staffId, clientId, "errors");
Map reason = (Map) errors.get(0); 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; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.WorkingDaysHelper; import org.apache.fineract.integrationtests.common.WorkingDaysHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
@SuppressWarnings({ "rawtypes", "unchecked" }) @SuppressWarnings({ "rawtypes", "unchecked" })
public class WorkingDaysTest { public class WorkingDaysTest {
@@ -41,7 +41,7 @@ public class WorkingDaysTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private ResponseSpecification generalResponseSpec; private ResponseSpecification generalResponseSpec;
@Before @BeforeEach
public void setUp() { public void setUp() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -54,15 +54,15 @@ public class WorkingDaysTest {
@Test @Test
public void updateWorkingDays() { public void updateWorkingDays() {
HashMap response = (HashMap) WorkingDaysHelper.updateWorkingDays(requestSpec, responseSpec); HashMap response = (HashMap) WorkingDaysHelper.updateWorkingDays(requestSpec, responseSpec);
Assert.assertNotNull(response.get("resourceId")); Assertions.assertNotNull(response.get("resourceId"));
} }
@Test @Test
public void updateWorkingDaysWithWrongRecurrencePattern() { public void updateWorkingDaysWithWrongRecurrencePattern() {
final List<HashMap> error = (List) WorkingDaysHelper.updateWorkingDaysWithWrongRecurrence(requestSpec, generalResponseSpec, final List<HashMap> error = (List) WorkingDaysHelper.updateWorkingDaysWithWrongRecurrence(requestSpec, generalResponseSpec,
CommonConstants.RESPONSE_ERROR); CommonConstants.RESPONSE_ERROR);
assertEquals("Verify wrong recurrence pattern error", "error.msg.recurring.rule.parsing.error", assertEquals("error.msg.recurring.rule.parsing.error", error.get(0).get("userMessageGlobalisationCode"),
error.get(0).get("userMessageGlobalisationCode")); "Verify wrong recurrence pattern error");
} }
} }
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; import io.restassured.builder.ResponseSpecBuilder;
@@ -29,8 +29,8 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.xbrl.XBRLIntegrationTestHelper; import org.apache.fineract.integrationtests.common.xbrl.XBRLIntegrationTestHelper;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -42,7 +42,7 @@ public class XBRLIntegrationTest {
private XBRLIntegrationTestHelper xbrlHelper; private XBRLIntegrationTestHelper xbrlHelper;
@Before @BeforeEach
public void setUp() throws Exception { public void setUp() throws Exception {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -60,7 +60,7 @@ public class XBRLIntegrationTest {
private void verifyTaxonomyList(final ArrayList<HashMap> taxonomyList) { private void verifyTaxonomyList(final ArrayList<HashMap> taxonomyList) {
LOG.info("--------------------VERIFYING TAXONOMY LIST--------------------------"); 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.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -57,7 +57,7 @@ public class ClientEntityImportHandlerTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -71,12 +71,12 @@ public class ClientEntityImportHandlerTest {
//in order to populate helper sheets //in order to populate helper sheets
requestSpec.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); requestSpec.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
Integer outcome_staff_creation = StaffHelper.createStaff(requestSpec,responseSpec); 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 //in order to populate helper sheets
OfficeHelper officeHelper = new OfficeHelper(requestSpec,responseSpec); OfficeHelper officeHelper = new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000"); 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 //in order to populate helper columns in client entity sheet
//create constitution //create constitution
@@ -131,7 +131,7 @@ public class ClientEntityImportHandlerTest {
String importDocumentId=clientHelper.importClientEntityTemplate(file); String importDocumentId=clientHelper.importClientEntityTemplate(file);
file.delete(); file.delete();
Assert.assertNotNull(importDocumentId); Assertions.assertNotNull(importDocumentId);
//Wait for the creation of output excel //Wait for the creation of output excel
Thread.sleep(10000); Thread.sleep(10000);
@@ -146,7 +146,7 @@ public class ClientEntityImportHandlerTest {
LOG.info("Output location: {}", location); LOG.info("Output location: {}", location);
LOG.info("Failure reason column: {}", row.getCell(ClientEntityConstants.STATUS_COL).getStringCellValue()); 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(); 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.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -68,7 +68,7 @@ public class LoanImportHandlerTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -83,10 +83,10 @@ public class LoanImportHandlerTest {
//in order to populate helper sheets //in order to populate helper sheets
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec); OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000"); 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); 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 firstName = Utils.randomNameGenerator("Client_FirstName_", 5);
String lastName = Utils.randomNameGenerator("Client_LastName_", 4); 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, Integer outcome_client_creation= Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL,
new Gson().toJson(clientMap), "clientId"); 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 //in order to populate helper sheets
Integer outcome_group_creation = GroupHelper.createGroup(requestSpec,responseSpec,true); 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 //in order to populate helper sheets
Integer outcome_staff_creation = StaffHelper.createStaff(requestSpec,responseSpec); 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); 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); LoanTransactionHelper ltHelper=new LoanTransactionHelper(requestSpec,responseSpec);
LoanProductTestBuilder loanProductTestBuilder=new LoanProductTestBuilder(); LoanProductTestBuilder loanProductTestBuilder=new LoanProductTestBuilder();
String jsonLoanProduct=loanProductTestBuilder.build(null); String jsonLoanProduct=loanProductTestBuilder.build(null);
Integer outcome_lp_creation=ltHelper.getLoanProductId(jsonLoanProduct); 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); 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); JsonPath loanProductJson = JsonPath.from(loanProductStr);
String fundName = Utils.randomNameGenerator("",9); String fundName = Utils.randomNameGenerator("",9);
FundsHelper fh = FundsHelper.create(fundName).externalId("fund-" + fundName).build(); FundsHelper fh = FundsHelper.create(fundName).externalId("fund-" + fundName).build();
Integer outcome_fund_creation= FundsResourceHandler.createFund(new Gson().toJson(fh),requestSpec,responseSpec); 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 paymentTypeName = PaymentTypeHelper.randomNameGenerator("P_T", 5);
String paymentTypeDescription = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15); String paymentTypeDescription = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15);
Integer outcome_payment_creation= PaymentTypeHelper.createPaymentType(requestSpec, responseSpec, paymentTypeName, paymentTypeDescription, true,1); 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); LoanTransactionHelper loanTransactionHelper=new LoanTransactionHelper(requestSpec,responseSpec);
Workbook workbook=loanTransactionHelper.getLoanWorkbook("dd MMMM yyyy"); Workbook workbook=loanTransactionHelper.getLoanWorkbook("dd MMMM yyyy");
@@ -190,7 +190,7 @@ public class LoanImportHandlerTest {
String importDocumentId=loanTransactionHelper.importLoanTemplate(file); String importDocumentId=loanTransactionHelper.importLoanTemplate(file);
file.delete(); file.delete();
Assert.assertNotNull(importDocumentId); Assertions.assertNotNull(importDocumentId);
//Wait for the creation of output excel //Wait for the creation of output excel
Thread.sleep(10000); Thread.sleep(10000);
@@ -205,7 +205,7 @@ public class LoanImportHandlerTest {
LOG.info("Output location: {}", location); LOG.info("Output location: {}", location);
LOG.info("Failure reason column: {}", row.getCell(LoanConstants.FAILURE_REPORT_COL).getStringCellValue()); 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(); 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.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -51,7 +51,7 @@ public class OfficeImportHandlerTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup(){ public void setup(){
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec=new RequestSpecBuilder().build(); this.requestSpec=new RequestSpecBuilder().build();
@@ -91,7 +91,7 @@ public class OfficeImportHandlerTest {
String importDocumentId=officeHelper.importOfficeTemplate(file); String importDocumentId=officeHelper.importOfficeTemplate(file);
file.delete(); file.delete();
Assert.assertNotNull(importDocumentId); Assertions.assertNotNull(importDocumentId);
// Wait for the creation of output excel // Wait for the creation of output excel
Thread.sleep(10000); Thread.sleep(10000);
@@ -106,7 +106,7 @@ public class OfficeImportHandlerTest {
LOG.info("Output location: {}", location); LOG.info("Output location: {}", location);
LOG.info("Failure reason column: {}", row.getCell(OfficeConstants.STATUS_COL).getStringCellValue()); 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(); 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.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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; private static final String CREATE_CLIENT_URL = "/fineract-provider/api/v1/clients?" + Utils.TENANT_IDENTIFIER;
public static final String DATE_FORMAT = "dd MMMM yyyy"; public static final String DATE_FORMAT = "dd MMMM yyyy";
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -80,10 +80,10 @@ public class SavingsImportHandlerTest {
//in order to populate helper sheets //in order to populate helper sheets
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec); OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000"); 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); 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 firstName = Utils.randomNameGenerator("Client_FirstName_", 5);
String lastName = Utils.randomNameGenerator("Client_LastName_", 4); 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, Integer outcome_client_creation= Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL,
new Gson().toJson(clientMap), "clientId"); 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 //in order to populate helper sheets
Integer outcome_group_creation=GroupHelper.createGroup(requestSpec,responseSpec,true); 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 //in order to populate helper sheets
Integer outcome_staff_creation =StaffHelper.createStaff(requestSpec,responseSpec); 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); 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(); SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
String jsonSavingsProduct=savingsProductHelper.build(); String jsonSavingsProduct=savingsProductHelper.build();
Integer outcome_sp_creaction=SavingsProductHelper.createSavingsProduct(jsonSavingsProduct,requestSpec,responseSpec); 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); SavingsAccountHelper savingsAccountHelper=new SavingsAccountHelper(requestSpec,responseSpec);
Workbook workbook=savingsAccountHelper.getSavingsWorkbook("dd MMMM yyyy"); Workbook workbook=savingsAccountHelper.getSavingsWorkbook("dd MMMM yyyy");
@@ -164,7 +164,7 @@ public class SavingsImportHandlerTest {
String importDocumentId=savingsAccountHelper.importSavingsTemplate(file); String importDocumentId=savingsAccountHelper.importSavingsTemplate(file);
file.delete(); file.delete();
Assert.assertNotNull(importDocumentId); Assertions.assertNotNull(importDocumentId);
//Wait for the creation of output excel //Wait for the creation of output excel
Thread.sleep(10000); Thread.sleep(10000);
@@ -179,7 +179,7 @@ public class SavingsImportHandlerTest {
LOG.info("Output location: {}", location); LOG.info("Output location: {}", location);
LOG.info("Failure reason column: {}", row.getCell(SavingsConstants.STATUS_COL).getStringCellValue()); 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(); 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.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class ClientEntityWorkbookPopulatorTest { public class ClientEntityWorkbookPopulatorTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup(){ public void setup(){
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec=new RequestSpecBuilder().build(); this.requestSpec=new RequestSpecBuilder().build();
@@ -63,20 +63,20 @@ public class ClientEntityWorkbookPopulatorTest {
StaffHelper staffHelper=new StaffHelper(); StaffHelper staffHelper=new StaffHelper();
requestSpec.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); requestSpec.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
Integer outcome_staff_creation =staffHelper.createStaff(requestSpec,responseSpec); 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 //in order to populate helper sheets
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec); OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000"); 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); ClientHelper clientHelper=new ClientHelper(requestSpec,responseSpec);
Workbook workbook=clientHelper.getClientEntityWorkbook(GlobalEntityType.CLIENTS_ENTTTY,"dd MMMM yyyy"); Workbook workbook=clientHelper.getClientEntityWorkbook(GlobalEntityType.CLIENTS_ENTTTY,"dd MMMM yyyy");
Sheet officeSheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME); Sheet officeSheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
Row firstOfficeRow=officeSheet.getRow(1); 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); Sheet staffSheet=workbook.getSheet(TemplatePopulateImportConstants.STAFF_SHEET_NAME);
Row firstStaffRow=staffSheet.getRow(1); 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.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class LoanWorkbookPopulatorTest { public class LoanWorkbookPopulatorTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup(){ public void setup(){
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -61,35 +61,35 @@ public class LoanWorkbookPopulatorTest {
//in order to populate helper sheets //in order to populate helper sheets
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec); OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000"); 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 //in order to populate helper sheets
ClientHelper clientHelper=new ClientHelper(requestSpec,responseSpec); ClientHelper clientHelper=new ClientHelper(requestSpec,responseSpec);
Integer outcome_client_creation=clientHelper.createClient(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 //in order to populate helper sheets
GroupHelper groupHelper=new GroupHelper(requestSpec,responseSpec); GroupHelper groupHelper=new GroupHelper(requestSpec,responseSpec);
Integer outcome_group_creation=groupHelper.createGroup(requestSpec,responseSpec,true); 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 //in order to populate helper sheets
StaffHelper staffHelper=new StaffHelper(); StaffHelper staffHelper=new StaffHelper();
Integer outcome_staff_creation =staffHelper.createStaff(requestSpec,responseSpec); 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); LoanTransactionHelper loanTransactionHelper=new LoanTransactionHelper(requestSpec,responseSpec);
LoanProductTestBuilder loanProductTestBuilder=new LoanProductTestBuilder(); LoanProductTestBuilder loanProductTestBuilder=new LoanProductTestBuilder();
String jsonLoanProduct=loanProductTestBuilder.build(null); String jsonLoanProduct=loanProductTestBuilder.build(null);
Integer outcome_lp_creaion=loanTransactionHelper.getLoanProductId(jsonLoanProduct); 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(); FundsResourceHandler fundsResourceHandler=new FundsResourceHandler();
String jsonFund="{\n" + String jsonFund="{\n" +
"\t\"name\": \""+Utils.randomNameGenerator("Fund_Name",9)+"\"\n" + "\t\"name\": \""+Utils.randomNameGenerator("Fund_Name",9)+"\"\n" +
"}"; "}";
Integer outcome_fund_creation=fundsResourceHandler.createFund(jsonFund,requestSpec,responseSpec); 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(); PaymentTypeHelper paymentTypeHelper=new PaymentTypeHelper();
String name = PaymentTypeHelper.randomNameGenerator("P_T", 5); String name = PaymentTypeHelper.randomNameGenerator("P_T", 5);
@@ -97,32 +97,32 @@ public class LoanWorkbookPopulatorTest {
Boolean isCashPayment = true; Boolean isCashPayment = true;
Integer position = 1; Integer position = 1;
Integer outcome_payment_creation= paymentTypeHelper.createPaymentType(requestSpec, responseSpec,name,description,isCashPayment,position); 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"); Workbook workbook=loanTransactionHelper.getLoanWorkbook("dd MMMM yyyy");
Sheet officeSheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME); Sheet officeSheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
Row firstOfficeRow=officeSheet.getRow(1); 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); Sheet clientSheet=workbook.getSheet(TemplatePopulateImportConstants.CLIENT_SHEET_NAME);
Row firstClientRow=clientSheet.getRow(1); 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); Sheet groupSheet=workbook.getSheet(TemplatePopulateImportConstants.GROUP_SHEET_NAME);
Row firstGroupRow=groupSheet.getRow(1); 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); Sheet staffSheet=workbook.getSheet(TemplatePopulateImportConstants.STAFF_SHEET_NAME);
Row firstStaffRow=staffSheet.getRow(1); 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); Sheet productSheet=workbook.getSheet(TemplatePopulateImportConstants.PRODUCT_SHEET_NAME);
Row firstProductRow=productSheet.getRow(1); 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); Sheet extrasSheet=workbook.getSheet(TemplatePopulateImportConstants.EXTRAS_SHEET_NAME);
Row firstExtrasRow=extrasSheet.getRow(1); 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.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class OfficeWorkBookPopulatorTest { public class OfficeWorkBookPopulatorTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup(){ public void setup(){
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec=new RequestSpecBuilder().build(); this.requestSpec=new RequestSpecBuilder().build();
@@ -56,8 +56,8 @@ public class OfficeWorkBookPopulatorTest {
Workbook workbook=officeHelper.getOfficeWorkBook("dd MMMM yyyy"); Workbook workbook=officeHelper.getOfficeWorkBook("dd MMMM yyyy");
Sheet sheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME); Sheet sheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
Row firstRow= sheet.getRow(1); Row firstRow= sheet.getRow(1);
Assert.assertNotNull("No parent offices found",firstRow.getCell(OfficeConstants.LOOKUP_OFFICE_COL).getStringCellValue()); Assertions.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.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.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class SavingsWorkbookPopulateTest { public class SavingsWorkbookPopulateTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup(){ public void setup(){
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -59,50 +59,50 @@ public class SavingsWorkbookPopulateTest {
//in order to populate helper sheets //in order to populate helper sheets
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec); OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Integer outcome_office_creation=officeHelper.createOffice("02 May 2000"); 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 //in order to populate helper sheets
ClientHelper clientHelper=new ClientHelper(requestSpec,responseSpec); ClientHelper clientHelper=new ClientHelper(requestSpec,responseSpec);
Integer outcome_client_creation=clientHelper.createClient(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 //in order to populate helper sheets
GroupHelper groupHelper=new GroupHelper(requestSpec,responseSpec); GroupHelper groupHelper=new GroupHelper(requestSpec,responseSpec);
Integer outcome_group_creation=groupHelper.createGroup(requestSpec,responseSpec,true); 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 //in order to populate helper sheets
StaffHelper staffHelper=new StaffHelper(); StaffHelper staffHelper=new StaffHelper();
Integer outcome_staff_creation =staffHelper.createStaff(requestSpec,responseSpec); 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(); SavingsProductHelper savingsProductHelper=new SavingsProductHelper();
String jsonSavingsProduct=savingsProductHelper.build(); String jsonSavingsProduct=savingsProductHelper.build();
Integer outcome_sp_creaction=savingsProductHelper.createSavingsProduct(jsonSavingsProduct,requestSpec,responseSpec); 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); SavingsAccountHelper savingsAccountHelper=new SavingsAccountHelper(requestSpec,responseSpec);
Workbook workbook=savingsAccountHelper.getSavingsWorkbook("dd MMMM yyyy"); Workbook workbook=savingsAccountHelper.getSavingsWorkbook("dd MMMM yyyy");
Sheet officeSheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME); Sheet officeSheet=workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
Row firstOfficeRow=officeSheet.getRow(1); 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); Sheet clientSheet=workbook.getSheet(TemplatePopulateImportConstants.CLIENT_SHEET_NAME);
Row firstClientRow=clientSheet.getRow(1); 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); Sheet groupSheet=workbook.getSheet(TemplatePopulateImportConstants.GROUP_SHEET_NAME);
Row firstGroupRow=groupSheet.getRow(1); 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); Sheet staffSheet=workbook.getSheet(TemplatePopulateImportConstants.STAFF_SHEET_NAME);
Row firstStaffRow=staffSheet.getRow(1); 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); Sheet productSheet=workbook.getSheet(TemplatePopulateImportConstants.PRODUCT_SHEET_NAME);
Row firstProductRow=productSheet.getRow(1); 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 java.util.Map;
import org.apache.fineract.batch.domain.BatchRequest; import org.apache.fineract.batch.domain.BatchRequest;
import org.apache.fineract.batch.domain.BatchResponse; import org.apache.fineract.batch.domain.BatchResponse;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -129,8 +129,8 @@ public class BatchHelper {
jsonifiedRequest); jsonifiedRequest);
// Verifies that the response result is there // Verifies that the response result is there
Assert.assertNotNull(response); Assertions.assertNotNull(response);
Assert.assertTrue(response.size() > 0); Assertions.assertTrue(response.size() > 0);
return response; return response;
} }
@@ -427,6 +427,6 @@ public class BatchHelper {
LOG.info("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); LOG.info("------------------------------CHECK CLIENT DETAILS------------------------------------\n");
final String CLIENT_URL = "/fineract-provider/api/v1/clients?externalId=" + externalId + "&" + Utils.TENANT_IDENTIFIER; final String CLIENT_URL = "/fineract-provider/api/v1/clients?externalId=" + externalId + "&" + Utils.TENANT_IDENTIFIER;
final Integer responseRecords = Utils.performServerGet(requestSpec, responseSpec, CLIENT_URL, "totalFilteredRecords"); 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; package org.apache.fineract.integrationtests.common;
import static io.restassured.path.json.JsonPath.from; 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.Gson;
import io.restassured.specification.RequestSpecification; import io.restassured.specification.RequestSpecification;
@@ -87,7 +87,7 @@ public class CalendarHelper {
final String responseCalendarDetailsinJSON = Utils.performServerGet(requestSpec, responseSpec, CLIENT_URL, final String responseCalendarDetailsinJSON = Utils.performServerGet(requestSpec, responseSpec, CLIENT_URL,
"collectionMeetingCalendar"); "collectionMeetingCalendar");
final Integer responseCalendarId = from(responseCalendarDetailsinJSON).get("id"); 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, public static Integer createMeetingForGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests.common; 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.base.Strings;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
@@ -169,7 +169,7 @@ public class CenterHelper {
LOG.info("------------------------------CHECK CENTER DETAILS------------------------------------\n"); LOG.info("------------------------------CHECK CENTER DETAILS------------------------------------\n");
final String CENTER_URL = "/fineract-provider/api/v1/centers/" + generatedCenterID + "?" + Utils.TENANT_IDENTIFIER; final String CENTER_URL = "/fineract-provider/api/v1/centers/" + generatedCenterID + "?" + Utils.TENANT_IDENTIFIER;
final Integer responseCenterID = Utils.performServerGet(requestSpec, responseSpec, CENTER_URL, "id"); 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, public static void verifyCenterActivatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -177,7 +177,7 @@ public class CenterHelper {
LOG.info("------------------------------CHECK CENTER STATUS------------------------------------\n"); LOG.info("------------------------------CHECK CENTER STATUS------------------------------------\n");
final String CENTER_URL = "/fineract-provider/api/v1/centers/" + generatedCenterID + "?" + Utils.TENANT_IDENTIFIER; final String CENTER_URL = "/fineract-provider/api/v1/centers/" + generatedCenterID + "?" + Utils.TENANT_IDENTIFIER;
final Boolean responseCenterStatus = Utils.performServerGet(requestSpec, responseSpec, CENTER_URL, "active"); 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, public static Integer activateCenter(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -27,9 +27,9 @@ import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import org.apache.fineract.integrationtests.common.charges.ChargesHelper; import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* *
@@ -45,7 +45,7 @@ public class ClientChargesTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -59,11 +59,11 @@ public class ClientChargesTest {
// Creates clientCharge // Creates clientCharge
final Integer chargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, final Integer chargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getChargeSpecifiedDueDateJSON()); ChargesHelper.getChargeSpecifiedDueDateJSON());
Assert.assertNotNull(chargeId); Assertions.assertNotNull(chargeId);
// creates client with activation date // creates client with activation date
final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 October 2011"); 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 * 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, final Integer loanChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON()); ChargesHelper.getLoanSpecifiedDueDateJSON());
Assert.assertNotNull(loanChargeId); Assertions.assertNotNull(loanChargeId);
ResponseSpecification responseLoanChargeFailure = new ResponseSpecBuilder().expectStatusCode(403).build(); ResponseSpecification responseLoanChargeFailure = new ResponseSpecBuilder().expectStatusCode(403).build();
final Integer clientLoanChargeId = ClientHelper.addChargesForClient(this.requestSpec, responseLoanChargeFailure, clientId, final Integer clientLoanChargeId = ClientHelper.addChargesForClient(this.requestSpec, responseLoanChargeFailure, clientId,
ClientHelper.getSpecifiedDueDateChargesClientAsJSON(loanChargeId.toString(), "29 October 2011")); 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 * 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, final Integer clientChargeId = ClientHelper.addChargesForClient(this.requestSpec, this.responseSpec, clientId,
ClientHelper.getSpecifiedDueDateChargesClientAsJSON(chargeId.toString(), "29 October 2011")); ClientHelper.getSpecifiedDueDateChargesClientAsJSON(chargeId.toString(), "29 October 2011"));
Assert.assertNotNull(clientChargeId); Assertions.assertNotNull(clientChargeId);
final String clientChargePaidTransactionId = ClientHelper.payChargesForClients(this.requestSpec, this.responseSpec, clientId, final String clientChargePaidTransactionId = ClientHelper.payChargesForClients(this.requestSpec, this.responseSpec, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "10")); clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "10"));
Assert.assertNotNull(clientChargePaidTransactionId); Assertions.assertNotNull(clientChargePaidTransactionId);
isValidOutstandingAmount(ClientHelper.getClientCharge(requestSpec, responseSpec, clientId.toString(), clientChargeId.toString()), isValidOutstandingAmount(ClientHelper.getClientCharge(requestSpec, responseSpec, clientId.toString(), clientChargeId.toString()),
(float) 190.0); (float) 190.0);
@@ -98,7 +98,7 @@ public class ClientChargesTest {
*/ */
final Integer undoTrxnId = ClientHelper.revertClientChargeTransaction(this.requestSpec, this.responseSpec, final Integer undoTrxnId = ClientHelper.revertClientChargeTransaction(this.requestSpec, this.responseSpec,
clientId.toString(), clientChargePaidTransactionId); clientId.toString(), clientChargePaidTransactionId);
Assert.assertNotNull(undoTrxnId); Assertions.assertNotNull(undoTrxnId);
isReversedTransaction(clientId.toString(), undoTrxnId.toString()); isReversedTransaction(clientId.toString(), undoTrxnId.toString());
/** /**
* Now pay client charge for 20 USD and ensure the outstanding amount is * 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); today.add(Calendar.DAY_OF_MONTH, 2);
final String responseId_futureDate_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId, final String responseId_futureDate_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId,
clientChargeId, ClientHelper.getPayChargeJSON(dateFormat.format(today.getTime()), "20")); clientChargeId, ClientHelper.getPayChargeJSON(dateFormat.format(today.getTime()), "20"));
Assert.assertNull(responseId_futureDate_failure); Assertions.assertNull(responseId_futureDate_failure);
// waived off the outstanding client charge // waived off the outstanding client charge
final String waiveOffClientChargeTransactionId = ClientHelper.waiveChargesForClients(this.requestSpec, this.responseSpec, clientId, final String waiveOffClientChargeTransactionId = ClientHelper.waiveChargesForClients(this.requestSpec, this.responseSpec, clientId,
clientChargeId, ClientHelper.getWaiveChargeJSON("100", clientChargeId.toString())); clientChargeId, ClientHelper.getWaiveChargeJSON("100", clientChargeId.toString()));
Assert.assertNotNull(waiveOffClientChargeTransactionId); Assertions.assertNotNull(waiveOffClientChargeTransactionId);
/** /**
* Revert the waived off client charge transaction by passing the * 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(), final Integer undoWaiveTrxnId = ClientHelper.revertClientChargeTransaction(this.requestSpec, this.responseSpec, clientId.toString(),
waiveOffClientChargeTransactionId); waiveOffClientChargeTransactionId);
Assert.assertNotNull(undoWaiveTrxnId); Assertions.assertNotNull(undoWaiveTrxnId);
isReversedTransaction(clientId.toString(), undoWaiveTrxnId.toString()); isReversedTransaction(clientId.toString(), undoWaiveTrxnId.toString());
/** /**
* pay client charge before client activation date and ensured its a * 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, final String responseId_activationDate_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("30 September 2011", "20")); 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 * pay client charge more than outstanding amount amount and ensured its
* a failure test case * a failure test case
*/ */
final String responseId_moreAmount_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId, final String responseId_moreAmount_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "300")); 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 * pay client charge for 10 USD and ensure outstanding amount is updated
* properly * properly
*/ */
final String chargePaid_responseId = ClientHelper.payChargesForClients(this.requestSpec, this.responseSpec, clientId, final String chargePaid_responseId = ClientHelper.payChargesForClients(this.requestSpec, this.responseSpec, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "100")); clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "100"));
Assert.assertNotNull(chargePaid_responseId); Assertions.assertNotNull(chargePaid_responseId);
isValidOutstandingAmount(ClientHelper.getClientCharge(requestSpec, responseSpec, clientId.toString(), clientChargeId.toString()), isValidOutstandingAmount(ClientHelper.getClientCharge(requestSpec, responseSpec, clientId.toString(), clientChargeId.toString()),
(float) 100.0); (float) 100.0);
@@ -164,7 +164,7 @@ public class ClientChargesTest {
private void isReversedTransaction(String clientId, String transactionId) { private void isReversedTransaction(String clientId, String transactionId) {
final Boolean isReversed = ClientHelper.getClientTransactions(this.requestSpec, this.responseSpec, clientId.toString(), final Boolean isReversed = ClientHelper.getClientTransactions(this.requestSpec, this.responseSpec, clientId.toString(),
transactionId); transactionId);
Assert.assertTrue(isReversed); Assertions.assertTrue(isReversed);
} }
/** /**
@@ -175,7 +175,7 @@ public class ClientChargesTest {
* @param expectedAmount * @param expectedAmount
*/ */
private void isValidOutstandingAmount(Object outStandingAmount, Object 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; 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 com.google.gson.Gson;
import io.restassured.specification.RequestSpecification; import io.restassured.specification.RequestSpecification;
@@ -312,7 +312,7 @@ public class ClientHelper {
final String CLIENT_URL = "/fineract-provider/api/v1/clients/" + generatedClientID + "?" final String CLIENT_URL = "/fineract-provider/api/v1/clients/" + generatedClientID + "?"
+ Utils.TENANT_IDENTIFIER; + Utils.TENANT_IDENTIFIER;
final Integer responseClientID = Utils.performServerGet(requestSpec, responseSpec, CLIENT_URL, "id"); 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, 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 io.restassured.specification.ResponseSpecification;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -81,20 +81,20 @@ public class GlobalConfigurationHelper {
ArrayList<HashMap> actualGlobalConfigurations = getAllGlobalConfigurations(requestSpec, responseSpec); ArrayList<HashMap> actualGlobalConfigurations = getAllGlobalConfigurations(requestSpec, responseSpec);
// There are currently 27 global configurations. // There are currently 27 global configurations.
Assert.assertEquals(28, expectedGlobalConfigurations.size()); Assertions.assertEquals(28, expectedGlobalConfigurations.size());
Assert.assertEquals(28, actualGlobalConfigurations.size()); Assertions.assertEquals(28, actualGlobalConfigurations.size());
for (int i = 0; i < expectedGlobalConfigurations.size(); i++) { for (int i = 0; i < expectedGlobalConfigurations.size(); i++) {
HashMap expectedGlobalConfiguration = expectedGlobalConfigurations.get(i); HashMap expectedGlobalConfiguration = expectedGlobalConfigurations.get(i);
HashMap actualGlobalConfiguration = actualGlobalConfigurations.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") + ">"; final String assertionFailedMessage = "Assertion failed for configID:<" + expectedGlobalConfiguration.get("id") + ">";
Assert.assertEquals(assertionFailedMessage, expectedGlobalConfiguration.get("name"), actualGlobalConfiguration.get("name")); Assertions.assertEquals(expectedGlobalConfiguration.get("name"), actualGlobalConfiguration.get("name"), assertionFailedMessage);
Assert.assertEquals(assertionFailedMessage, expectedGlobalConfiguration.get("value"), actualGlobalConfiguration.get("value")); Assertions.assertEquals(expectedGlobalConfiguration.get("value"), actualGlobalConfiguration.get("value"), assertionFailedMessage);
Assert.assertEquals(assertionFailedMessage, expectedGlobalConfiguration.get("enabled"), actualGlobalConfiguration.get("enabled")); Assertions.assertEquals(expectedGlobalConfiguration.get("enabled"), actualGlobalConfiguration.get("enabled"), assertionFailedMessage);
Assert.assertEquals(assertionFailedMessage, expectedGlobalConfiguration.get("trapDoor"), actualGlobalConfiguration.get("trapDoor")); Assertions.assertEquals(expectedGlobalConfiguration.get("trapDoor"), actualGlobalConfiguration.get("trapDoor"), assertionFailedMessage);
} }
} }
@@ -18,9 +18,9 @@
*/ */
package org.apache.fineract.integrationtests.common; package org.apache.fineract.integrationtests.common;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.gson.Gson; import com.google.gson.Gson;
@@ -193,7 +193,7 @@ public class GroupHelper {
LOG.info("------------------------------CHECK GROUP DETAILS------------------------------------\n"); LOG.info("------------------------------CHECK GROUP DETAILS------------------------------------\n");
final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?" + Utils.TENANT_IDENTIFIER; final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?" + Utils.TENANT_IDENTIFIER;
final Integer responseGroupID = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "id"); 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, public static void verifyGroupDetails(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -201,7 +201,7 @@ public class GroupHelper {
LOG.info("------------------------------CHECK GROUP DETAILS------------------------------------\n"); LOG.info("------------------------------CHECK GROUP DETAILS------------------------------------\n");
final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?" + Utils.TENANT_IDENTIFIER; final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?" + Utils.TENANT_IDENTIFIER;
final String responseValue = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, field); 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, public static void verifyGroupActivatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -209,7 +209,7 @@ public class GroupHelper {
LOG.info("------------------------------CHECK GROUP STATUS------------------------------------\n"); LOG.info("------------------------------CHECK GROUP STATUS------------------------------------\n");
final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?" + Utils.TENANT_IDENTIFIER; final String GROUP_URL = "/fineract-provider/api/v1/groups/" + generatedGroupID + "?" + Utils.TENANT_IDENTIFIER;
final Boolean responseGroupStatus = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "active"); 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, public static void verifyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -220,7 +220,7 @@ public class GroupHelper {
+ "?associations=clientMembers&" + Utils.TENANT_IDENTIFIER; + "?associations=clientMembers&" + Utils.TENANT_IDENTIFIER;
list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "clientMembers"); list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "clientMembers");
LOG.debug("the list of verifyEmptyGroupMembers : {} ", list); 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, public static void verifyEmptyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -231,7 +231,7 @@ public class GroupHelper {
+ "?associations=clientMembers&" + Utils.TENANT_IDENTIFIER; + "?associations=clientMembers&" + Utils.TENANT_IDENTIFIER;
list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "clientMembers"); list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "clientMembers");
LOG.debug("the list of verifyEmptyGroupMembers : {} ", list); 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, public static void verifyGroupDeleted(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -240,7 +240,7 @@ public class GroupHelper {
LOG.info("------------------------------CHECK GROUP DELETED------------------------------------\n"); LOG.info("------------------------------CHECK GROUP DELETED------------------------------------\n");
final String GROUP_URL = "/fineract-provider/api/v1/groups/?" + Utils.TENANT_IDENTIFIER; final String GROUP_URL = "/fineract-provider/api/v1/groups/?" + Utils.TENANT_IDENTIFIER;
list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "pageItems"); 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 //Glim_Gsim_testing
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests.common; 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 com.google.gson.Gson;
import io.restassured.builder.ResponseSpecBuilder; import io.restassured.builder.ResponseSpecBuilder;
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests.common; 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.RequestSpecification;
import io.restassured.specification.ResponseSpecification; import io.restassured.specification.ResponseSpecification;
@@ -61,6 +61,6 @@ public class LoanRescheduleRequestHelper {
final String URL = LOAN_RESCHEDULE_REQUEST_URL + "/" + requestId + "?" + Utils.TENANT_IDENTIFIER; final String URL = LOAN_RESCHEDULE_REQUEST_URL + "/" + requestId + "?" + Utils.TENANT_IDENTIFIER;
final Integer id = Utils.performServerGet(requestSpec, responseSpec, URL, "id"); 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; 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.common.reflect.TypeToken;
import com.google.gson.Gson; import com.google.gson.Gson;
@@ -67,7 +67,7 @@ public class PaymentTypeHelper {
+ Utils.TENANT_IDENTIFIER; + Utils.TENANT_IDENTIFIER;
final Integer responsePaymentTypeID = Utils.performServerGet(requestSpec, responseSpec, GET_PAYMENTTYPE_URL, final Integer responsePaymentTypeID = Utils.performServerGet(requestSpec, responseSpec, GET_PAYMENTTYPE_URL,
"id"); "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, 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.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.provisioning.ProvisioningHelper; import org.apache.fineract.integrationtests.common.provisioning.ProvisioningHelper;
import org.apache.fineract.integrationtests.common.provisioning.ProvisioningTransactionHelper; import org.apache.fineract.integrationtests.common.provisioning.ProvisioningTransactionHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Assume; import org.junit.jupiter.api.Assumptions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -58,7 +58,7 @@ public class ProvisioningIntegrationTest {
private AccountHelper accountHelper; private AccountHelper accountHelper;
private LoanTransactionHelper loanTransactionHelper; private LoanTransactionHelper loanTransactionHelper;
@Before @BeforeEach
public void setup() throws ParseException{ public void setup() throws ParseException{
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -66,7 +66,7 @@ public class ProvisioningIntegrationTest {
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec); this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
Assume.assumeTrue(!isAlreadyProvisioningEntriesCreated()); Assumptions.assumeTrue(!isAlreadyProvisioningEntriesCreated());
} }
@Test @Test
@@ -79,7 +79,7 @@ public class ProvisioningIntegrationTest {
for (int i = 0; i < LOANPRODUCTS_SIZE; i++) { for (int i = 0; i < LOANPRODUCTS_SIZE; i++) {
final Integer loanProductID = createLoanProduct(false, NONE); final Integer loanProductID = createLoanProduct(false, NONE);
loanProducts.add(loanProductID); loanProducts.add(loanProductID);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, null, null, "1,00,000.00"); final Integer loanID = applyForLoanApplication(clientID, loanProductID, null, null, "1,00,000.00");
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -90,17 +90,17 @@ public class ProvisioningIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
loans.add(loanID); loans.add(loanID);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
} }
ArrayList categories = transactionHelper.retrieveAllProvisioningCategories(); ArrayList categories = transactionHelper.retrieveAllProvisioningCategories();
Assert.assertTrue(categories.size() > 0) ; Assertions.assertTrue(categories.size() > 0) ;
Account liability = accountHelper.createLiabilityAccount() ; Account liability = accountHelper.createLiabilityAccount() ;
Account expense = accountHelper.createExpenseAccount() ; Account expense = accountHelper.createExpenseAccount() ;
Map requestCriteria = ProvisioningHelper.createProvisioingCriteriaJson(loanProducts, categories, liability, expense); Map requestCriteria = ProvisioningHelper.createProvisioingCriteriaJson(loanProducts, categories, liability, expense);
String provisioningCriteriaCreateJson = new Gson().toJson(requestCriteria); String provisioningCriteriaCreateJson = new Gson().toJson(requestCriteria);
Integer criteriaId = transactionHelper.createProvisioningCriteria(provisioningCriteriaCreateJson); Integer criteriaId = transactionHelper.createProvisioningCriteria(provisioningCriteriaCreateJson);
Assert.assertNotNull(criteriaId); Assertions.assertNotNull(criteriaId);
Map newCriteria = transactionHelper.retrieveProvisioningCriteria(criteriaId) ; Map newCriteria = transactionHelper.retrieveProvisioningCriteria(criteriaId) ;
validateProvisioningCriteria(requestCriteria, newCriteria) ; validateProvisioningCriteria(requestCriteria, newCriteria) ;
@@ -124,18 +124,18 @@ public class ProvisioningIntegrationTest {
requestCriteria = ProvisioningHelper.createProvisioingCriteriaJson(loanProducts, categories, liability, expense); requestCriteria = ProvisioningHelper.createProvisioingCriteriaJson(loanProducts, categories, liability, expense);
provisioningCriteriaCreateJson = new Gson().toJson(requestCriteria); provisioningCriteriaCreateJson = new Gson().toJson(requestCriteria);
criteriaId = transactionHelper.createProvisioningCriteria(provisioningCriteriaCreateJson); criteriaId = transactionHelper.createProvisioningCriteria(provisioningCriteriaCreateJson);
Assert.assertNotNull(criteriaId); Assertions.assertNotNull(criteriaId);
String provisioningEntryJson = ProvisioningHelper.createProvisioningEntryJson(); String provisioningEntryJson = ProvisioningHelper.createProvisioningEntryJson();
Integer provisioningEntryId = transactionHelper.createProvisioningEntries(provisioningEntryJson); Integer provisioningEntryId = transactionHelper.createProvisioningEntries(provisioningEntryJson);
Assert.assertNotNull(provisioningEntryId); Assertions.assertNotNull(provisioningEntryId);
transactionHelper.updateProvisioningEntry("recreateprovisioningentry", provisioningEntryId, "") ; transactionHelper.updateProvisioningEntry("recreateprovisioningentry", provisioningEntryId, "") ;
transactionHelper.updateProvisioningEntry("createjournalentry", provisioningEntryId, "") ; transactionHelper.updateProvisioningEntry("createjournalentry", provisioningEntryId, "") ;
Map entry = transactionHelper.retrieveProvisioningEntry(provisioningEntryId) ; Map entry = transactionHelper.retrieveProvisioningEntry(provisioningEntryId) ;
Assert.assertTrue((Boolean)entry.get("journalEntry")) ; Assertions.assertTrue((Boolean)entry.get("journalEntry")) ;
Map provisioningEntry = transactionHelper.retrieveProvisioningEntries(provisioningEntryId) ; 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) { private void validateProvisioningCriteria(Map requestCriteria, Map newCriteria) {
@@ -143,16 +143,16 @@ public class ProvisioningIntegrationTest {
//criteria name validation //criteria name validation
String requestCriteriaName = (String)requestCriteria.get("criteriaName") ; String requestCriteriaName = (String)requestCriteria.get("criteriaName") ;
String criteriaName = (String)newCriteria.get("criteriaName") ; String criteriaName = (String)newCriteria.get("criteriaName") ;
Assert.assertEquals(criteriaName, requestCriteriaName) ; Assertions.assertEquals(criteriaName, requestCriteriaName) ;
//loan products validation //loan products validation
ArrayList requestProducts = (ArrayList)requestCriteria.get("loanProducts") ; ArrayList requestProducts = (ArrayList)requestCriteria.get("loanProducts") ;
ArrayList products = (ArrayList)newCriteria.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 requestedDefinitions = (ArrayList)requestCriteria.get("definitions") ;
ArrayList newdefintions = (ArrayList) newCriteria.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++) { for(int i = 0 ; i < newdefintions.size() ; i++) {
Map requestedMap = (Map)requestedDefinitions.get(i) ; Map requestedMap = (Map)requestedDefinitions.get(i) ;
Object requestedCategoryId = requestedMap.get("categoryId") ; Object requestedCategoryId = requestedMap.get("categoryId") ;
@@ -173,7 +173,7 @@ public class ProvisioningIntegrationTest {
} }
} }
if(!found) { 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) { private void checkProperty(String propertyName, Map requestMap, Map newMap) {
Object requested = requestMap.get(propertyName) ; Object requested = requestMap.get(propertyName) ;
Object modified = newMap.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) { 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.awaitility.Awaitility.await;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is; import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.fail; import static org.junit.jupiter.api.Assertions.fail;
import com.google.gson.Gson; import com.google.gson.Gson;
import io.restassured.builder.ResponseSpecBuilder; 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: {}", LOG.error("Lsat Job failure error log (only relevent if the job fails: {}",
jobHistoryData.get(jobHistoryData.size() - 1).get("jobRunErrorLog")); 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 // Verifying the Status of the Recently executed Scheduler Job
assertEquals("Verifying Last Scheduler Job Status", "success", assertEquals("success", jobHistoryData.get(jobHistoryData.size() - 1).get("status"),
jobHistoryData.get(jobHistoryData.size() - 1).get("status")); "Verifying Last Scheduler Job Status");
} }
/** /**
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests.common; 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 com.google.gson.Gson;
import io.restassured.specification.RequestSpecification; import io.restassured.specification.RequestSpecification;
@@ -68,7 +68,7 @@ public class SurveyHelper {
LOG.info("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); LOG.info("------------------------------CHECK CLIENT DETAILS------------------------------------\n");
final String SURVEY_URL = "/fineract-provider/api/v1/Survey/ppi_kenya_2009/clientid/entryId" + generatedClientID + "?" + Utils.TENANT_IDENTIFIER; final 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"); 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 io.restassured.path.json.JsonPath.from;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is; 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.RestAssured;
import io.restassured.http.ContentType; import io.restassured.http.ContentType;
@@ -18,14 +18,14 @@
*/ */
package org.apache.fineract.integrationtests.common.accounting; 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.RequestSpecification;
import io.restassured.specification.ResponseSpecification; import io.restassured.specification.ResponseSpecification;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public class JournalEntryHelper { public class JournalEntryHelper {
@@ -62,7 +62,7 @@ public class JournalEntryHelper {
public void ensureNoAccountingTransactionsWithTransactionId(final String transactionId) { public void ensureNoAccountingTransactionsWithTransactionId(final String transactionId) {
ArrayList<HashMap> transactions = getJournalEntriesByTransactionId(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; 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; 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.RequestSpecification;
import io.restassured.specification.ResponseSpecification; import io.restassured.specification.ResponseSpecification;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -35,46 +35,46 @@ public class FixedDepositAccountStatusChecker {
public static void verifyFixedDepositIsApproved(final HashMap fixedDepositStatusHashMap) { public static void verifyFixedDepositIsApproved(final HashMap fixedDepositStatusHashMap) {
LOG.info("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS APPROVED --------------------"); 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()); LOG.info("{}", fixedDepositStatusHashMap.toString());
} }
public static void verifyFixedDepositIsPending(final HashMap fixedDepositStatusHashMap) { public static void verifyFixedDepositIsPending(final HashMap fixedDepositStatusHashMap) {
LOG.info("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS PENDING --------------------"); LOG.info("-------------------- VERIFYING FIXED DEPOSIT APPLICATION IS PENDING --------------------");
assertTrue("FIXED DEPOSIT ACCOUNT IS NOT IN PENDING STATE", assertTrue(getStatus(fixedDepositStatusHashMap, "submittedAndPendingApproval"),
getStatus(fixedDepositStatusHashMap, "submittedAndPendingApproval")); "FIXED DEPOSIT ACCOUNT IS NOT IN PENDING STATE");
LOG.info("{}", fixedDepositStatusHashMap.toString()); LOG.info("{}", fixedDepositStatusHashMap.toString());
} }
public static void verifyFixedDepositIsActive(final HashMap fixedDepositStatusHashMap) { public static void verifyFixedDepositIsActive(final HashMap fixedDepositStatusHashMap) {
LOG.info("----------------- VERIFYING FIXED DEPOSIT APPLICATION IS ACTIVE -----------------"); LOG.info("----------------- VERIFYING FIXED DEPOSIT APPLICATION IS ACTIVE -----------------");
assertTrue("ERROR IN ACTIVATING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "active")); assertTrue(getStatus(fixedDepositStatusHashMap, "active"), "ERROR IN ACTIVATING THE FIXED DEPOSIT APPLICATION");
LOG.info("{}", fixedDepositStatusHashMap.toString()); LOG.info("{}", fixedDepositStatusHashMap.toString());
} }
public static void verifyFixedDepositIsRejected(final HashMap fixedDepositStatusHashMap) { public static void verifyFixedDepositIsRejected(final HashMap fixedDepositStatusHashMap) {
LOG.info("-------------- VERIFYING FIXED DEPOSIT APPLICATION IS REJECTED ----------------"); LOG.info("-------------- VERIFYING FIXED DEPOSIT APPLICATION IS REJECTED ----------------");
assertTrue("ERROR IN REJECTING THE FIXED DEPOSIT APPLICATION", assertTrue(getStatus(fixedDepositStatusHashMap, "rejected"),
getStatus(fixedDepositStatusHashMap, "rejected")); "ERROR IN REJECTING THE FIXED DEPOSIT APPLICATION");
LOG.info("{}", fixedDepositStatusHashMap.toString()); LOG.info("{}", fixedDepositStatusHashMap.toString());
} }
public static void verifyFixedDepositIsWithdrawn(final HashMap fixedDepositStatusHashMap) { public static void verifyFixedDepositIsWithdrawn(final HashMap fixedDepositStatusHashMap) {
LOG.info("---------------- VERIFYING FIXED DEPOSIT APPLICATION IS WITHDRAWN ----------------"); LOG.info("---------------- VERIFYING FIXED DEPOSIT APPLICATION IS WITHDRAWN ----------------");
assertTrue("ERROR IN WITHDRAW THE FIXED DEPOSIT APPLICATION", assertTrue(getStatus(fixedDepositStatusHashMap, "withdrawnByApplicant"),
getStatus(fixedDepositStatusHashMap, "withdrawnByApplicant")); "ERROR IN WITHDRAW THE FIXED DEPOSIT APPLICATION");
LOG.info("{}", fixedDepositStatusHashMap.toString()); LOG.info("{}", fixedDepositStatusHashMap.toString());
} }
public static void verifyFixedDepositAccountIsClosed(final HashMap fixedDepositStatusHashMap) { public static void verifyFixedDepositAccountIsClosed(final HashMap fixedDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------"); LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN CLOSING THE FIXED DEPOSIT APPLICATION", getStatus(fixedDepositStatusHashMap, "closed")); assertTrue(getStatus(fixedDepositStatusHashMap, "closed"), "ERROR IN CLOSING THE FIXED DEPOSIT APPLICATION");
LOG.info("{}", fixedDepositStatusHashMap.toString()); LOG.info("{}", fixedDepositStatusHashMap.toString());
} }
public static void verifyFixedDepositAccountIsNotActive(final HashMap fixedDepositStatusHashMap) { public static void verifyFixedDepositAccountIsNotActive(final HashMap fixedDepositStatusHashMap) {
LOG.info("------------------ VERIFYING FIXED DEPOSIT APPLICATION IS INACTIVE --------------------"); LOG.info("------------------ VERIFYING FIXED DEPOSIT APPLICATION IS INACTIVE --------------------");
Assert.assertFalse(getStatus(fixedDepositStatusHashMap, "active")); Assertions.assertFalse(getStatus(fixedDepositStatusHashMap, "active"));
LOG.info("{}", fixedDepositStatusHashMap.toString()); LOG.info("{}", fixedDepositStatusHashMap.toString());
} }
@@ -87,15 +87,15 @@ public class FixedDepositAccountStatusChecker {
public static void verifyFixedDepositAccountIsPrematureClosed(HashMap fixedDepositStatusHashMap) { public static void verifyFixedDepositAccountIsPrematureClosed(HashMap fixedDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------"); LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN PREMATURELY CLOSING THE FIXED DEPOSIT ACCOUNT", assertTrue(getStatus(fixedDepositStatusHashMap, "prematureClosed"),
getStatus(fixedDepositStatusHashMap, "prematureClosed")); "ERROR IN PREMATURELY CLOSING THE FIXED DEPOSIT ACCOUNT");
LOG.info("{}", fixedDepositStatusHashMap.toString()); LOG.info("{}", fixedDepositStatusHashMap.toString());
} }
public static void verifyFixedDepositAccountIsMatured(HashMap fixedDepositStatusHashMap) { public static void verifyFixedDepositAccountIsMatured(HashMap fixedDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS MATURED ---------------------"); LOG.info("--------------------- VERIFYING FIXED DEPOSIT APPLICATION IS MATURED ---------------------");
assertTrue("ERROR IN MATURITY JOB OF THE FIXED DEPOSIT ACCOUNT", assertTrue(getStatus(fixedDepositStatusHashMap, "matured"),
getStatus(fixedDepositStatusHashMap, "matured")); "ERROR IN MATURITY JOB OF THE FIXED DEPOSIT ACCOUNT");
LOG.info("{}", fixedDepositStatusHashMap.toString()); LOG.info("{}", fixedDepositStatusHashMap.toString());
} }
@@ -18,9 +18,9 @@
*/ */
package org.apache.fineract.integrationtests.common.loans; package org.apache.fineract.integrationtests.common.loans;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.specification.RequestSpecification; import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification; import io.restassured.specification.ResponseSpecification;
@@ -18,8 +18,8 @@
*/ */
package org.apache.fineract.integrationtests.common.loans; package org.apache.fineract.integrationtests.common.loans;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.gson.Gson; import com.google.gson.Gson;
import io.restassured.specification.RequestSpecification; import io.restassured.specification.RequestSpecification;
@@ -669,8 +669,9 @@ public class LoanTransactionHelper {
LOG.info("---------------------------GETTING LOAN REPAYMENT SCHEDULE--------------------------------"); LOG.info("---------------------------GETTING LOAN REPAYMENT SCHEDULE--------------------------------");
final ArrayList<HashMap> repaymentPeriods = getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, final ArrayList<HashMap> repaymentPeriods = getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
loanID); loanID);
assertEquals("Mismatch in Principal Loan Balance Outstanding ", expectedPrincipalOutstanding, assertEquals(expectedPrincipalOutstanding,
repaymentPeriods.get(repaymentNumber).get("principalLoanBalanceOutstanding")); repaymentPeriods.get(repaymentNumber).get("principalLoanBalanceOutstanding"),
"Mismatch in Principal Loan Balance Outstanding ");
} }
public void checkAccrualTransactionForRepayment(final LocalDate transactionDate, final Float interestPortion, public void checkAccrualTransactionForRepayment(final LocalDate transactionDate, final Float interestPortion,
@@ -690,17 +691,20 @@ public class LoanTransactionHelper {
if (transactionDate.equals(accrualEntryDate)) { if (transactionDate.equals(accrualEntryDate)) {
isTransactionFound = true; isTransactionFound = true;
assertEquals("Mismatch in transaction amounts", interestPortion, assertEquals(interestPortion,
Float.valueOf(String.valueOf(transactions.get(i).get("interestPortion")))); Float.valueOf(String.valueOf(transactions.get(i).get("interestPortion"))),
assertEquals("Mismatch in transaction amounts", feePortion, "Mismatch in transaction amounts");
Float.valueOf(String.valueOf(transactions.get(i).get("feeChargesPortion")))); assertEquals(feePortion,
assertEquals("Mismatch in transaction amounts", penaltyPortion, Float.valueOf(String.valueOf(transactions.get(i).get("feeChargesPortion"))),
Float.valueOf(String.valueOf(transactions.get(i).get("penaltyChargesPortion")))); "Mismatch in transaction amounts");
assertEquals(penaltyPortion,
Float.valueOf(String.valueOf(transactions.get(i).get("penaltyChargesPortion"))),
"Mismatch in transaction amounts");
break; 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.RestAssured.given;
import static io.restassured.path.json.JsonPath.from; 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.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
@@ -67,7 +67,7 @@ public class CampaignsHelper {
+ Utils.TENANT_IDENTIFIER; + Utils.TENANT_IDENTIFIER;
final Integer responseCampaignId = Utils.performServerGet(requestSpec, responseSpec, RETRIEVE_SMS_CAMPAIGNS_URL, final Integer responseCampaignId = Utils.performServerGet(requestSpec, responseSpec, RETRIEVE_SMS_CAMPAIGNS_URL,
"id"); "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, public Integer updateCampaign(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests.common.organisation; 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.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; import io.restassured.builder.ResponseSpecBuilder;
@@ -29,11 +29,11 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.CommonConstants; import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Ignore; import org.junit.jupiter.api.Disabled;
import org.junit.Test; import org.junit.jupiter.api.Test;
@Ignore @Disabled
public class CampaignsTest { public class CampaignsTest {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
@@ -53,7 +53,7 @@ public class CampaignsTest {
public static final String DATE_FORMAT = "dd MMMM yyyy"; public static final String DATE_FORMAT = "dd MMMM yyyy";
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -18,8 +18,8 @@
*/ */
package org.apache.fineract.integrationtests.common.organisation; package org.apache.fineract.integrationtests.common.organisation;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper; import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.system.DatatableHelper; import org.apache.fineract.integrationtests.common.system.DatatableHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -74,7 +74,7 @@ public class EntityDatatableChecksIntegrationTest {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -93,15 +93,15 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check // creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(CLIENT_APP_TABLE_NAME, datatableName, Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(CLIENT_APP_TABLE_NAME, datatableName,
100, null); 100, null);
assertNotNull("ERROR IN CREATING THE ENTITY DATATABLE CHECK", entityDatatableCheckId); assertNotNull(entityDatatableCheckId, "ERROR IN CREATING THE ENTITY DATATABLE CHECK");
// deleting entity datatable check // deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId); 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 // deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(datatableName); String deletedDataTableName = this.datatableHelper.deleteDatatable(datatableName);
assertEquals("ERROR IN DELETING THE DATATABLE", datatableName, deletedDataTableName); assertEquals(datatableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
} }
@Test @Test
@@ -121,7 +121,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check // creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(CLIENT_APP_TABLE_NAME, Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(CLIENT_APP_TABLE_NAME,
registeredTableName, 100, null); 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 // creating client with datatables
final Integer clientID = ClientHelper.createClientPendingWithDatatable(requestSpec, responseSpec, registeredTableName); final Integer clientID = ClientHelper.createClientPendingWithDatatable(requestSpec, responseSpec, registeredTableName);
@@ -129,15 +129,15 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check // deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId); 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 // deleting datatable entries
Integer appTableId = this.datatableHelper.deleteDatatableEntries(registeredTableName, clientID, "clientId"); 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 // deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName); String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName); assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -154,7 +154,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check // creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(CLIENT_APP_TABLE_NAME, Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(CLIENT_APP_TABLE_NAME,
registeredTableName, 100, null); 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 // creating client with datatables with error
ArrayList<HashMap<Object, Object>> clientErrorData = (ArrayList<HashMap<Object, Object>>) validationErrorHelper ArrayList<HashMap<Object, Object>> clientErrorData = (ArrayList<HashMap<Object, Object>>) validationErrorHelper
@@ -164,11 +164,11 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check // deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId); 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 // deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName); String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName); assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
} }
@Test @Test
@@ -181,7 +181,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check // creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(GROUP_APP_TABLE_NAME, Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(GROUP_APP_TABLE_NAME,
registeredTableName, 100, null); 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 // creating group with datatables
final Integer groupId = GroupHelper.createGroupPendingWithDatatable(this.requestSpec, this.responseSpec, registeredTableName); final Integer groupId = GroupHelper.createGroupPendingWithDatatable(this.requestSpec, this.responseSpec, registeredTableName);
@@ -189,15 +189,15 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check // deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId); 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 // deleting datatable entries
Integer appTableId = this.datatableHelper.deleteDatatableEntries(registeredTableName, groupId, "groupId"); 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 // deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName); String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName); assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -214,7 +214,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check // creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(GROUP_APP_TABLE_NAME, Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(GROUP_APP_TABLE_NAME,
registeredTableName, 100, null); 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 // creating group with datatables with error
ArrayList<HashMap<Object, Object>> groupErrorData = (ArrayList<HashMap<Object, Object>>) validationErrorHelper ArrayList<HashMap<Object, Object>> groupErrorData = (ArrayList<HashMap<Object, Object>>) validationErrorHelper
@@ -224,11 +224,11 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check // deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId); 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 // deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName); String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName); assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
} }
@Test @Test
@@ -248,31 +248,31 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check // creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(SAVINGS_APP_TABLE_NAME, Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(SAVINGS_APP_TABLE_NAME,
registeredTableName, 100, null); 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); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID); ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
// creating savings with datatables // creating savings with datatables
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplicationWithDatatables(clientID, savingsProductID, final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplicationWithDatatables(clientID, savingsProductID,
ACCOUNT_TYPE_INDIVIDUAL, "01 December 2016", registeredTableName); ACCOUNT_TYPE_INDIVIDUAL, "01 December 2016", registeredTableName);
Assert.assertNotNull(savingsId); Assertions.assertNotNull(savingsId);
// deleting entity datatable check // deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId); 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 // deleting datatable entries
Integer appTableId = this.datatableHelper.deleteDatatableEntries(registeredTableName, savingsId, "savingsId"); 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 // deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName); String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName); assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -294,14 +294,14 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check // creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(SAVINGS_APP_TABLE_NAME, Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(SAVINGS_APP_TABLE_NAME,
registeredTableName, 100, null); 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); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID); ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft); minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
// creating savings with datatables with error // creating savings with datatables with error
ArrayList<HashMap<Object, Object>> groupErrorData = (ArrayList<HashMap<Object, Object>>) validationErrorHelper ArrayList<HashMap<Object, Object>> groupErrorData = (ArrayList<HashMap<Object, Object>>) validationErrorHelper
@@ -312,11 +312,11 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check // deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId); 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 // deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName); String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName); assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
} }
@Test @Test
@@ -329,7 +329,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating loan product // creating loan product
final Integer loanProductID = createLoanProduct("100", "0", LoanProductTestBuilder.DEFAULT_STRATEGY); final Integer loanProductID = createLoanProduct("100", "0", LoanProductTestBuilder.DEFAULT_STRATEGY);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
// creating datatable // creating datatable
String registeredTableName = this.datatableHelper.createDatatable(LOAN_APP_TABLE_NAME, false); String registeredTableName = this.datatableHelper.createDatatable(LOAN_APP_TABLE_NAME, false);
@@ -338,23 +338,23 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check // creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(LOAN_APP_TABLE_NAME, Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(LOAN_APP_TABLE_NAME,
registeredTableName, 100, loanProductID); 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 // creating new loan application
final Integer loanID = applyForLoanApplication(clientID, loanProductID, "5", registeredTableName); final Integer loanID = applyForLoanApplication(clientID, loanProductID, "5", registeredTableName);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
// deleting entity datatable check // deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId); 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 // deleting datatable entries
Integer appTableId = this.datatableHelper.deleteDatatableEntries(registeredTableName, loanID, "loanId"); 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 // deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName); String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName);
assertEquals("ERROR IN DELETING THE DATATABLE", registeredTableName, deletedDataTableName); assertEquals(registeredTableName, deletedDataTableName, "ERROR IN DELETING THE DATATABLE");
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -372,7 +372,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating loan product // creating loan product
final Integer loanProductID = createLoanProduct("100", "0", LoanProductTestBuilder.DEFAULT_STRATEGY); final Integer loanProductID = createLoanProduct("100", "0", LoanProductTestBuilder.DEFAULT_STRATEGY);
Assert.assertNotNull(loanProductID); Assertions.assertNotNull(loanProductID);
// creating datatable // creating datatable
String registeredTableName = this.datatableHelper.createDatatable(LOAN_APP_TABLE_NAME, false); String registeredTableName = this.datatableHelper.createDatatable(LOAN_APP_TABLE_NAME, false);
@@ -381,7 +381,7 @@ public class EntityDatatableChecksIntegrationTest {
// creating new entity datatable check // creating new entity datatable check
Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(LOAN_APP_TABLE_NAME, Integer entityDatatableCheckId = this.entityDatatableChecksHelper.createEntityDatatableCheck(LOAN_APP_TABLE_NAME,
registeredTableName, 100, loanProductID); 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 // creating new loan application with error
ArrayList<HashMap<Object, Object>> loanErrorData = (ArrayList<HashMap<Object, Object>>) applyForLoanApplicationWithError(clientID, ArrayList<HashMap<Object, Object>> loanErrorData = (ArrayList<HashMap<Object, Object>>) applyForLoanApplicationWithError(clientID,
@@ -391,11 +391,11 @@ public class EntityDatatableChecksIntegrationTest {
// deleting entity datatable check // deleting entity datatable check
entityDatatableCheckId = this.entityDatatableChecksHelper.deleteEntityDatatableCheck(entityDatatableCheckId); 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 // deleting the datatable
String deletedDataTableName = this.datatableHelper.deleteDatatable(registeredTableName); 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, private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -18,13 +18,13 @@
*/ */
package org.apache.fineract.integrationtests.common.recurringdeposit; 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.RequestSpecification;
import io.restassured.specification.ResponseSpecification; import io.restassured.specification.ResponseSpecification;
import java.util.HashMap; import java.util.HashMap;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -35,44 +35,44 @@ public class RecurringDepositAccountStatusChecker {
public static void verifyRecurringDepositIsApproved(final HashMap recurringDepositStatusHashMap) { public static void verifyRecurringDepositIsApproved(final HashMap recurringDepositStatusHashMap) {
LOG.info("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS APPROVED --------------------"); 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()); LOG.info("{}",recurringDepositStatusHashMap.toString());
} }
public static void verifyRecurringDepositIsPending(final HashMap recurringDepositStatusHashMap) { public static void verifyRecurringDepositIsPending(final HashMap recurringDepositStatusHashMap) {
LOG.info("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS PENDING --------------------"); LOG.info("-------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS PENDING --------------------");
assertTrue("RECURRING DEPOSIT ACCOUNT IS NOT IN PENDING STATE", assertTrue(getStatus(recurringDepositStatusHashMap, "submittedAndPendingApproval"),
getStatus(recurringDepositStatusHashMap, "submittedAndPendingApproval")); "RECURRING DEPOSIT ACCOUNT IS NOT IN PENDING STATE");
LOG.info("{}",recurringDepositStatusHashMap.toString()); LOG.info("{}",recurringDepositStatusHashMap.toString());
} }
public static void verifyRecurringDepositIsActive(final HashMap recurringDepositStatusHashMap) { public static void verifyRecurringDepositIsActive(final HashMap recurringDepositStatusHashMap) {
LOG.info("----------------- VERIFYING RECURRING DEPOSIT APPLICATION IS ACTIVE -----------------"); LOG.info("----------------- VERIFYING RECURRING DEPOSIT APPLICATION IS ACTIVE -----------------");
assertTrue("ERROR IN ACTIVATING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "active")); assertTrue(getStatus(recurringDepositStatusHashMap, "active"), "ERROR IN ACTIVATING THE RECURRING DEPOSIT APPLICATION");
LOG.info("{}",recurringDepositStatusHashMap.toString()); LOG.info("{}",recurringDepositStatusHashMap.toString());
} }
public static void verifyRecurringDepositIsRejected(final HashMap recurringDepositStatusHashMap) { public static void verifyRecurringDepositIsRejected(final HashMap recurringDepositStatusHashMap) {
LOG.info("-------------- VERIFYING RECURRING DEPOSIT APPLICATION IS REJECTED ----------------"); LOG.info("-------------- VERIFYING RECURRING DEPOSIT APPLICATION IS REJECTED ----------------");
assertTrue("ERROR IN REJECTING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "rejected")); assertTrue(getStatus(recurringDepositStatusHashMap, "rejected"), "ERROR IN REJECTING THE RECURRING DEPOSIT APPLICATION");
LOG.info("{}",recurringDepositStatusHashMap.toString()); LOG.info("{}",recurringDepositStatusHashMap.toString());
} }
public static void verifyRecurringDepositIsWithdrawn(final HashMap recurringDepositStatusHashMap) { public static void verifyRecurringDepositIsWithdrawn(final HashMap recurringDepositStatusHashMap) {
LOG.info("---------------- VERIFYING RECURRING DEPOSIT APPLICATION IS WITHDRAWN ----------------"); LOG.info("---------------- VERIFYING RECURRING DEPOSIT APPLICATION IS WITHDRAWN ----------------");
assertTrue("ERROR IN WITHDRAW THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "withdrawnByApplicant")); assertTrue(getStatus(recurringDepositStatusHashMap, "withdrawnByApplicant"), "ERROR IN WITHDRAW THE RECURRING DEPOSIT APPLICATION");
LOG.info("{}",recurringDepositStatusHashMap.toString()); LOG.info("{}",recurringDepositStatusHashMap.toString());
} }
public static void verifyRecurringDepositAccountIsClosed(final HashMap recurringDepositStatusHashMap) { public static void verifyRecurringDepositAccountIsClosed(final HashMap recurringDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------"); LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN CLOSING THE RECURRING DEPOSIT APPLICATION", getStatus(recurringDepositStatusHashMap, "closed")); assertTrue(getStatus(recurringDepositStatusHashMap, "closed"), "ERROR IN CLOSING THE RECURRING DEPOSIT APPLICATION");
LOG.info("{}",recurringDepositStatusHashMap.toString()); LOG.info("{}",recurringDepositStatusHashMap.toString());
} }
public static void verifyRecurringDepositAccountIsNotActive(final HashMap recurringDepositStatusHashMap) { public static void verifyRecurringDepositAccountIsNotActive(final HashMap recurringDepositStatusHashMap) {
LOG.info("------------------ VERIFYING RECURRING DEPOSIT APPLICATION IS INACTIVE --------------------"); LOG.info("------------------ VERIFYING RECURRING DEPOSIT APPLICATION IS INACTIVE --------------------");
Assert.assertFalse(getStatus(recurringDepositStatusHashMap, "active")); Assertions.assertFalse(getStatus(recurringDepositStatusHashMap, "active"));
LOG.info("{}",recurringDepositStatusHashMap.toString()); LOG.info("{}",recurringDepositStatusHashMap.toString());
} }
@@ -85,14 +85,14 @@ public class RecurringDepositAccountStatusChecker {
public static void verifyRecurringDepositAccountIsPrematureClosed(HashMap recurringDepositStatusHashMap) { public static void verifyRecurringDepositAccountIsPrematureClosed(HashMap recurringDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------"); LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS CLOSED ---------------------");
assertTrue("ERROR IN PREMATURELY CLOSING THE RECURRING DEPOSIT ACCOUNT", assertTrue(getStatus(recurringDepositStatusHashMap, "prematureClosed"),
getStatus(recurringDepositStatusHashMap, "prematureClosed")); "ERROR IN PREMATURELY CLOSING THE RECURRING DEPOSIT ACCOUNT");
LOG.info("{}",recurringDepositStatusHashMap.toString()); LOG.info("{}",recurringDepositStatusHashMap.toString());
} }
public static void verifyRecurringDepositAccountIsMatured(HashMap recurringDepositStatusHashMap) { public static void verifyRecurringDepositAccountIsMatured(HashMap recurringDepositStatusHashMap) {
LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS MATURED ---------------------"); LOG.info("--------------------- VERIFYING RECURRING DEPOSIT APPLICATION IS MATURED ---------------------");
assertTrue("ERROR IN MATURITY JOB OF THE RECURRING DEPOSIT ACCOUNT", getStatus(recurringDepositStatusHashMap, "matured")); assertTrue(getStatus(recurringDepositStatusHashMap, "matured"), "ERROR IN MATURITY JOB OF THE RECURRING DEPOSIT ACCOUNT");
LOG.info("{}",recurringDepositStatusHashMap.toString()); 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.fineract.integrationtests.common.Utils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -674,12 +674,12 @@ public class SavingsAccountHelper {
public static Integer openSavingsAccount(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, public static Integer openSavingsAccount(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer clientId, final String minimumOpeningBalance) { final Integer clientId, final String minimumOpeningBalance) {
final Integer savingsProductID = createSavingsProduct(requestSpec, responseSpec, minimumOpeningBalance); final Integer savingsProductID = createSavingsProduct(requestSpec, responseSpec, minimumOpeningBalance);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
SavingsAccountHelper savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec); SavingsAccountHelper savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
final Integer savingsId = savingsAccountHelper.applyForSavingsApplication(clientId, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL); final Integer savingsId = savingsAccountHelper.applyForSavingsApplication(clientId, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assert.assertNotNull(savingsProductID); Assertions.assertNotNull(savingsProductID);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId); HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests.common.savings; 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 com.google.gson.Gson;
import io.restassured.specification.RequestSpecification; import io.restassured.specification.RequestSpecification;
@@ -293,7 +293,7 @@ public class SavingsProductHelper {
LOG.info("------------------------------CHECK CLIENT DETAILS------------------------------------\n"); LOG.info("------------------------------CHECK CLIENT DETAILS------------------------------------\n");
final String GET_SAVINGS_PRODUCT_URL = SAVINGS_PRODUCT_URL + "/" + generatedProductID + "?" + Utils.TENANT_IDENTIFIER; 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"); 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() { public SavingsProductHelper withDormancy() {
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests.common.savings; 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.RequestSpecification;
import io.restassured.specification.ResponseSpecification; import io.restassured.specification.ResponseSpecification;
@@ -35,44 +35,44 @@ public class SavingsStatusChecker {
public static void verifySavingsIsApproved(final HashMap savingsStatusHashMap) { public static void verifySavingsIsApproved(final HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS APPROVED ------------------------------------"); "\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); LOG.info("Savings Application Status: {} \n", savingsStatusHashMap);
} }
public static void verifySavingsIsPending(final HashMap savingsStatusHashMap) { public static void verifySavingsIsPending(final HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS PENDING ------------------------------------"); "\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS PENDING ------------------------------------");
assertTrue("SAVINGS ACCOUNT IS NOT IN PENDING STATE", assertTrue(getStatus(savingsStatusHashMap, "submittedAndPendingApproval"),
getStatus(savingsStatusHashMap, "submittedAndPendingApproval")); "SAVINGS ACCOUNT IS NOT IN PENDING STATE");
LOG.info("Savings Application Status: {} \n", savingsStatusHashMap); LOG.info("Savings Application Status: {} \n", savingsStatusHashMap);
} }
public static void verifySavingsIsActive(final HashMap savingsStatusHashMap) { public static void verifySavingsIsActive(final HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); "\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); LOG.info("Savings Application Status: {} \n", savingsStatusHashMap);
} }
public static void verifySavingsIsRejected(final HashMap savingsStatusHashMap) { public static void verifySavingsIsRejected(final HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS REJECTED ------------------------------------"); "\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); LOG.info("Savings Application Status: {} \n", savingsStatusHashMap);
} }
public static void verifySavingsIsWithdrawn(final HashMap savingsStatusHashMap) { public static void verifySavingsIsWithdrawn(final HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS WITHDRAWN ------------------------------------"); "\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS WITHDRAWN ------------------------------------");
assertTrue("ERROR IN WITHDRAW THE SAVINGS APPLICATION", assertTrue(getStatus(savingsStatusHashMap, "withdrawnByApplicant"),
getStatus(savingsStatusHashMap, "withdrawnByApplicant")); "ERROR IN WITHDRAW THE SAVINGS APPLICATION");
LOG.info("Savings Application Status: {}", savingsStatusHashMap); LOG.info("Savings Application Status: {}", savingsStatusHashMap);
} }
public static void verifySavingsAccountIsClosed(final HashMap savingsStatusHashMap) { public static void verifySavingsAccountIsClosed(final HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS CLOSED ------------------------------------"); "\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); LOG.info("Savings Application Status: {}", savingsStatusHashMap);
} }
@@ -102,56 +102,56 @@ public class SavingsStatusChecker {
public static void verifySavingsSubStatusInactive(HashMap savingsStatusHashMap) { public static void verifySavingsSubStatusInactive(HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); "\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()); LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
} }
public static void verifySavingsSubStatusDormant(HashMap savingsStatusHashMap) { public static void verifySavingsSubStatusDormant(HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); "\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()); LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
} }
public static void verifySavingsSubStatusEscheat(HashMap savingsStatusHashMap) { public static void verifySavingsSubStatusEscheat(HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); "\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()); LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
} }
public static void verifySavingsSubStatusNone(HashMap savingsStatusHashMap) { public static void verifySavingsSubStatusNone(HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS APPLICATION IS ACTIVE ------------------------------------"); "\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()); LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
} }
public static void verifySavingsSubStatusblock(HashMap savingsStatusHashMap) { public static void verifySavingsSubStatusblock(HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n-------------------------------------- VERIFYING SAVINGS ACCOUNT IS BLOCKED ------------------------------------"); "\n-------------------------------------- VERIFYING SAVINGS ACCOUNT IS BLOCKED ------------------------------------");
assertTrue("block", getStatus(savingsStatusHashMap, "block")); assertTrue(getStatus(savingsStatusHashMap, "block"), "block");
LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString()); LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
} }
public static void verifySavingsSubStatusIsNone(HashMap savingsStatusHashMap) { public static void verifySavingsSubStatusIsNone(HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n------------------------- VERIFYING SAVINGS ACCOUNT IS NOT BLOCKED FOR ANY TYPE OF TRANSACTIONS ---------------------------"); "\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()); LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
} }
public static void verifySavingsSubStatusIsDebitBlocked(HashMap savingsStatusHashMap) { public static void verifySavingsSubStatusIsDebitBlocked(HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n--------------------- VERIFYING SAVINGS APPLICATION IS BLOCKED FOR DEBIT TRANSACTIONS ---------------------"); "\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()); LOG.info("Savings Application Sub Status: {} ", savingsStatusHashMap.toString());
} }
public static void verifySavingsSubStatusIsCreditBlocked(HashMap savingsStatusHashMap) { public static void verifySavingsSubStatusIsCreditBlocked(HashMap savingsStatusHashMap) {
LOG.info( LOG.info(
"\n---------------------- VERIFYING SAVINGS APPLICATION IS BLOCKED FOR CREDIT TRANSACTIONS ---------------"); "\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()); 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.ClientHelper;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper; import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class DividendsIntegrationTests { public class DividendsIntegrationTests {
@@ -48,7 +48,7 @@ public class DividendsIntegrationTests {
private RequestSpecification requestSpec; private RequestSpecification requestSpec;
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -67,16 +67,16 @@ public class DividendsIntegrationTests {
for(int i = 0 ; i < 5; i++) { for(int i = 0 ; i < 5; i++) {
final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
clients.add(clientId) ; clients.add(clientId) ;
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
Integer savingsAccountId = SavingsAccountHelper.openSavingsAccount(requestSpec, responseSpec, clientId, "1000"); Integer savingsAccountId = SavingsAccountHelper.openSavingsAccount(requestSpec, responseSpec, clientId, "1000");
savingAccounts.add(savingsAccountId) ; savingAccounts.add(savingsAccountId) ;
Assert.assertNotNull(savingsAccountId); Assertions.assertNotNull(savingsAccountId);
final Integer shareAccountId = createShareAccount(clientId, productId, savingsAccountId, dates[i], shares[i]); final Integer shareAccountId = createShareAccount(clientId, productId, savingsAccountId, dates[i], shares[i]);
shareAccounts.add(shareAccountId) ; shareAccounts.add(shareAccountId) ;
Assert.assertNotNull(shareAccountId); Assertions.assertNotNull(shareAccountId);
Map<String, Object> shareAccountData = ShareAccountTransactionHelper Map<String, Object> shareAccountData = ShareAccountTransactionHelper
.retrieveShareAccount(shareAccountId, requestSpec, responseSpec); .retrieveShareAccount(shareAccountId, requestSpec, responseSpec);
Assert.assertNotNull(shareAccountData); Assertions.assertNotNull(shareAccountData);
// Approve share Account // Approve share Account
Map<String, Object> approveMap = new HashMap<>(); Map<String, Object> approveMap = new HashMap<>();
approveMap.put("note", "Share Account Approval Note"); approveMap.put("note", "Share Account Approval Note");
@@ -104,84 +104,84 @@ public class DividendsIntegrationTests {
final Integer dividendId = ShareDividendsTransactionHelper.createShareProductDividends(productId, createDividendsJson, requestSpec, responseSpec) ; final Integer dividendId = ShareDividendsTransactionHelper.createShareProductDividends(productId, createDividendsJson, requestSpec, responseSpec) ;
Map<String, Object> productdividends = ShareDividendsTransactionHelper.retrieveAllDividends(productId, 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) ; 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") ; 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"); List<Integer> startdateList = (List<Integer>) dividend.get("dividendPeriodStartDate");
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.set(startdateList.get(0), startdateList.get(1) - 1, startdateList.get(2)); cal.set(startdateList.get(0), startdateList.get(1) - 1, startdateList.get(2));
Date startDate = cal.getTime(); 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"); List<Integer> enddateList = (List<Integer>) dividend.get("dividendPeriodEndDate");
cal = Calendar.getInstance(); cal = Calendar.getInstance();
cal.set(enddateList.get(0), enddateList.get(1) - 1, enddateList.get(2)); cal.set(enddateList.get(0), enddateList.get(1) - 1, enddateList.get(2));
Date endDate = cal.getTime(); 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) ; 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") ; List<Map<String, Object>> pageItems = (List<Map<String, Object>>)dividenddetails.get("pageItems") ;
for(Map<String, Object> dividendData: pageItems) { for(Map<String, Object> dividendData: pageItems) {
Map<String, Object> accountData = (Map<String, Object>) dividendData.get("accountData") ; Map<String, Object> accountData = (Map<String, Object>) dividendData.get("accountData") ;
String accountId = String.valueOf(accountData.get("id")) ; String accountId = String.valueOf(accountData.get("id")) ;
if(String.valueOf(shareAccounts.get(0)).equals(accountId)) { 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)) { }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)) { }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)) { }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)) { }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") ; 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 = "" ; String jsonString = "" ;
ShareDividendsTransactionHelper.postCommand("approve", productId, dividendId, jsonString, requestSpec, responseSpec) ; ShareDividendsTransactionHelper.postCommand("approve", productId, dividendId, jsonString, requestSpec, responseSpec) ;
productdividends = ShareDividendsTransactionHelper.retrieveAllDividends(productId, 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) ; 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") ; 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"); startdateList = (List<Integer>) dividend.get("dividendPeriodStartDate");
cal = Calendar.getInstance(); cal = Calendar.getInstance();
cal.set(startdateList.get(0), startdateList.get(1) - 1, startdateList.get(2)); cal.set(startdateList.get(0), startdateList.get(1) - 1, startdateList.get(2));
startDate = cal.getTime(); 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"); enddateList = (List<Integer>) dividend.get("dividendPeriodEndDate");
cal = Calendar.getInstance(); cal = Calendar.getInstance();
cal.set(enddateList.get(0), enddateList.get(1) - 1, enddateList.get(2)); cal.set(enddateList.get(0), enddateList.get(1) - 1, enddateList.get(2));
endDate = cal.getTime(); 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) ; 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") ; pageItems = (List<Map<String, Object>>)dividenddetails.get("pageItems") ;
for(Map<String, Object> dividendData: pageItems) { for(Map<String, Object> dividendData: pageItems) {
Map<String, Object> accountData = (Map<String, Object>) dividendData.get("accountData") ; Map<String, Object> accountData = (Map<String, Object>) dividendData.get("accountData") ;
String accountId = String.valueOf(accountData.get("id")) ; String accountId = String.valueOf(accountData.get("id")) ;
if(String.valueOf(shareAccounts.get(0)).equals(accountId)) { 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)) { }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)) { }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)) { }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)) { }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") ; 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.infrastructure.core.service.DateUtils;
import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.Utils;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -134,61 +134,61 @@ public class ShareProductHelper {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void verifyShareProduct(Map<String, Object> shareProductData) { public void verifyShareProduct(Map<String, Object> shareProductData) {
String productName = (String)shareProductData.get("name") ; String productName = (String)shareProductData.get("name") ;
Assert.assertEquals(this.productName, productName); Assertions.assertEquals(this.productName, productName);
String shortName = (String)shareProductData.get("shortName") ; String shortName = (String)shareProductData.get("shortName") ;
Assert.assertEquals(this.shortName, shortName); Assertions.assertEquals(this.shortName, shortName);
String description = (String)shareProductData.get("description") ; 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") ; Map<String, String> currency = (Map<String,String>)shareProductData.get("currency") ;
String currencyCode = currency.get("code") ; String currencyCode = currency.get("code") ;
Assert.assertEquals(this.currencyCode, currencyCode); Assertions.assertEquals(this.currencyCode, currencyCode);
String digitsAfterDecimal = String.valueOf(currency.get("decimalPlaces")) ; 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")) ; 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")) ; String totalShares = String.valueOf(shareProductData.get("totalShares")) ;
Assert.assertEquals(this.totalShares, totalShares); Assertions.assertEquals(this.totalShares, totalShares);
String sharesIssued = String.valueOf(shareProductData.get("totalSharesIssued")) ; String sharesIssued = String.valueOf(shareProductData.get("totalSharesIssued")) ;
Assert.assertEquals(this.sharesIssued, sharesIssued); Assertions.assertEquals(this.sharesIssued, sharesIssued);
String unitPrice = String.valueOf(shareProductData.get("unitPrice")) ; String unitPrice = String.valueOf(shareProductData.get("unitPrice")) ;
Assert.assertEquals(this.unitPrice, unitPrice); Assertions.assertEquals(this.unitPrice, unitPrice);
String minimumShares = String.valueOf(shareProductData.get("minimumShares")) ; String minimumShares = String.valueOf(shareProductData.get("minimumShares")) ;
Assert.assertEquals(this.minimumShares, minimumShares); Assertions.assertEquals(this.minimumShares, minimumShares);
String nominalShares = String.valueOf(shareProductData.get("nominalShares")) ; String nominalShares = String.valueOf(shareProductData.get("nominalShares")) ;
Assert.assertEquals(this.nominalShares, nominalShares); Assertions.assertEquals(this.nominalShares, nominalShares);
String maximumShares = String.valueOf(shareProductData.get("maximumShares")) ; String maximumShares = String.valueOf(shareProductData.get("maximumShares")) ;
Assert.assertEquals(this.maximumShares, maximumShares); Assertions.assertEquals(this.maximumShares, maximumShares);
String allowDividendCalculationForInactiveClients = String.valueOf(shareProductData.get("allowDividendCalculationForInactiveClients")) ; 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") ; Map<String, Object> accountingRuleMap = (Map<String, Object>) shareProductData.get("accountingRule") ;
String accountingRule = String.valueOf(accountingRuleMap.get("id")) ; String accountingRule = String.valueOf(accountingRuleMap.get("id")) ;
Assert.assertEquals(this.accountingRule, accountingRule); Assertions.assertEquals(this.accountingRule, accountingRule);
String minimumActivePeriodForDividends = String.valueOf(shareProductData.get("minimumActivePeriod")) ; 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") ; Map<String, Object> minimumActivePeriodType = (Map<String, Object>) shareProductData.get("minimumActivePeriodForDividendsTypeEnum") ;
String minimumactiveperiodFrequencyType = String.valueOf(minimumActivePeriodType.get("id")) ; String minimumactiveperiodFrequencyType = String.valueOf(minimumActivePeriodType.get("id")) ;
Assert.assertEquals(this.minimumactiveperiodFrequencyType, minimumactiveperiodFrequencyType); Assertions.assertEquals(this.minimumactiveperiodFrequencyType, minimumactiveperiodFrequencyType);
String lockinPeriodFrequency = String.valueOf(shareProductData.get("lockinPeriod")) ; 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") ; Map<String, Object> lockinPeriodType = (Map<String, Object>) shareProductData.get("lockPeriodTypeEnum") ;
String lockinPeriodFrequencyType = String.valueOf(lockinPeriodType.get("id")) ; 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") ; //ArrayList<Map<String, String>> charges = (ArrayList<Map<String, String>>)shareProductData.get("chargesSelected") ;
@@ -18,7 +18,7 @@
*/ */
package org.apache.fineract.integrationtests.common.system; 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 com.google.gson.Gson;
import io.restassured.specification.RequestSpecification; 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.interoperation.util.MathUtil;
import org.apache.fineract.portfolio.charge.domain.ChargeTimeType; import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
import org.apache.fineract.portfolio.savings.SavingsApiConstants; import org.apache.fineract.portfolio.savings.SavingsApiConstants;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -82,7 +82,7 @@ public class InteropTest {
private String quoteCode; private String quoteCode;
private String transferCode; private String transferCode;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -115,7 +115,7 @@ public class InteropTest {
private void createClient() { private void createClient() {
clientId = ClientHelper.createClient(requestSpec, responseSpec); clientId = ClientHelper.createClient(requestSpec, responseSpec);
Assert.assertNotNull(clientId); Assertions.assertNotNull(clientId);
} }
private void createSavingsProduct() { private void createSavingsProduct() {
@@ -138,7 +138,7 @@ public class InteropTest {
.withAccountingRuleAsCashBased(accounts) .withAccountingRuleAsCashBased(accounts)
.build(); .build();
savingsProductId = SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec); savingsProductId = SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
Assert.assertNotNull(savingsProductId); Assertions.assertNotNull(savingsProductId);
LOG.debug("Sucessfully created Interoperable Saving Product (id: {})", savingsProductId); LOG.debug("Sucessfully created Interoperable Saving Product (id: {})", savingsProductId);
} }
@@ -146,13 +146,13 @@ public class InteropTest {
private void createCharge() { private void createCharge() {
chargeId = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getSavingsJSON(interopHelper.getFee().toString(), chargeId = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getSavingsJSON(interopHelper.getFee().toString(),
interopHelper.getCurrency(), ChargeTimeType.WITHDRAWAL_FEE)); interopHelper.getCurrency(), ChargeTimeType.WITHDRAWAL_FEE));
Assert.assertNotNull(chargeId); Assertions.assertNotNull(chargeId);
} }
private void openSavingsAccount() { private void openSavingsAccount() {
LOG.debug("------------------------------ Create Interoperable Saving Account ---------------------------------------"); LOG.debug("------------------------------ Create Interoperable Saving Account ---------------------------------------");
savingsId = savingsAccountHelper.applyForSavingsApplicationWithExternalId(clientId, savingsProductId, ACCOUNT_TYPE_INDIVIDUAL, interopHelper.getAccountExternalId(), true); savingsId = savingsAccountHelper.applyForSavingsApplicationWithExternalId(clientId, savingsProductId, ACCOUNT_TYPE_INDIVIDUAL, interopHelper.getAccountExternalId(), true);
Assert.assertNotNull(savingsId); Assertions.assertNotNull(savingsId);
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId); HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
@@ -173,22 +173,22 @@ public class InteropTest {
private void testParties() { private void testParties() {
String idValue = UUID.randomUUID().toString(); String idValue = UUID.randomUUID().toString();
String accountId = interopHelper.postParty(InteropIdentifierType.MSISDN, idValue); String accountId = interopHelper.postParty(InteropIdentifierType.MSISDN, idValue);
Assert.assertEquals(interopHelper.getAccountExternalId(), accountId); Assertions.assertEquals(interopHelper.getAccountExternalId(), accountId);
interopHelper.setResponseSpec(responseErrorSpec); interopHelper.setResponseSpec(responseErrorSpec);
accountId = interopHelper.postParty(InteropIdentifierType.MSISDN, idValue); accountId = interopHelper.postParty(InteropIdentifierType.MSISDN, idValue);
Assert.assertNull(accountId); Assertions.assertNull(accountId);
interopHelper.setResponseSpec(responseSpec); interopHelper.setResponseSpec(responseSpec);
accountId = interopHelper.getParty(InteropIdentifierType.MSISDN, idValue); accountId = interopHelper.getParty(InteropIdentifierType.MSISDN, idValue);
Assert.assertEquals(interopHelper.getAccountExternalId(), accountId); Assertions.assertEquals(interopHelper.getAccountExternalId(), accountId);
accountId = interopHelper.deleteParty(InteropIdentifierType.MSISDN, idValue); accountId = interopHelper.deleteParty(InteropIdentifierType.MSISDN, idValue);
Assert.assertEquals(interopHelper.getAccountExternalId(), accountId); Assertions.assertEquals(interopHelper.getAccountExternalId(), accountId);
interopHelper.setResponseSpec(responseErrorSpec); interopHelper.setResponseSpec(responseErrorSpec);
accountId = interopHelper.getParty(InteropIdentifierType.MSISDN, idValue); accountId = interopHelper.getParty(InteropIdentifierType.MSISDN, idValue);
Assert.assertNull(accountId); Assertions.assertNull(accountId);
interopHelper.setResponseSpec(responseSpec); interopHelper.setResponseSpec(responseSpec);
} }
@@ -196,8 +196,8 @@ public class InteropTest {
requestCode = UUID.randomUUID().toString(); requestCode = UUID.randomUUID().toString();
String response = interopHelper.postTransactionRequest(requestCode, InteropTransactionRole.PAYER); String response = interopHelper.postTransactionRequest(requestCode, InteropTransactionRole.PAYER);
JsonPath json = JsonPath.from(response); JsonPath json = JsonPath.from(response);
Assert.assertEquals(requestCode, json.getString(InteropUtil.PARAM_REQUEST_CODE)); Assertions.assertEquals(requestCode, json.getString(InteropUtil.PARAM_REQUEST_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE)); Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
interopHelper.setResponseSpec(responseClientErrorSpec); interopHelper.setResponseSpec(responseClientErrorSpec);
interopHelper.postTransactionRequest(requestCode, InteropTransactionRole.PAYEE); interopHelper.postTransactionRequest(requestCode, InteropTransactionRole.PAYEE);
@@ -209,25 +209,25 @@ public class InteropTest {
quoteCode = UUID.randomUUID().toString(); quoteCode = UUID.randomUUID().toString();
String response = interopHelper.postQuote(quoteCode, InteropTransactionRole.PAYER); String response = interopHelper.postQuote(quoteCode, InteropTransactionRole.PAYER);
JsonPath json = JsonPath.from(response); JsonPath json = JsonPath.from(response);
Assert.assertEquals(quoteCode, json.getString(InteropUtil.PARAM_QUOTE_CODE)); Assertions.assertEquals(quoteCode, json.getString(InteropUtil.PARAM_QUOTE_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE)); Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
Map<Object, Object> fee = json.getMap(InteropUtil.PARAM_FSP_FEE); 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); 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)); Assertions.assertTrue(MathUtil.isEqualTo(interopHelper.getFee(), feeAmount), "Quote fee expected: " + interopHelper.getFee() + ", actual: " + feeAmount);
Assert.assertEquals(interopHelper.getCurrency(), fee.get(InteropUtil.PARAM_CURRENCY)); Assertions.assertEquals(interopHelper.getCurrency(), fee.get(InteropUtil.PARAM_CURRENCY));
// payee // payee
response = interopHelper.postQuote(quoteCode, InteropTransactionRole.PAYEE); response = interopHelper.postQuote(quoteCode, InteropTransactionRole.PAYEE);
json = JsonPath.from(response); json = JsonPath.from(response);
Assert.assertEquals(quoteCode, json.getString(InteropUtil.PARAM_QUOTE_CODE)); Assertions.assertEquals(quoteCode, json.getString(InteropUtil.PARAM_QUOTE_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE)); Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
fee = json.getMap(InteropUtil.PARAM_FSP_FEE); fee = json.getMap(InteropUtil.PARAM_FSP_FEE);
if (fee != null) { if (fee != null) {
feeAmount = ObjectConverter.convertObjectTo(fee.get(InteropUtil.PARAM_AMOUNT), BigDecimal.class); 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(); transferCode = UUID.randomUUID().toString();
String response = interopHelper.prepareTransfer(transferCode); String response = interopHelper.prepareTransfer(transferCode);
JsonPath json = JsonPath.from(response); JsonPath json = JsonPath.from(response);
Assert.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE)); Assertions.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE)); Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
// prepare // prepare
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null); savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
@@ -252,29 +252,29 @@ public class InteropTest {
BigDecimal transferAmount = interopHelper.getTransferAmount(); BigDecimal transferAmount = interopHelper.getTransferAmount();
BigDecimal expectedHold = MathUtil.add(onHold, transferAmount, MATHCONTEXT); 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); 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 // payer
response = interopHelper.createTransfer(transferCode, InteropTransactionRole.PAYER); response = interopHelper.createTransfer(transferCode, InteropTransactionRole.PAYER);
json = JsonPath.from(response); json = JsonPath.from(response);
Assert.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE)); Assertions.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE)); Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null); savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
LOG.debug("Response Interoperable GET Saving: {}", savings); LOG.debug("Response Interoperable GET Saving: {}", savings);
savingsJson = JsonPath.from(savings); savingsJson = JsonPath.from(savings);
BigDecimal onHold3 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class); BigDecimal onHold3 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class);
BigDecimal balance3 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), 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)); Assertions.assertTrue(MathUtil.isEqualTo(onHold, onHold3), "On hold amount expected: " + onHold + ", actual: " + onHold3);
Assert.assertTrue("Balance amount expected: " + expectedBalance + ", actual: " + balance3, MathUtil.isEqualTo(expectedBalance, balance3)); Assertions.assertTrue(MathUtil.isEqualTo(expectedBalance, balance3), "Balance amount expected: " + expectedBalance + ", actual: " + balance3);
// payee // payee
response = interopHelper.createTransfer(transferCode, InteropTransactionRole.PAYEE); response = interopHelper.createTransfer(transferCode, InteropTransactionRole.PAYEE);
json = JsonPath.from(response); json = JsonPath.from(response);
Assert.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE)); Assertions.assertEquals(transferCode, json.getString(InteropUtil.PARAM_TRANSFER_CODE));
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE)); Assertions.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null); savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
LOG.debug("Response Interoperable GET Saving: {}", savings); 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 onHold4 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class);
BigDecimal balance4 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class); BigDecimal balance4 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class);
expectedBalance = MathUtil.subtract(balance, interopHelper.getFee(), MATHCONTEXT); expectedBalance = MathUtil.subtract(balance, interopHelper.getFee(), MATHCONTEXT);
Assert.assertTrue("On hold amount expected: " + onHold + ", actual: " + onHold4, MathUtil.isEqualTo(onHold, onHold4)); Assertions.assertTrue(MathUtil.isEqualTo(onHold, onHold4), "On hold amount expected: " + onHold + ", actual: " + onHold4);
Assert.assertTrue("Balance amount expected: " + expectedBalance + ", actual: " + balance4, MathUtil.isEqualTo(balance, balance4)); Assertions.assertTrue(MathUtil.isEqualTo(balance, balance4), "Balance amount expected: " + expectedBalance + ", actual: " + balance4);
} }
} }
@@ -18,9 +18,9 @@
*/ */
package org.apache.fineract.integrationtests.loanaccount.guarantor; package org.apache.fineract.integrationtests.loanaccount.guarantor;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder; 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.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper; import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -62,7 +62,7 @@ public class GuarantorTest {
private final Float external1_guarantee = Float.valueOf((float)2000); private final Float external1_guarantee = Float.valueOf((float)2000);
private final Float external2_guarantee = Float.valueOf((float)1000); private final Float external2_guarantee = Float.valueOf((float)1000);
@Before @BeforeEach
public void setUp() throws Exception { public void setUp() throws Exception {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -100,17 +100,17 @@ public class GuarantorTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -7 * 4); todaysDate.add(Calendar.DAY_OF_MONTH, -7 * 4);
String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime()); String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE); final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
String guarantorJSON = new GuarantorTestBuilder().externalCustomer().build(); String guarantorJSON = new GuarantorTestBuilder().externalCustomer().build();
Integer externalGuarantor = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer externalGuarantor = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
Assert.assertNotNull(externalGuarantor); Assertions.assertNotNull(externalGuarantor);
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithoutGuaranteeAmount(String.valueOf(clientID_external)).build(); guarantorJSON = new GuarantorTestBuilder().existingCustomerWithoutGuaranteeAmount(String.valueOf(clientID_external)).build();
Integer withoutGuaranteeAmount = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); 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, ArrayList<HashMap> errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR); CommonConstants.RESPONSE_ERROR);
@@ -122,7 +122,7 @@ public class GuarantorTest {
String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build(); String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build();
Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(selfSavigsId, null); verifySavingsOnHoldBalance(selfSavigsId, null);
Assert.assertNotNull(selfGuarantee); Assertions.assertNotNull(selfGuarantee);
errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID, errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR); CommonConstants.RESPONSE_ERROR);
@@ -134,7 +134,7 @@ public class GuarantorTest {
String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build(); String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build();
Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_1, null); verifySavingsOnHoldBalance(externalSavigsId_1, null);
Assert.assertNotNull(externalGuarantee_1); Assertions.assertNotNull(externalGuarantee_1);
errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID, errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR); CommonConstants.RESPONSE_ERROR);
@@ -146,7 +146,7 @@ public class GuarantorTest {
String.valueOf(externalSavigsId_2), String.valueOf(external2_guarantee)).build(); String.valueOf(externalSavigsId_2), String.valueOf(external2_guarantee)).build();
Integer externalGuarantee_2 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer externalGuarantee_2 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_2, null); verifySavingsOnHoldBalance(externalSavigsId_2, null);
Assert.assertNotNull(externalGuarantee_2); Assertions.assertNotNull(externalGuarantee_2);
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID);
@@ -257,17 +257,17 @@ public class GuarantorTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -7 * 4); todaysDate.add(Calendar.DAY_OF_MONTH, -7 * 4);
String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime()); String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE); final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
String guarantorJSON = new GuarantorTestBuilder().externalCustomer().build(); String guarantorJSON = new GuarantorTestBuilder().externalCustomer().build();
Integer externalGuarantor = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer externalGuarantor = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
Assert.assertNotNull(externalGuarantor); Assertions.assertNotNull(externalGuarantor);
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithoutGuaranteeAmount(String.valueOf(clientID_external)).build(); guarantorJSON = new GuarantorTestBuilder().existingCustomerWithoutGuaranteeAmount(String.valueOf(clientID_external)).build();
Integer withoutGuaranteeAmount = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); 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, ArrayList<HashMap> errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR); CommonConstants.RESPONSE_ERROR);
@@ -279,7 +279,7 @@ public class GuarantorTest {
String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build(); String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build();
Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(selfSavigsId, null); verifySavingsOnHoldBalance(selfSavigsId, null);
Assert.assertNotNull(selfGuarantee); Assertions.assertNotNull(selfGuarantee);
errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID, errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR); CommonConstants.RESPONSE_ERROR);
@@ -291,7 +291,7 @@ public class GuarantorTest {
String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build(); String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build();
Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_1, null); verifySavingsOnHoldBalance(externalSavigsId_1, null);
Assert.assertNotNull(externalGuarantee_1); Assertions.assertNotNull(externalGuarantee_1);
errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID, errorData = (ArrayList<HashMap>) this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, null, loanID,
CommonConstants.RESPONSE_ERROR); CommonConstants.RESPONSE_ERROR);
@@ -302,7 +302,7 @@ public class GuarantorTest {
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external2), guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external2),
String.valueOf(externalSavigsId_2), String.valueOf(external2_guarantee)).build(); String.valueOf(externalSavigsId_2), String.valueOf(external2_guarantee)).build();
Integer externalGuarantee_2 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer externalGuarantee_2 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
Assert.assertNotNull(externalGuarantee_2); Assertions.assertNotNull(externalGuarantee_2);
verifySavingsOnHoldBalance(externalSavigsId_2, null); verifySavingsOnHoldBalance(externalSavigsId_2, null);
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
@@ -349,7 +349,7 @@ public class GuarantorTest {
String.valueOf(externalSavigsId_3), String.valueOf(external1_guarantee)).build(); String.valueOf(externalSavigsId_3), String.valueOf(external1_guarantee)).build();
Integer externalGuarantee_3 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer externalGuarantee_3 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_3, external1_guarantee); verifySavingsOnHoldBalance(externalSavigsId_3, external1_guarantee);
Assert.assertNotNull(externalGuarantee_3); Assertions.assertNotNull(externalGuarantee_3);
this.guarantorHelper.deleteGuarantor(externalGuarantee_1, fundDetailId, loanID); this.guarantorHelper.deleteGuarantor(externalGuarantee_1, fundDetailId, loanID);
guarantors = this.guarantorHelper.getAllGuarantor(loanID); guarantors = this.guarantorHelper.getAllGuarantor(loanID);
@@ -443,7 +443,7 @@ public class GuarantorTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -21); todaysDate.add(Calendar.DAY_OF_MONTH, -21);
String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime()); String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE); final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -451,13 +451,13 @@ public class GuarantorTest {
String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build(); String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build();
Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(selfSavigsId, null); verifySavingsOnHoldBalance(selfSavigsId, null);
Assert.assertNotNull(selfGuarantee); Assertions.assertNotNull(selfGuarantee);
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external), guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external),
String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build(); String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build();
Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_1, null); verifySavingsOnHoldBalance(externalSavigsId_1, null);
Assert.assertNotNull(externalGuarantee_1); Assertions.assertNotNull(externalGuarantee_1);
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID);
@@ -516,7 +516,7 @@ public class GuarantorTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -21); todaysDate.add(Calendar.DAY_OF_MONTH, -21);
String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime()); String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE); final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -524,13 +524,13 @@ public class GuarantorTest {
String.valueOf(selfSavigsId), String.valueOf(selfguarantee)).build(); String.valueOf(selfSavigsId), String.valueOf(selfguarantee)).build();
Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(selfSavigsId, null); verifySavingsOnHoldBalance(selfSavigsId, null);
Assert.assertNotNull(selfGuarantee); Assertions.assertNotNull(selfGuarantee);
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external), guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external),
String.valueOf(externalSavigsId_1), String.valueOf(externalguarantee)).build(); String.valueOf(externalSavigsId_1), String.valueOf(externalguarantee)).build();
Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(externalSavigsId_1, null); verifySavingsOnHoldBalance(externalSavigsId_1, null);
Assert.assertNotNull(externalGuarantee_1); Assertions.assertNotNull(externalGuarantee_1);
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID); loanStatusHashMap = this.loanTransactionHelper.approveLoan(LOAN_DISBURSEMENT_DATE, loanID);
@@ -585,7 +585,7 @@ public class GuarantorTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -21); todaysDate.add(Calendar.DAY_OF_MONTH, -21);
String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime()); String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE); final Integer loanID = applyForLoanApplication(clientID, loanProductID, LOAN_DISBURSEMENT_DATE);
Assert.assertNotNull(loanID); Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap); LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -593,12 +593,12 @@ public class GuarantorTest {
String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build(); String.valueOf(selfSavigsId), String.valueOf(self1_guarantee)).build();
Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer selfGuarantee = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
verifySavingsOnHoldBalance(selfSavigsId, null); verifySavingsOnHoldBalance(selfSavigsId, null);
Assert.assertNotNull(selfGuarantee); Assertions.assertNotNull(selfGuarantee);
guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external), guarantorJSON = new GuarantorTestBuilder().existingCustomerWithGuaranteeAmount(String.valueOf(clientID_external),
String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build(); String.valueOf(externalSavigsId_1), String.valueOf(external1_guarantee)).build();
Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON); Integer externalGuarantee_1 = this.guarantorHelper.createGuarantor(loanID, guarantorJSON);
Assert.assertNotNull(externalGuarantee_1); Assertions.assertNotNull(externalGuarantee_1);
verifySavingsOnHoldBalance(externalSavigsId_1, null); verifySavingsOnHoldBalance(externalSavigsId_1, null);
LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------"); LOG.info("-----------------------------------APPROVE LOAN-----------------------------------------");
@@ -635,15 +635,15 @@ public class GuarantorTest {
private void verifySavingsOnHoldBalance(final Integer savingsId, final Float expectedBalance) { private void verifySavingsOnHoldBalance(final Integer savingsId, final Float expectedBalance) {
Float onHoldAmount = (Float) this.savingsAccountHelper.getSavingsDetails(savingsId, "onHoldFunds"); 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" }) @SuppressWarnings({ "rawtypes", "cast" })
private void verifySavingsBalanceAndOnHoldBalance(final Integer savingsId, final Float expectedBalance, final Float accountBalance) { private void verifySavingsBalanceAndOnHoldBalance(final Integer savingsId, final Float expectedBalance, final Float accountBalance) {
HashMap savingsDetails = (HashMap) this.savingsAccountHelper.getSavingsDetails(savingsId); 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"); HashMap summary = (HashMap) savingsDetails.get("summary");
assertEquals("Verifying Account balance", accountBalance, summary.get("accountBalance")); assertEquals(accountBalance, summary.get("accountBalance"), "Verifying Account balance");
} }
@SuppressWarnings("rawtypes") @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.Utils;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker; import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.Assert; import org.junit.jupiter.api.Assertions;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -44,7 +44,7 @@ public class VariableInstallmentsIntegrationTest {
private ResponseSpecification responseSpec; private ResponseSpecification responseSpec;
private LoanTransactionHelper loanTransactionHelper; private LoanTransactionHelper loanTransactionHelper;
@Before @BeforeEach
public void setup() { public void setup() {
Utils.initializeRESTAssured(); Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
@@ -59,9 +59,9 @@ public class VariableInstallmentsIntegrationTest {
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(json); final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(json);
LOG.info("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------"); LOG.info("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------");
Map loanProduct = (Map)loanTransactionHelper.getLoanProductDetail(requestSpec, responseSpec, loanProductID, "") ; Map loanProduct = (Map)loanTransactionHelper.getLoanProductDetail(requestSpec, responseSpec, loanProductID, "") ;
Assert.assertTrue((Boolean)loanProduct.get("allowVariableInstallments")) ; Assertions.assertTrue((Boolean)loanProduct.get("allowVariableInstallments")) ;
Assert.assertEquals(Integer.valueOf(5), loanProduct.get("minimumGap")) ; Assertions.assertEquals(Integer.valueOf(5), loanProduct.get("minimumGap")) ;
Assert.assertEquals(Integer.valueOf(90), loanProduct.get("maximumGap")) ; Assertions.assertEquals(Integer.valueOf(90), loanProduct.get("maximumGap")) ;
} }
@@ -71,7 +71,7 @@ public class VariableInstallmentsIntegrationTest {
Integer loanProductID = this.loanTransactionHelper.getLoanProductId(josn); Integer loanProductID = this.loanTransactionHelper.getLoanProductId(josn);
LOG.info("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------"); LOG.info("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------");
Map loanProduct = (Map)loanTransactionHelper.getLoanProductDetail(requestSpec, responseSpec, loanProductID, "") ; Map loanProduct = (Map)loanTransactionHelper.getLoanProductDetail(requestSpec, responseSpec, loanProductID, "") ;
Assert.assertTrue(!(Boolean)loanProduct.get("allowVariableInstallments")) ; Assertions.assertTrue(!(Boolean)loanProduct.get("allowVariableInstallments")) ;
} }
@Test @Test
@@ -106,12 +106,12 @@ public class VariableInstallmentsIntegrationTest {
} }
private void assertAfterSubmit(ArrayList<Map> serverData, ArrayList<Map> expectedData) { 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++) { for(int i = 0 ; i < serverData.size(); i++) {
Map<String, Object> serverMap = serverData.get(i) ; Map<String, Object> serverMap = serverData.get(i) ;
Map<String, Object> expectedMap = expectedData.get(i) ; Map<String, Object> expectedMap = expectedData.get(i) ;
Assert.assertTrue(VariableInstallmentsDecliningBalanceHelper.formatDate((ArrayList)serverMap.get("dueDate")).equals(expectedMap.get("dueDate"))) ; Assertions.assertTrue(VariableInstallmentsDecliningBalanceHelper.formatDate((ArrayList)serverMap.get("dueDate")).equals(expectedMap.get("dueDate"))) ;
Assert.assertTrue(serverMap.get("totalOutstandingForPeriod").toString().equals(expectedMap.get("installmentAmount"))) ; 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