mirror of
https://github.com/openMF/mifos-mobile.git
synced 2026-02-06 11:26:51 +00:00
Merge pull request #324 from dilpreet96/accounts_test
feat: AccountsPresenter Test
This commit is contained in:
commit
3bfc94a0ce
@ -37,6 +37,17 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
def commonTestDir = 'src/commonTest/java'
|
||||
androidTest {
|
||||
java.srcDir commonTestDir
|
||||
}
|
||||
test {
|
||||
java.srcDir commonTestDir
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions.incremental = false
|
||||
|
||||
lintOptions {
|
||||
@ -48,7 +59,6 @@ android {
|
||||
dependencies {
|
||||
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
testCompile 'junit:junit:4.12'
|
||||
|
||||
apt "com.github.Raizlabs.DBFlow:dbflow-processor:$rootProject.dbflowVersion"
|
||||
compile "com.github.Raizlabs.DBFlow:dbflow-core:$rootProject.dbflowVersion"
|
||||
@ -87,4 +97,8 @@ dependencies {
|
||||
}
|
||||
//Charts
|
||||
compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
|
||||
|
||||
// Unit tests dependencies
|
||||
testCompile "junit:junit:$rootProject.jUnitVersion"
|
||||
testCompile "org.mockito:mockito-core:$rootProject.mockitoVersion"
|
||||
}
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package org.mifos.selfserviceapp;
|
||||
|
||||
/**
|
||||
* Created by dilpreet on 26/6/17.
|
||||
*/
|
||||
|
||||
public class FakeJsonName {
|
||||
|
||||
public static final String CLIENT_ACCOUNTS_JSON = "clientAccounts.json";
|
||||
|
||||
public static final String CLIENT_SAVINGS_ACCOUNT_JSON = "clientSavingsAccounts.json";
|
||||
|
||||
public static final String CLIENT_LOAN_ACCOUNT_JSON = "clientLoanAccounts.json";
|
||||
|
||||
public static final String CLIENT_SHARE_ACCOUNT_JSON = "clientShareAccounts.json";
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package org.mifos.selfserviceapp;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import org.mifos.selfserviceapp.models.client.ClientAccounts;
|
||||
|
||||
/**
|
||||
* Created by dilpreet on 26/6/17.
|
||||
*/
|
||||
|
||||
public class FakeRemoteDataSource {
|
||||
|
||||
private static TestDataFactory mTestDataFactory = new TestDataFactory();
|
||||
|
||||
public static ClientAccounts getClientAccounts() {
|
||||
return mTestDataFactory.getListTypePojo(new TypeToken<ClientAccounts>() {
|
||||
}, FakeJsonName.CLIENT_ACCOUNTS_JSON);
|
||||
}
|
||||
|
||||
public static ClientAccounts getClientSavingsAccount() {
|
||||
return mTestDataFactory.getObjectTypePojo(ClientAccounts.class,
|
||||
FakeJsonName.CLIENT_SAVINGS_ACCOUNT_JSON);
|
||||
}
|
||||
|
||||
public static ClientAccounts getClientLoanAccount() {
|
||||
return mTestDataFactory.getObjectTypePojo(ClientAccounts.class,
|
||||
FakeJsonName.CLIENT_LOAN_ACCOUNT_JSON);
|
||||
}
|
||||
|
||||
public static ClientAccounts getClientShareAccount() {
|
||||
return mTestDataFactory.getObjectTypePojo(ClientAccounts.class,
|
||||
FakeJsonName.CLIENT_SHARE_ACCOUNT_JSON);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package org.mifos.selfserviceapp;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
/**
|
||||
* Created by dilpreet on 26/6/17.
|
||||
*/
|
||||
|
||||
public class TestDataFactory {
|
||||
|
||||
|
||||
/**
|
||||
* Note : This Generic Method DeSerialize Only Json Object in POJO
|
||||
* <p/>
|
||||
* Note : Do Not use Array [] in POJO classes for of any element initialization,
|
||||
* Use Instead ArrayList.
|
||||
*
|
||||
* @param model Class of the Model of the Pojo
|
||||
* @param jsonName Name of Json file in test/resource
|
||||
* @param <T> Return type
|
||||
* @return Return the Object Type model by Deserializing the Json of resources
|
||||
* @Example Of Deserializing Object Type Json
|
||||
* <p/>
|
||||
* Object object = mTestDataFactory.getListTypePojo(
|
||||
* new TypeToken<Object>(){}, "Object.json")
|
||||
*/
|
||||
public <T> T getObjectTypePojo(Class<T> model, String jsonName) {
|
||||
|
||||
InputStream in = getClass().getClassLoader().getResourceAsStream(jsonName);
|
||||
JsonReader reader = new JsonReader(new InputStreamReader(in));
|
||||
T jsonModel = new Gson().fromJson(reader, model);
|
||||
return jsonModel;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Note : This Generic Method DeSerialize Both Object and List Type Json in POJO
|
||||
* <p/>
|
||||
* Note : Do Not use Array [] in POJO classes for of any element initialization,
|
||||
* Use Instead ArrayList.
|
||||
*
|
||||
* @param listModel Class of the List Model
|
||||
* @param jsonName Name of the Json in resources
|
||||
* @param <T> return type
|
||||
* @return Return the List of the listModel by Deserializing the Json of resources
|
||||
* @Example of Deserializing List Type Json
|
||||
* <p/>
|
||||
* TestDataFactory mTestDataFactory = new TestDataFactory();
|
||||
* <p/>
|
||||
* List<Object> listObject = mTestDataFactory.getListTypePojo(
|
||||
* new TypeToken<List<Object>>(){}, "ListObject.json")
|
||||
* @Example Of Deserializing Object Type Json
|
||||
* <p/>
|
||||
* Object object = mTestDataFactory.getListTypePojo(
|
||||
* new TypeToken<Object>(){}, "Object.json")
|
||||
*/
|
||||
public <T> T getListTypePojo(TypeToken<T> listModel, String jsonName) {
|
||||
|
||||
InputStream in = getClass().getClassLoader().getResourceAsStream(jsonName);
|
||||
JsonReader reader = new JsonReader(new InputStreamReader(in));
|
||||
T listJsonModel = new Gson().fromJson(reader, listModel.getType());
|
||||
return listJsonModel;
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package org.mifos.selfserviceapp;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mifos.selfserviceapp.api.DataManager;
|
||||
import org.mifos.selfserviceapp.models.client.ClientAccounts;
|
||||
import org.mifos.selfserviceapp.presenters.AccountsPresenter;
|
||||
import org.mifos.selfserviceapp.ui.views.AccountsView;
|
||||
import org.mifos.selfserviceapp.util.RxSchedulersOverrideRule;
|
||||
import org.mifos.selfserviceapp.utils.Constants;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
import rx.Observable;
|
||||
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* Created by dilpreet on 26/6/17.
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class AccountsPresenterTest {
|
||||
|
||||
@Rule
|
||||
public final RxSchedulersOverrideRule mOverrideSchedulersRule = new RxSchedulersOverrideRule();
|
||||
|
||||
@Mock
|
||||
Context context;
|
||||
|
||||
@Mock
|
||||
DataManager dataManager;
|
||||
|
||||
@Mock
|
||||
AccountsView accountsView;
|
||||
|
||||
private AccountsPresenter presenter;
|
||||
private ClientAccounts accounts, savingsAccount, loanAccounts, shareAccounts;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
presenter = new AccountsPresenter(context, dataManager);
|
||||
presenter.attachView(accountsView);
|
||||
|
||||
accounts = FakeRemoteDataSource.getClientAccounts();
|
||||
savingsAccount = FakeRemoteDataSource.getClientSavingsAccount();
|
||||
loanAccounts = FakeRemoteDataSource.getClientLoanAccount();
|
||||
shareAccounts = FakeRemoteDataSource.getClientShareAccount();
|
||||
|
||||
when(context.getString(R.string.error_fetching_accounts)).
|
||||
thenReturn("Failed to fetch Accounts");
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
presenter.detachView();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadClientAccounts() {
|
||||
when(dataManager.getClientAccounts()).thenReturn(Observable.just(accounts));
|
||||
|
||||
presenter.loadClientAccounts();
|
||||
|
||||
verify(accountsView).showProgress();
|
||||
verify(accountsView).hideProgress();
|
||||
verify(accountsView).showSavingsAccounts(accounts.getSavingsAccounts());
|
||||
verify(accountsView).showLoanAccounts(accounts.getLoanAccounts());
|
||||
verify(accountsView).showShareAccounts(accounts.getShareAccounts());
|
||||
verify(accountsView, never()).showError(context.getString(R.string.
|
||||
error_fetching_accounts));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadClientAccountsFail() {
|
||||
when(dataManager.getClientAccounts()).thenReturn(Observable.<ClientAccounts>error(new
|
||||
RuntimeException()));
|
||||
presenter.loadClientAccounts();
|
||||
|
||||
verify(accountsView).showProgress();
|
||||
verify(accountsView).hideProgress();
|
||||
verify(accountsView).showError(context.getString(R.string.
|
||||
error_fetching_accounts));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadClientSavingsAccount() {
|
||||
when(dataManager.getAccounts(Constants.SAVINGS_ACCOUNTS)).
|
||||
thenReturn(Observable.just(savingsAccount));
|
||||
|
||||
presenter.loadAccounts(Constants.SAVINGS_ACCOUNTS);
|
||||
|
||||
verify(accountsView).showProgress();
|
||||
verify(accountsView).hideProgress();
|
||||
verify(accountsView).showSavingsAccounts(savingsAccount.getSavingsAccounts());
|
||||
verify(accountsView, never()).showLoanAccounts(null);
|
||||
verify(accountsView, never()).showShareAccounts(null);
|
||||
verify(accountsView, never()).showError(context.getString(R.string.
|
||||
error_fetching_accounts));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadClientLoanAccount() {
|
||||
when(dataManager.getAccounts(Constants.LOAN_ACCOUNTS)).
|
||||
thenReturn(Observable.just(loanAccounts));
|
||||
|
||||
presenter.loadAccounts(Constants.LOAN_ACCOUNTS);
|
||||
|
||||
verify(accountsView).showProgress();
|
||||
verify(accountsView).hideProgress();
|
||||
verify(accountsView).showLoanAccounts(loanAccounts.getLoanAccounts());
|
||||
verify(accountsView, never()).showSavingsAccounts(null);
|
||||
verify(accountsView, never()).showShareAccounts(null);
|
||||
verify(accountsView, never()).showError(context.getString(R.string.
|
||||
error_fetching_accounts));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadClientShareAccount() {
|
||||
when(dataManager.getAccounts(Constants.SHARE_ACCOUNTS)).
|
||||
thenReturn(Observable.just(shareAccounts));
|
||||
|
||||
presenter.loadAccounts(Constants.SHARE_ACCOUNTS);
|
||||
|
||||
verify(accountsView).showProgress();
|
||||
verify(accountsView).hideProgress();
|
||||
verify(accountsView).showShareAccounts(shareAccounts.getShareAccounts());
|
||||
verify(accountsView, never()).showLoanAccounts(null);
|
||||
verify(accountsView, never()).showSavingsAccounts(null);
|
||||
verify(accountsView, never()).showError(context.getString(R.string.
|
||||
error_fetching_accounts));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package org.mifos.selfserviceapp;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* To work on unit tests, switch the Test Artifact in the Build Variants view.
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void additionIsCorrect() throws Exception {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package org.mifos.selfserviceapp.util;
|
||||
|
||||
import org.junit.rules.TestRule;
|
||||
import org.junit.runner.Description;
|
||||
import org.junit.runners.model.Statement;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import rx.Scheduler;
|
||||
import rx.android.plugins.RxAndroidPlugins;
|
||||
import rx.android.plugins.RxAndroidSchedulersHook;
|
||||
import rx.plugins.RxJavaPlugins;
|
||||
import rx.plugins.RxJavaSchedulersHook;
|
||||
import rx.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* This rule registers SchedulerHooks for RxJava and RxAndroid to ensure that subscriptions
|
||||
* always subscribeOn and observeOn Schedulers.immediate().
|
||||
* Warning, this rule will reset RxAndroidPlugins and RxJavaPlugins before and after each test so
|
||||
* if the application code uses RxJava plugins this may affect the behaviour of the testing method.
|
||||
*/
|
||||
public class RxSchedulersOverrideRule implements TestRule {
|
||||
|
||||
private final RxJavaSchedulersHook mRxJavaSchedulersHook = new RxJavaSchedulersHook() {
|
||||
@Override
|
||||
public Scheduler getIOScheduler() {
|
||||
return Schedulers.immediate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Scheduler getNewThreadScheduler() {
|
||||
return Schedulers.immediate();
|
||||
}
|
||||
};
|
||||
|
||||
private final RxAndroidSchedulersHook mRxAndroidSchedulersHook = new RxAndroidSchedulersHook() {
|
||||
@Override
|
||||
public Scheduler getMainThreadScheduler() {
|
||||
return Schedulers.immediate();
|
||||
}
|
||||
};
|
||||
|
||||
// Hack to get around RxJavaPlugins.reset() not being public
|
||||
// See https://github.com/ReactiveX/RxJava/issues/2297
|
||||
// Hopefully the method will be public in new releases of RxAndroid and we can remove the hack.
|
||||
private void callResetViaReflectionIn(RxJavaPlugins rxJavaPlugins)
|
||||
throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
|
||||
Method method = rxJavaPlugins.getClass().getDeclaredMethod("reset");
|
||||
method.setAccessible(true);
|
||||
method.invoke(rxJavaPlugins);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement apply(final Statement base, Description description) {
|
||||
return new Statement() {
|
||||
@Override
|
||||
public void evaluate() throws Throwable {
|
||||
RxAndroidPlugins.getInstance().reset();
|
||||
RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);
|
||||
callResetViaReflectionIn(RxJavaPlugins.getInstance());
|
||||
RxJavaPlugins.getInstance().registerSchedulersHook(mRxJavaSchedulersHook);
|
||||
|
||||
base.evaluate();
|
||||
|
||||
RxAndroidPlugins.getInstance().reset();
|
||||
callResetViaReflectionIn(RxJavaPlugins.getInstance());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
553
app/src/test/resources/clientAccounts.json
Normal file
553
app/src/test/resources/clientAccounts.json
Normal file
@ -0,0 +1,553 @@
|
||||
{
|
||||
"savingsAccounts": [
|
||||
{
|
||||
"id": 21,
|
||||
"accountNo": "000000021",
|
||||
"externalId": "63723612",
|
||||
"productId": 1,
|
||||
"productName": "Voluntary savings",
|
||||
"shortProductName": "VS",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "savingsAccountStatusType.active",
|
||||
"value": "Active",
|
||||
"submittedAndPendingApproval": false,
|
||||
"approved": false,
|
||||
"rejected": false,
|
||||
"withdrawnByApplicant": false,
|
||||
"active": true,
|
||||
"closed": false,
|
||||
"prematureClosed": false,
|
||||
"transferInProgress": false,
|
||||
"transferOnHold": false,
|
||||
"matured": false
|
||||
},
|
||||
"currency": {
|
||||
"code": "USD",
|
||||
"name": "US Dollar",
|
||||
"decimalPlaces": 2,
|
||||
"inMultiplesOf": 0,
|
||||
"displaySymbol": "$",
|
||||
"nameCode": "currency.USD",
|
||||
"displayLabel": "US Dollar ($)"
|
||||
},
|
||||
"accountBalance": 118393.150000,
|
||||
"accountType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"activatedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
]
|
||||
},
|
||||
"subStatus": {
|
||||
"id": 0,
|
||||
"code": "SavingsAccountSubStatusEnum.none",
|
||||
"value": "None",
|
||||
"none": true,
|
||||
"inactive": false,
|
||||
"dormant": false,
|
||||
"escheat": false
|
||||
},
|
||||
"lastActiveTransactionDate": [
|
||||
2017,
|
||||
6,
|
||||
25
|
||||
],
|
||||
"depositType": {
|
||||
"id": 100,
|
||||
"code": "depositAccountType.savingsDeposit",
|
||||
"value": "Savings"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"accountNo": "000000022",
|
||||
"externalId": "8291847",
|
||||
"productId": 1,
|
||||
"productName": "Voluntary savings",
|
||||
"shortProductName": "VS",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "savingsAccountStatusType.active",
|
||||
"value": "Active",
|
||||
"submittedAndPendingApproval": false,
|
||||
"approved": false,
|
||||
"rejected": false,
|
||||
"withdrawnByApplicant": false,
|
||||
"active": true,
|
||||
"closed": false,
|
||||
"prematureClosed": false,
|
||||
"transferInProgress": false,
|
||||
"transferOnHold": false,
|
||||
"matured": false
|
||||
},
|
||||
"currency": {
|
||||
"code": "USD",
|
||||
"name": "US Dollar",
|
||||
"decimalPlaces": 2,
|
||||
"inMultiplesOf": 0,
|
||||
"displaySymbol": "$",
|
||||
"nameCode": "currency.USD",
|
||||
"displayLabel": "US Dollar ($)"
|
||||
},
|
||||
"accountBalance": 19930.520000,
|
||||
"accountType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"activatedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
]
|
||||
},
|
||||
"subStatus": {
|
||||
"id": 0,
|
||||
"code": "SavingsAccountSubStatusEnum.none",
|
||||
"value": "None",
|
||||
"none": true,
|
||||
"inactive": false,
|
||||
"dormant": false,
|
||||
"escheat": false
|
||||
},
|
||||
"lastActiveTransactionDate": [
|
||||
2017,
|
||||
6,
|
||||
25
|
||||
],
|
||||
"depositType": {
|
||||
"id": 100,
|
||||
"code": "depositAccountType.savingsDeposit",
|
||||
"value": "Savings"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 23,
|
||||
"accountNo": "000000023",
|
||||
"externalId": "42414",
|
||||
"productId": 1,
|
||||
"productName": "Voluntary savings",
|
||||
"shortProductName": "VS",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "savingsAccountStatusType.active",
|
||||
"value": "Active",
|
||||
"submittedAndPendingApproval": false,
|
||||
"approved": false,
|
||||
"rejected": false,
|
||||
"withdrawnByApplicant": false,
|
||||
"active": true,
|
||||
"closed": false,
|
||||
"prematureClosed": false,
|
||||
"transferInProgress": false,
|
||||
"transferOnHold": false,
|
||||
"matured": false
|
||||
},
|
||||
"currency": {
|
||||
"code": "USD",
|
||||
"name": "US Dollar",
|
||||
"decimalPlaces": 2,
|
||||
"inMultiplesOf": 0,
|
||||
"displaySymbol": "$",
|
||||
"nameCode": "currency.USD",
|
||||
"displayLabel": "US Dollar ($)"
|
||||
},
|
||||
"accountBalance": 3117780552329.610000,
|
||||
"accountType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"activatedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
]
|
||||
},
|
||||
"subStatus": {
|
||||
"id": 0,
|
||||
"code": "SavingsAccountSubStatusEnum.none",
|
||||
"value": "None",
|
||||
"none": true,
|
||||
"inactive": false,
|
||||
"dormant": false,
|
||||
"escheat": false
|
||||
},
|
||||
"lastActiveTransactionDate": [
|
||||
2017,
|
||||
4,
|
||||
7
|
||||
],
|
||||
"depositType": {
|
||||
"id": 100,
|
||||
"code": "depositAccountType.savingsDeposit",
|
||||
"value": "Savings"
|
||||
}
|
||||
}
|
||||
],
|
||||
"loanAccounts": [{
|
||||
"id": 27,
|
||||
"accountNo": "000000027",
|
||||
"externalId": "34478914",
|
||||
"productId": 2,
|
||||
"productName": "For Prepay - Calculate till preclosure date",
|
||||
"shortProductName": "CTPC",
|
||||
"status": {
|
||||
"id": 700,
|
||||
"code": "loanStatusType.overpaid",
|
||||
"value": "Overpaid",
|
||||
"pendingApproval": false,
|
||||
"waitingForDisbursal": false,
|
||||
"active": false,
|
||||
"closedObligationsMet": false,
|
||||
"closedWrittenOff": false,
|
||||
"closedRescheduled": false,
|
||||
"closed": false,
|
||||
"overpaid": true
|
||||
},
|
||||
"loanType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"loanCycle": 1,
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
11,
|
||||
6
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"expectedDisbursementDate": [
|
||||
2017,
|
||||
9,
|
||||
7
|
||||
],
|
||||
"actualDisbursementDate": [
|
||||
2016,
|
||||
11,
|
||||
23
|
||||
],
|
||||
"disbursedByUsername": "mifos",
|
||||
"disbursedByFirstname": "App",
|
||||
"disbursedByLastname": "Administrator",
|
||||
"expectedMaturityDate": [
|
||||
2017,
|
||||
1,
|
||||
9
|
||||
]
|
||||
},
|
||||
"inArrears": false,
|
||||
"originalLoan": 10000.000000,
|
||||
"amountPaid": 10125.810000
|
||||
},
|
||||
{
|
||||
"id": 28,
|
||||
"accountNo": "000000028",
|
||||
"productId": 4,
|
||||
"productName": "BGS Prepay Loan",
|
||||
"shortProductName": "BPL",
|
||||
"status": {
|
||||
"id": 700,
|
||||
"code": "loanStatusType.overpaid",
|
||||
"value": "Overpaid",
|
||||
"pendingApproval": false,
|
||||
"waitingForDisbursal": false,
|
||||
"active": false,
|
||||
"closedObligationsMet": false,
|
||||
"closedWrittenOff": false,
|
||||
"closedRescheduled": false,
|
||||
"closed": false,
|
||||
"overpaid": true
|
||||
},
|
||||
"loanType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"loanCycle": 1,
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"expectedDisbursementDate": [
|
||||
2017,
|
||||
11,
|
||||
3
|
||||
],
|
||||
"actualDisbursementDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"disbursedByUsername": "mifos",
|
||||
"disbursedByFirstname": "App",
|
||||
"disbursedByLastname": "Administrator",
|
||||
"expectedMaturityDate": [
|
||||
2016,
|
||||
11,
|
||||
3
|
||||
]
|
||||
},
|
||||
"inArrears": false,
|
||||
"originalLoan": 2000.000000,
|
||||
"amountPaid": 3180.000000
|
||||
},
|
||||
{
|
||||
"id": 29,
|
||||
"accountNo": "000000029",
|
||||
"externalId": "342342",
|
||||
"productId": 3,
|
||||
"productName": "For Preclose- Calculate till rest frequency date",
|
||||
"shortProductName": "CTRF",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "loanStatusType.active",
|
||||
"value": "Active",
|
||||
"pendingApproval": false,
|
||||
"waitingForDisbursal": false,
|
||||
"active": true,
|
||||
"closedObligationsMet": false,
|
||||
"closedWrittenOff": false,
|
||||
"closedRescheduled": false,
|
||||
"closed": false,
|
||||
"overpaid": false
|
||||
},
|
||||
"loanType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"loanCycle": 1,
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"expectedDisbursementDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"actualDisbursementDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"disbursedByUsername": "mifos",
|
||||
"disbursedByFirstname": "App",
|
||||
"disbursedByLastname": "Administrator",
|
||||
"expectedMaturityDate": [
|
||||
2017,
|
||||
10,
|
||||
3
|
||||
]
|
||||
},
|
||||
"inArrears": false,
|
||||
"originalLoan": 10000.000000,
|
||||
"loanBalance": 6331.460000,
|
||||
"amountPaid": 4478.450000
|
||||
}
|
||||
],
|
||||
"shareAccounts": [
|
||||
{
|
||||
"id": 14,
|
||||
"accountNo": "000000014",
|
||||
"totalApprovedShares": 10,
|
||||
"totalPendingForApprovalShares": 0,
|
||||
"productId": 2,
|
||||
"productName": "SPTest",
|
||||
"shortProductName": "SPT",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "shareAccountStatusType.active",
|
||||
"value": "Active",
|
||||
"submittedAndPendingApproval": false,
|
||||
"approved": false,
|
||||
"rejected": false,
|
||||
"active": true,
|
||||
"closed": false
|
||||
},
|
||||
"currency": {
|
||||
"code": "USD",
|
||||
"name": "US Dollar",
|
||||
"decimalPlaces": 2,
|
||||
"inMultiplesOf": 1,
|
||||
"displaySymbol": "$",
|
||||
"nameCode": "currency.USD",
|
||||
"displayLabel": "US Dollar ($)"
|
||||
},
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"activatedDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"activatedByUsername": "mifos",
|
||||
"activatedByFirstname": "App",
|
||||
"activatedByLastname": "Administrator"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"accountNo": "000000015",
|
||||
"totalApprovedShares": 10,
|
||||
"totalPendingForApprovalShares": 0,
|
||||
"productId": 2,
|
||||
"productName": "SPTest",
|
||||
"shortProductName": "SPT",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "shareAccountStatusType.active",
|
||||
"value": "Active",
|
||||
"submittedAndPendingApproval": false,
|
||||
"approved": false,
|
||||
"rejected": false,
|
||||
"active": true,
|
||||
"closed": false
|
||||
},
|
||||
"currency": {
|
||||
"code": "USD",
|
||||
"name": "US Dollar",
|
||||
"decimalPlaces": 2,
|
||||
"inMultiplesOf": 1,
|
||||
"displaySymbol": "$",
|
||||
"nameCode": "currency.USD",
|
||||
"displayLabel": "US Dollar ($)"
|
||||
},
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"activatedDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"activatedByUsername": "mifos",
|
||||
"activatedByFirstname": "App",
|
||||
"activatedByLastname": "Administrator"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
201
app/src/test/resources/clientLoanAccounts.json
Normal file
201
app/src/test/resources/clientLoanAccounts.json
Normal file
@ -0,0 +1,201 @@
|
||||
{
|
||||
"loanAccounts": [
|
||||
{
|
||||
"id": 27,
|
||||
"accountNo": "000000027",
|
||||
"externalId": "34478914",
|
||||
"productId": 2,
|
||||
"productName": "For Prepay - Calculate till preclosure date",
|
||||
"shortProductName": "CTPC",
|
||||
"status": {
|
||||
"id": 700,
|
||||
"code": "loanStatusType.overpaid",
|
||||
"value": "Overpaid",
|
||||
"pendingApproval": false,
|
||||
"waitingForDisbursal": false,
|
||||
"active": false,
|
||||
"closedObligationsMet": false,
|
||||
"closedWrittenOff": false,
|
||||
"closedRescheduled": false,
|
||||
"closed": false,
|
||||
"overpaid": true
|
||||
},
|
||||
"loanType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"loanCycle": 1,
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
11,
|
||||
6
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"expectedDisbursementDate": [
|
||||
2017,
|
||||
9,
|
||||
7
|
||||
],
|
||||
"actualDisbursementDate": [
|
||||
2016,
|
||||
11,
|
||||
23
|
||||
],
|
||||
"disbursedByUsername": "mifos",
|
||||
"disbursedByFirstname": "App",
|
||||
"disbursedByLastname": "Administrator",
|
||||
"expectedMaturityDate": [
|
||||
2017,
|
||||
1,
|
||||
9
|
||||
]
|
||||
},
|
||||
"inArrears": false,
|
||||
"originalLoan": 10000.000000,
|
||||
"amountPaid": 10125.810000
|
||||
},
|
||||
{
|
||||
"id": 28,
|
||||
"accountNo": "000000028",
|
||||
"productId": 4,
|
||||
"productName": "BGS Prepay Loan",
|
||||
"shortProductName": "BPL",
|
||||
"status": {
|
||||
"id": 700,
|
||||
"code": "loanStatusType.overpaid",
|
||||
"value": "Overpaid",
|
||||
"pendingApproval": false,
|
||||
"waitingForDisbursal": false,
|
||||
"active": false,
|
||||
"closedObligationsMet": false,
|
||||
"closedWrittenOff": false,
|
||||
"closedRescheduled": false,
|
||||
"closed": false,
|
||||
"overpaid": true
|
||||
},
|
||||
"loanType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"loanCycle": 1,
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"expectedDisbursementDate": [
|
||||
2017,
|
||||
11,
|
||||
3
|
||||
],
|
||||
"actualDisbursementDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"disbursedByUsername": "mifos",
|
||||
"disbursedByFirstname": "App",
|
||||
"disbursedByLastname": "Administrator",
|
||||
"expectedMaturityDate": [
|
||||
2016,
|
||||
11,
|
||||
3
|
||||
]
|
||||
},
|
||||
"inArrears": false,
|
||||
"originalLoan": 2000.000000,
|
||||
"amountPaid": 3180.000000
|
||||
},
|
||||
{
|
||||
"id": 29,
|
||||
"accountNo": "000000029",
|
||||
"externalId": "342342",
|
||||
"productId": 3,
|
||||
"productName": "For Preclose- Calculate till rest frequency date",
|
||||
"shortProductName": "CTRF",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "loanStatusType.active",
|
||||
"value": "Active",
|
||||
"pendingApproval": false,
|
||||
"waitingForDisbursal": false,
|
||||
"active": true,
|
||||
"closedObligationsMet": false,
|
||||
"closedWrittenOff": false,
|
||||
"closedRescheduled": false,
|
||||
"closed": false,
|
||||
"overpaid": false
|
||||
},
|
||||
"loanType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"loanCycle": 1,
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"expectedDisbursementDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"actualDisbursementDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"disbursedByUsername": "mifos",
|
||||
"disbursedByFirstname": "App",
|
||||
"disbursedByLastname": "Administrator",
|
||||
"expectedMaturityDate": [
|
||||
2017,
|
||||
10,
|
||||
3
|
||||
]
|
||||
},
|
||||
"inArrears": false,
|
||||
"originalLoan": 10000.000000,
|
||||
"loanBalance": 6331.460000,
|
||||
"amountPaid": 4478.450000
|
||||
}
|
||||
]}
|
||||
243
app/src/test/resources/clientSavingsAccounts.json
Normal file
243
app/src/test/resources/clientSavingsAccounts.json
Normal file
@ -0,0 +1,243 @@
|
||||
{
|
||||
"savingsAccounts": [{
|
||||
"id": 21,
|
||||
"accountNo": "000000021",
|
||||
"externalId": "63723612",
|
||||
"productId": 1,
|
||||
"productName": "Voluntary savings",
|
||||
"shortProductName": "VS",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "savingsAccountStatusType.active",
|
||||
"value": "Active",
|
||||
"submittedAndPendingApproval": false,
|
||||
"approved": false,
|
||||
"rejected": false,
|
||||
"withdrawnByApplicant": false,
|
||||
"active": true,
|
||||
"closed": false,
|
||||
"prematureClosed": false,
|
||||
"transferInProgress": false,
|
||||
"transferOnHold": false,
|
||||
"matured": false
|
||||
},
|
||||
"currency": {
|
||||
"code": "USD",
|
||||
"name": "US Dollar",
|
||||
"decimalPlaces": 2,
|
||||
"inMultiplesOf": 0,
|
||||
"displaySymbol": "$",
|
||||
"nameCode": "currency.USD",
|
||||
"displayLabel": "US Dollar ($)"
|
||||
},
|
||||
"accountBalance": 118393.150000,
|
||||
"accountType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"activatedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
]
|
||||
},
|
||||
"subStatus": {
|
||||
"id": 0,
|
||||
"code": "SavingsAccountSubStatusEnum.none",
|
||||
"value": "None",
|
||||
"none": true,
|
||||
"inactive": false,
|
||||
"dormant": false,
|
||||
"escheat": false
|
||||
},
|
||||
"lastActiveTransactionDate": [
|
||||
2017,
|
||||
6,
|
||||
25
|
||||
],
|
||||
"depositType": {
|
||||
"id": 100,
|
||||
"code": "depositAccountType.savingsDeposit",
|
||||
"value": "Savings"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"accountNo": "000000022",
|
||||
"externalId": "8291847",
|
||||
"productId": 1,
|
||||
"productName": "Voluntary savings",
|
||||
"shortProductName": "VS",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "savingsAccountStatusType.active",
|
||||
"value": "Active",
|
||||
"submittedAndPendingApproval": false,
|
||||
"approved": false,
|
||||
"rejected": false,
|
||||
"withdrawnByApplicant": false,
|
||||
"active": true,
|
||||
"closed": false,
|
||||
"prematureClosed": false,
|
||||
"transferInProgress": false,
|
||||
"transferOnHold": false,
|
||||
"matured": false
|
||||
},
|
||||
"currency": {
|
||||
"code": "USD",
|
||||
"name": "US Dollar",
|
||||
"decimalPlaces": 2,
|
||||
"inMultiplesOf": 0,
|
||||
"displaySymbol": "$",
|
||||
"nameCode": "currency.USD",
|
||||
"displayLabel": "US Dollar ($)"
|
||||
},
|
||||
"accountBalance": 19930.520000,
|
||||
"accountType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"activatedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
]
|
||||
},
|
||||
"subStatus": {
|
||||
"id": 0,
|
||||
"code": "SavingsAccountSubStatusEnum.none",
|
||||
"value": "None",
|
||||
"none": true,
|
||||
"inactive": false,
|
||||
"dormant": false,
|
||||
"escheat": false
|
||||
},
|
||||
"lastActiveTransactionDate": [
|
||||
2017,
|
||||
6,
|
||||
25
|
||||
],
|
||||
"depositType": {
|
||||
"id": 100,
|
||||
"code": "depositAccountType.savingsDeposit",
|
||||
"value": "Savings"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 23,
|
||||
"accountNo": "000000023",
|
||||
"externalId": "42414",
|
||||
"productId": 1,
|
||||
"productName": "Voluntary savings",
|
||||
"shortProductName": "VS",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "savingsAccountStatusType.active",
|
||||
"value": "Active",
|
||||
"submittedAndPendingApproval": false,
|
||||
"approved": false,
|
||||
"rejected": false,
|
||||
"withdrawnByApplicant": false,
|
||||
"active": true,
|
||||
"closed": false,
|
||||
"prematureClosed": false,
|
||||
"transferInProgress": false,
|
||||
"transferOnHold": false,
|
||||
"matured": false
|
||||
},
|
||||
"currency": {
|
||||
"code": "USD",
|
||||
"name": "US Dollar",
|
||||
"decimalPlaces": 2,
|
||||
"inMultiplesOf": 0,
|
||||
"displaySymbol": "$",
|
||||
"nameCode": "currency.USD",
|
||||
"displayLabel": "US Dollar ($)"
|
||||
},
|
||||
"accountBalance": 3117780552329.610000,
|
||||
"accountType": {
|
||||
"id": 1,
|
||||
"code": "accountType.individual",
|
||||
"value": "Individual"
|
||||
},
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"activatedOnDate": [
|
||||
2016,
|
||||
10,
|
||||
3
|
||||
]
|
||||
},
|
||||
"subStatus": {
|
||||
"id": 0,
|
||||
"code": "SavingsAccountSubStatusEnum.none",
|
||||
"value": "None",
|
||||
"none": true,
|
||||
"inactive": false,
|
||||
"dormant": false,
|
||||
"escheat": false
|
||||
},
|
||||
"lastActiveTransactionDate": [
|
||||
2017,
|
||||
4,
|
||||
7
|
||||
],
|
||||
"depositType": {
|
||||
"id": 100,
|
||||
"code": "depositAccountType.savingsDeposit",
|
||||
"value": "Savings"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
111
app/src/test/resources/clientShareAccounts.json
Normal file
111
app/src/test/resources/clientShareAccounts.json
Normal file
@ -0,0 +1,111 @@
|
||||
{
|
||||
"shareAccounts": [
|
||||
{
|
||||
"id": 14,
|
||||
"accountNo": "000000014",
|
||||
"totalApprovedShares": 10,
|
||||
"totalPendingForApprovalShares": 0,
|
||||
"productId": 2,
|
||||
"productName": "SPTest",
|
||||
"shortProductName": "SPT",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "shareAccountStatusType.active",
|
||||
"value": "Active",
|
||||
"submittedAndPendingApproval": false,
|
||||
"approved": false,
|
||||
"rejected": false,
|
||||
"active": true,
|
||||
"closed": false
|
||||
},
|
||||
"currency": {
|
||||
"code": "USD",
|
||||
"name": "US Dollar",
|
||||
"decimalPlaces": 2,
|
||||
"inMultiplesOf": 1,
|
||||
"displaySymbol": "$",
|
||||
"nameCode": "currency.USD",
|
||||
"displayLabel": "US Dollar ($)"
|
||||
},
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"activatedDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"activatedByUsername": "mifos",
|
||||
"activatedByFirstname": "App",
|
||||
"activatedByLastname": "Administrator"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"accountNo": "000000015",
|
||||
"totalApprovedShares": 10,
|
||||
"totalPendingForApprovalShares": 0,
|
||||
"productId": 2,
|
||||
"productName": "SPTest",
|
||||
"shortProductName": "SPT",
|
||||
"status": {
|
||||
"id": 300,
|
||||
"code": "shareAccountStatusType.active",
|
||||
"value": "Active",
|
||||
"submittedAndPendingApproval": false,
|
||||
"approved": false,
|
||||
"rejected": false,
|
||||
"active": true,
|
||||
"closed": false
|
||||
},
|
||||
"currency": {
|
||||
"code": "USD",
|
||||
"name": "US Dollar",
|
||||
"decimalPlaces": 2,
|
||||
"inMultiplesOf": 1,
|
||||
"displaySymbol": "$",
|
||||
"nameCode": "currency.USD",
|
||||
"displayLabel": "US Dollar ($)"
|
||||
},
|
||||
"timeline": {
|
||||
"submittedOnDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"submittedByUsername": "mifos",
|
||||
"submittedByFirstname": "App",
|
||||
"submittedByLastname": "Administrator",
|
||||
"approvedDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"approvedByUsername": "mifos",
|
||||
"approvedByFirstname": "App",
|
||||
"approvedByLastname": "Administrator",
|
||||
"activatedDate": [
|
||||
2016,
|
||||
11,
|
||||
4
|
||||
],
|
||||
"activatedByUsername": "mifos",
|
||||
"activatedByFirstname": "App",
|
||||
"activatedByLastname": "Administrator"
|
||||
}
|
||||
}
|
||||
]}
|
||||
@ -39,4 +39,7 @@ ext {
|
||||
butterKnifeVersion = '8.0.1'
|
||||
dbflowVersion = '3.1.1';
|
||||
playServicesVersion = '10.0.1'
|
||||
|
||||
jUnitVersion = '4.12'
|
||||
mockitoVersion = '2.6.2'
|
||||
}
|
||||
|
||||
@ -27,5 +27,16 @@
|
||||
</Not>
|
||||
</Match>
|
||||
|
||||
<!-- Ignore DM_DEFAULT_ENCODING in TestDataFactory-->
|
||||
<Match>
|
||||
<Class name="org.mifos.selfserviceapp.TestDataFactory" />
|
||||
<Method name="getObjectTypePojo" />
|
||||
<Bug pattern="DM_DEFAULT_ENCODING" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Class name="org.mifos.selfserviceapp.TestDataFactory" />
|
||||
<Method name="getListTypePojo" />
|
||||
<Bug pattern="DM_DEFAULT_ENCODING" />
|
||||
</Match>
|
||||
|
||||
</FindBugsFilter>
|
||||
Loading…
Reference in New Issue
Block a user