Compare commits
502
Commits
9cf159e77c
...
4be363d171
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4be363d171 | ||
|
|
9d83361d13 | ||
|
|
7fa796abb7 | ||
|
|
c8cedfc70d | ||
|
|
9cc60c9b7e | ||
|
|
8b20f0818c | ||
|
|
94baf15b97 | ||
|
|
5e897a90a7 | ||
|
|
98a865087e | ||
|
|
f1d0ce60b0 | ||
|
|
d5ac4e04ac | ||
|
|
bc93c278cc | ||
|
|
09629933e1 | ||
|
|
628fb30347 | ||
|
|
dde6eaec2a | ||
|
|
b60779b9a0 | ||
|
|
f88b1cb556 | ||
|
|
cd75af2962 | ||
|
|
3d03595ffd | ||
|
|
e37ffca34c | ||
|
|
46c0cec835 | ||
|
|
e9e3326f5b | ||
|
|
aac5ae0d48 | ||
|
|
1bfb0b97cb | ||
|
|
8cc4b6e4f1 | ||
|
|
0a4dc11a87 | ||
|
|
e79d51ee5a | ||
|
|
117a9f51c5 | ||
|
|
9aa4425c48 | ||
|
|
5fdac2282f | ||
|
|
b35beb622e | ||
|
|
73f8d5eba5 | ||
|
|
19ba91a6d3 | ||
|
|
b86a3377ad | ||
|
|
2d1f6ab391 | ||
|
|
911cab85b0 | ||
|
|
b28be9b33f | ||
|
|
9195315512 | ||
|
|
48c8cf994a | ||
|
|
580840c35e | ||
|
|
b3c4f75f11 | ||
|
|
525e8becb4 | ||
|
|
e20ec293be | ||
|
|
9d7f1c2197 | ||
|
|
8d3f7af16f | ||
|
|
025ff9c707 | ||
|
|
19c0defe44 | ||
|
|
95ebe210ee | ||
|
|
9e68c4d5bb | ||
|
|
ca1adedd40 | ||
|
|
b478064ac0 | ||
|
|
ff58f74d79 | ||
|
|
f33b583083 | ||
|
|
8327b112a1 | ||
|
|
0c47dc8d6f | ||
|
|
bf48c97de3 | ||
|
|
84651e0542 | ||
|
|
830412fdde | ||
|
|
4e9f534eaa | ||
|
|
2a7a8d4bc9 | ||
|
|
d22ef5decb | ||
|
|
416a6e5286 | ||
|
|
cc07999d6c | ||
|
|
5e43acc8a0 | ||
|
|
961aa3df86 | ||
|
|
11cd6ef333 | ||
|
|
58bbaa2e2b | ||
|
|
47f21bc8d0 | ||
|
|
1d51258cd8 | ||
|
|
f8f3f743c5 | ||
|
|
7e6f764c7b | ||
|
|
75d657ada0 | ||
|
|
bfad909636 | ||
|
|
012b15f207 | ||
|
|
b086e005ab | ||
|
|
4cfd56fa92 | ||
|
|
b30976bbfd | ||
|
|
42f019d304 | ||
|
|
5647ffb966 | ||
|
|
56da30c3f9 | ||
|
|
68f013abc2 | ||
|
|
8dfcd13641 | ||
|
|
4ad3baade3 | ||
|
|
90942f11cd | ||
|
|
c44cf55fce | ||
|
|
fe6171237e | ||
|
|
ada9ced9a5 | ||
|
|
0a390f7a08 | ||
|
|
f6fb56b940 | ||
|
|
da9601483f | ||
|
|
a01d3e1fcc | ||
|
|
a232d1b1ae | ||
|
|
4232d6c6a6 | ||
|
|
95b30c5a7f | ||
|
|
31a3d16170 | ||
|
|
af1ef23db4 | ||
|
|
0e2da60065 | ||
|
|
fd3b6323a4 | ||
|
|
29b663b00b | ||
|
|
a771c998f6 | ||
|
|
149c084d1f | ||
|
|
65df32c444 | ||
|
|
5ac0da03d3 | ||
|
|
be01e460f5 | ||
|
|
03558fbe8c | ||
|
|
a626208119 | ||
|
|
1c2aa1980e | ||
|
|
f310cc0f51 | ||
|
|
8ce9edc1a1 | ||
|
|
7d8e9f57cc | ||
|
|
07c3cd1b68 | ||
|
|
a462d1461a | ||
|
|
59825080b7 | ||
|
|
9e5e7329ad | ||
|
|
9a2568d152 | ||
|
|
785589a4fd | ||
|
|
8c5deb40ce | ||
|
|
e2b0084c96 | ||
|
|
8894269543 | ||
|
|
91a51698fb | ||
|
|
34353938a7 | ||
|
|
c31c46b6d9 | ||
|
|
dfd33bd2de | ||
|
|
e338658a48 | ||
|
|
d7e7feb361 | ||
|
|
b5be4d2504 | ||
|
|
b7ba924174 | ||
|
|
4945040fff | ||
|
|
a89a43a3f7 | ||
|
|
65767869b0 | ||
|
|
94ef2b0684 | ||
|
|
7fe50160ce | ||
|
|
882132739e | ||
|
|
b9b345a563 | ||
|
|
b43d3ef064 | ||
|
|
a0f7da3f46 | ||
|
|
3774900aec | ||
|
|
8bdc5f3c6a | ||
|
|
66f8d7ce43 | ||
|
|
b4cb1a5702 | ||
|
|
1153022fe7 | ||
|
|
41440de255 | ||
|
|
3d0f48999d | ||
|
|
979b57c38c | ||
|
|
59cfe08980 | ||
|
|
6f25da56ea | ||
|
|
3fa07c8bc5 | ||
|
|
f96d96a147 | ||
|
|
851b22d166 | ||
|
|
2faea6d27f | ||
|
|
66eb337e33 | ||
|
|
7ae9b67d93 | ||
|
|
0b81e80233 | ||
|
|
b4a43e6e98 | ||
|
|
76e488692e | ||
|
|
9353a52013 | ||
|
|
72a1fff645 | ||
|
|
3c254f94e4 | ||
|
|
d2b853561f | ||
|
|
83e2d3e6fc | ||
|
|
a4aee1a3c0 | ||
|
|
e58e591c89 | ||
|
|
f3f6f4bf8f | ||
|
|
b3f6666087 | ||
|
|
5578c6e4d3 | ||
|
|
45e250331a | ||
|
|
d1067e5a84 | ||
|
|
318830fd45 | ||
|
|
3946d7714d | ||
|
|
e7fbec05be | ||
|
|
401cad4d35 | ||
|
|
ffe6a139f6 | ||
|
|
763cf18b90 | ||
|
|
92286b3910 | ||
|
|
a9f811ca61 | ||
|
|
e507d6e204 | ||
|
|
2bd3b0625a | ||
|
|
9d4d90121a | ||
|
|
a2d794a34d | ||
|
|
4d8ad87d93 | ||
|
|
e552e04fd4 | ||
|
|
0480e08546 | ||
|
|
c8159d83f3 | ||
|
|
f755564599 | ||
|
|
7eed1dbd22 | ||
|
|
2ac38ffc58 | ||
|
|
90d238167c | ||
|
|
df690ec894 | ||
|
|
19329c4a12 | ||
|
|
c0c6f1d83c | ||
|
|
baad7ac019 | ||
|
|
218663ac31 | ||
|
|
ded0c7b845 | ||
|
|
f9746718fb | ||
|
|
93e615badd | ||
|
|
e083d79047 | ||
|
|
fdf008d73e | ||
|
|
6c84834459 | ||
|
|
67be38e71a | ||
|
|
aa20ba36a5 | ||
|
|
c9d4b63122 | ||
|
|
3970b2ede1 | ||
|
|
60588a78e0 | ||
|
|
2dae8f8a0e | ||
|
|
1cd226d4c6 | ||
|
|
fe6e1e88fe | ||
|
|
08c553f9fc | ||
|
|
9fedac2ba1 | ||
|
|
3015747f3d | ||
|
|
d6668d2e89 | ||
|
|
abc5290563 | ||
|
|
a83747822b | ||
|
|
437de26c33 | ||
|
|
446ff4403f | ||
|
|
5178d3a8bf | ||
|
|
8dfec9a375 | ||
|
|
ae5d01a912 | ||
|
|
3c69d35da7 | ||
|
|
b533916ab6 | ||
|
|
bba8ca47be | ||
|
|
9c38078de3 | ||
|
|
25b66ad1a1 | ||
|
|
c1af84dd4b | ||
|
|
dd736852f8 | ||
|
|
db367216a9 | ||
|
|
2ddea0aaee | ||
|
|
aad266def8 | ||
|
|
04fe104dde | ||
|
|
bf6d0eaa5b | ||
|
|
8331deb9be | ||
|
|
4d6488eb00 | ||
|
|
746d2a79f0 | ||
|
|
e3f0ecafc3 | ||
|
|
7e9a7596c4 | ||
|
|
6ecbd28121 | ||
|
|
b786d459bc | ||
|
|
a6c9d3d3e2 | ||
|
|
859c0affef | ||
|
|
6e521f81ac | ||
|
|
37dfe1a0bf | ||
|
|
14499a26fb | ||
|
|
c1125cfdf3 | ||
|
|
fa02a3a712 | ||
|
|
1485dc9a87 | ||
|
|
a01c1e361f | ||
|
|
0e0673e3ac | ||
|
|
00e0ea6730 | ||
|
|
79fe66e30d | ||
|
|
8d160d3e7d | ||
|
|
331e8e4dec | ||
|
|
1be4d026cf | ||
|
|
1c0e5502e0 | ||
|
|
9c27413cf1 | ||
|
|
b5dc6b2b5b | ||
|
|
a13a80794f | ||
|
|
bb4799f583 | ||
|
|
06fd26b896 | ||
|
|
2a45fe1390 | ||
|
|
86ca062150 | ||
|
|
5d7520d3e0 | ||
|
|
ee2819b793 | ||
|
|
c9afea91fe | ||
|
|
5903a851f4 | ||
|
|
378330084c | ||
|
|
66cee7856b | ||
|
|
e409a4f17c | ||
|
|
7098d7f83d | ||
|
|
a3b7a5c772 | ||
|
|
881cc41480 | ||
|
|
494ba87c4c | ||
|
|
139e066d3d | ||
|
|
4b1ec9ef54 | ||
|
|
c5b56dae8f | ||
|
|
97587d9019 | ||
|
|
104aa3a14f | ||
|
|
2ae4f02414 | ||
|
|
02a1681784 | ||
|
|
10fd3f8978 | ||
|
|
4caeecfeb9 | ||
|
|
f6f5af5c07 | ||
|
|
b57db81a66 | ||
|
|
b4d9c88ba4 | ||
|
|
7e6fcede85 | ||
|
|
7c1d9e5a7a | ||
|
|
3cf5c5dffa | ||
|
|
843b5ec04b | ||
|
|
fcc597a2bf | ||
|
|
7ef1de1431 | ||
|
|
c7369fda96 | ||
|
|
dc949d5386 | ||
|
|
4aa8cc9892 | ||
|
|
51341532e1 | ||
|
|
866cd25d9a | ||
|
|
2eafc13604 | ||
|
|
72bd70243a | ||
|
|
2c98046961 | ||
|
|
787bad8179 | ||
|
|
b5c355c3c3 | ||
|
|
265a6c4b42 | ||
|
|
34fe42cd16 | ||
|
|
0b19ddff32 | ||
|
|
6fd2141945 | ||
|
|
1b04614f42 | ||
|
|
47974cfa43 | ||
|
|
3ace65d493 | ||
|
|
0d3338ab16 | ||
|
|
b4f61c5ed0 | ||
|
|
7c45056f88 | ||
|
|
e965ea78d0 | ||
|
|
548eb1a110 | ||
|
|
ecb2c93334 | ||
|
|
1bfeb384df | ||
|
|
bb6e3b4537 | ||
|
|
96ea36b101 | ||
|
|
73f3df5229 | ||
|
|
b19a5764b9 | ||
|
|
63751ceb8c | ||
|
|
c7cc9b205f | ||
|
|
0492b2a10b | ||
|
|
9901fc0d3f | ||
|
|
453d50a4df | ||
|
|
09df00c078 | ||
|
|
0e2fba6427 | ||
|
|
2f29a77f02 | ||
|
|
a425a9605f | ||
|
|
21aca2863b | ||
|
|
c32ad6d07d | ||
|
|
23ff03b0c2 | ||
|
|
5a356f9d3f | ||
|
|
795bd4932c | ||
|
|
a17d5ab9df | ||
|
|
1d56e8062b | ||
|
|
782160c912 | ||
|
|
c2744eafea | ||
|
|
a5e915d456 | ||
|
|
b46b14acd3 | ||
|
|
6a78b6eae1 | ||
|
|
877ef133a3 | ||
|
|
3f45a904b1 | ||
|
|
b1ac9aef95 | ||
|
|
70e7aa5847 | ||
|
|
b79090806c | ||
|
|
196d19d87a | ||
|
|
65b767c31d | ||
|
|
e00f40f2bd | ||
|
|
6961d3e97c | ||
|
|
15c204e4db | ||
|
|
4444a8a0e9 | ||
|
|
be252fb91c | ||
|
|
5c4f5fcbd7 | ||
|
|
5384067737 | ||
|
|
c50a45b2c8 | ||
|
|
e13d0e7339 | ||
|
|
2c0e98ac75 | ||
|
|
59dbdad628 | ||
|
|
b981233015 | ||
|
|
954f513ca3 | ||
|
|
5cff3a9fea | ||
|
|
64ab498c9f | ||
|
|
2d214fd6d0 | ||
|
|
c241c295cc | ||
|
|
f98b4e3fa9 | ||
|
|
883ca09346 | ||
|
|
3cdf64fa16 | ||
|
|
4a99634a25 | ||
|
|
feda68209f | ||
|
|
e29e43b80b | ||
|
|
55958b50d2 | ||
|
|
8e6715992f | ||
|
|
00759619f5 | ||
|
|
2686988954 | ||
|
|
f58bc239ab | ||
|
|
a8cf131ccf | ||
|
|
95c2921ff0 | ||
|
|
9e4cb99853 | ||
|
|
b52e3bc233 | ||
|
|
7ba9545dd1 | ||
|
|
a9912c5cb8 | ||
|
|
82242a0fb0 | ||
|
|
c60f148856 | ||
|
|
5567319d2f | ||
|
|
3685c2868e | ||
|
|
55b1c8c97b | ||
|
|
1333e79c30 | ||
|
|
0b34ee8068 | ||
|
|
5503d5a22f | ||
|
|
e5078f9bac | ||
|
|
dcce0e6a92 | ||
|
|
6ae5d7d52d | ||
|
|
e61a5fba03 | ||
|
|
dd472c4bbc | ||
|
|
51d3ff7b8b | ||
|
|
5a0fa8940a | ||
|
|
2108a2fb4d | ||
|
|
b37fb4a2e8 | ||
|
|
88d7d05893 | ||
|
|
8cc65d676e | ||
|
|
af089f06e4 | ||
|
|
bbc89ebbd1 | ||
|
|
74b2c2567e | ||
|
|
e19835ce46 | ||
|
|
5bbe8dd192 | ||
|
|
e09a94cdf5 | ||
|
|
f5f8fa50a5 | ||
|
|
7fabfa5cb9 | ||
|
|
5deba1c71a | ||
|
|
25ddb88db9 | ||
|
|
f4fdc64bc2 | ||
|
|
1f0ce4670e | ||
|
|
7710058690 | ||
|
|
75178272b9 | ||
|
|
0f65d4dd27 | ||
|
|
c35d4b8a9a | ||
|
|
49b65827ba | ||
|
|
5b78a2ace9 | ||
|
|
1c17e73ec2 | ||
|
|
b732fca525 | ||
|
|
093a9844c6 | ||
|
|
2100fc806f | ||
|
|
cd17e609cb | ||
|
|
f51ebeb967 | ||
|
|
d9c6ddbeca | ||
|
|
c3607f19a0 | ||
|
|
6e2d6c2242 | ||
|
|
72dcd866fa | ||
|
|
d255f7b3ef | ||
|
|
0cb619fa80 | ||
|
|
6914b1ee93 | ||
|
|
2fb9fc0575 | ||
|
|
132e869315 | ||
|
|
2124d1bcbb | ||
|
|
97a499b071 | ||
|
|
e6def2a988 | ||
|
|
326dca1e41 | ||
|
|
f094d13058 | ||
|
|
928dbccfc4 | ||
|
|
75df514526 | ||
|
|
9f0020d8de | ||
|
|
dfa51dd7b3 | ||
|
|
88685e1f0b | ||
|
|
b9e60c0acf | ||
|
|
d112f4a79d | ||
|
|
9626995b9f | ||
|
|
a9a5e735da | ||
|
|
ac70343a04 | ||
|
|
30f7e7022f | ||
|
|
2348c4d78e | ||
|
|
d33d34a7b5 | ||
|
|
dedae5dd97 | ||
|
|
d52809fd1f | ||
|
|
dbfbe7d016 | ||
|
|
923fbba14b | ||
|
|
33d4a48be5 | ||
|
|
c9767e76d7 | ||
|
|
07f8812957 | ||
|
|
b7b6e39c42 | ||
|
|
8f1eb39d5d | ||
|
|
66ce3b4873 | ||
|
|
670b6eef19 | ||
|
|
5a990af553 | ||
|
|
73cd56c491 | ||
|
|
342c056ee9 | ||
|
|
63cca6be42 | ||
|
|
c181b67afa | ||
|
|
d226ea59ad | ||
|
|
99318bdba5 | ||
|
|
b217b95a18 | ||
|
|
59d4515c61 | ||
|
|
2a7ab8cf18 | ||
|
|
5b4ca41eb3 | ||
|
|
532506608f | ||
|
|
2a7c4919db | ||
|
|
4bf6eb186c | ||
|
|
a4cee3b1d0 | ||
|
|
56fe13852d | ||
|
|
879f3082ba | ||
|
|
971e23e8b7 | ||
|
|
da5663f15c | ||
|
|
87adf49f44 | ||
|
|
80f122446a | ||
|
|
2d9fc6dca4 | ||
|
|
21cc6e946d | ||
|
|
f495723c76 | ||
|
|
ded3006f74 | ||
|
|
14eb1c0b72 | ||
|
|
fd5ef09360 | ||
|
|
f0252a1747 | ||
|
|
ed68b0676d | ||
|
|
293787f913 | ||
|
|
5f7c005b49 | ||
|
|
3ff52f902a | ||
|
|
a76b60f7c0 | ||
|
|
08e22737eb | ||
|
|
6628b227a7 | ||
|
|
6716a5a00a | ||
|
|
5a1ebfe768 | ||
|
|
80bfc5e811 | ||
|
|
840fd4c0a7 | ||
|
|
b359db2ac9 | ||
|
|
57344f9137 | ||
|
|
00ba422705 | ||
|
|
b89daf38a8 |
-20
@@ -1,24 +1,4 @@
|
||||
bin
|
||||
build
|
||||
repos
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
.gradle
|
||||
.idea
|
||||
*.log
|
||||
*.class
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
*.bak
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
rebel.xml
|
||||
*.sublime-workspace
|
||||
*.DS_Store
|
||||
*.ini
|
||||
*.gradletasknamecache
|
||||
*~
|
||||
.metadata
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[submodule "apps/community-app"]
|
||||
path = apps/community-app
|
||||
url = https://github.com/openMF/community-app.git
|
||||
branch = develop
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
# This (sudo: false) is needed to "run on container-based infrastructure" on which cache: is available
|
||||
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
|
||||
sudo: false
|
||||
language: java
|
||||
jdk:
|
||||
- openjdk7
|
||||
script: ./travis_build.sh
|
||||
notifications:
|
||||
email: true
|
||||
# This is so that the Gradle output is readable on the Travis web console
|
||||
# @see http://stackoverflow.com/questions/17942819/how-can-i-get-clean-gradle-output-on-travis-ci
|
||||
# @see http://gradle.1045684.n5.nabble.com/Plain-console-output-td5710237.html
|
||||
env:
|
||||
- TERM=dumb
|
||||
# http://docs.travis-ci.com/user/caching/#Arbitrary-directories
|
||||
cache:
|
||||
apt: true
|
||||
directories:
|
||||
- $HOME/.gradle
|
||||
- $HOME/.m2
|
||||
+1
-1644
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
||||
Contributors
|
||||
=====
|
||||
|
||||
List of code contributors on the mifosplatform codebase (mifosx) can be viewed @ https://github.com/openMF/mifosx/contributors
|
||||
|
||||
List of code contributors on applications built on mifosplatform such as the reference app (IndividualLendingJavascript) can be viewed @ https://github.com/openMF/mifosx-community-apps/contributors
|
||||
@@ -1,26 +0,0 @@
|
||||
# Getting started with Mifos X
|
||||
Instructions for getting started are located at https://mifosforge.jira.com/wiki/display/MIFOSX/Getting+started+-+Contributing+to+MifosX
|
||||
|
||||
# Pull Request Checklist
|
||||
Before sending out a pull request, please ensure that the following pre-requisites are taken care of
|
||||
|
||||
1. API documentation has been updated to reflect any changes made to the API (new API's, adding new Fields or Options to existing API etc)
|
||||
|
||||
1. Any relevant database changes are encapsulated in an SQL file with the next avilable version number at https://github.com/openMF/mifosx/tree/develop/mifosng-provider/src/main/resources/sql/migrations/core_db. These patches are automatically applied by Flyway on server startup.
|
||||
For any modifications to the schema which affects data on existing installations (Ex: moving columns to new table etc), ensure that the upgrade scripts are also accompanied by data migration scripts in the same patch file
|
||||
|
||||
1. An integration test is added/updated to test the new feature developed/bug-fix being made
|
||||
|
||||
1. The pull request has a Jira issue associated with it. Details for creating issues on Jira are located at https://mifosforge.jira.com/wiki/display/MIFOSX/Getting+started+-+Contributing+to+MifosX#Gettingstarted-ContributingtoMifosX-CreateIssues
|
||||
|
||||
1. The Relevant Jira number (Ex: MIFOSX-1454) is present as a part of the commit message. Refer http://comments.gmane.org/gmane.comp.finance.mifos.devel/14664 for details
|
||||
|
||||
1. Newly added code has been formatted and cleaned up as per our preferences at https://github.com/openMF/mifosx/wiki/Eclipse#apply-project-preferences-to-eclipse
|
||||
|
||||
1. Comments are added where relevant to ease peer review
|
||||
|
||||
1. Your work is present in a single commit rather than several broken up commits. This helps us maintain a cleaner commit history. https://github.com/openMF/mifosx/wiki/Github-&-Git#contributing-back-changes-to-original-repositoryauthors has instructions for squashing multiple commits or resetting head and recommiting your work as a single commit
|
||||
|
||||
1. Your work is rebased on top of the latest code from develop branch to make life easier for our Committers
|
||||
|
||||
1. "gradlew licenseFormatMain licenseFormatTest licenseFormatIntegrationTest" has been run to apply the Mozilla License on all newly added files (your pull requests are verified to ensure compliance with this since https://github.com/openMF/mifosx/pull/1053)
|
||||
@@ -0,0 +1 @@
|
||||
Apache Fineract is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
|
||||
-304
@@ -1,304 +0,0 @@
|
||||
# Installation Mifos Platform
|
||||
|
||||
This file describes how to install mifos platform for use in a production or test environment.
|
||||
|
||||
## Release Artifact Structure
|
||||
|
||||
The release artifact (.zip file) has the following structure:
|
||||
|
||||
```
|
||||
+ mifosplatform-X.Y.Z.RELEASE ... parent folder which will have the release number on it
|
||||
|
|
||||
+ api-docs ... folder contains html based documentation on the platform API for this release
|
||||
+ database ... folder contains database setup and upgrade scripts along with sample data required for installation
|
||||
+ pentahoReports ... folder contains any out-of-the-box reports provided through pentaho
|
||||
+ apps ... folder contains apps like community app that speak to the platform
|
||||
+ runmifosx.bat ... launch script for Windows
|
||||
+ runmifosx.sh ... launch script for Mac OS X and Linux
|
||||
|
|
||||
-- CHANGELOG.MD ... file documents changelog of project up to this release
|
||||
-- CONTRIBUTORS.MD ... file provides details on contributors to project
|
||||
-- INSTALL.MD ... file provides details on installation instructions
|
||||
-- LICENSE.MD ... file provides details on the open source license used by the project
|
||||
-- mifosng-provider.war ... the platform WAR file to be dropped into Tomcat 7
|
||||
-- README.MD ... initial readme file for the project
|
||||
-- VERSIONING.MD ... file provides details on approach to release versioning
|
||||
```
|
||||
|
||||
## How to Install
|
||||
|
||||
The three ways to get up and running with mifos platform is:
|
||||
|
||||
1. Use Amazon AWS and mifosplatform public AMI to spin up a new instance in the cloud
|
||||
2. Manually install the prerequisite software on your own machine, follow setup instructions and use release artifacts to get platform running yourself.
|
||||
3. ~~The (and the easiest) method is to just fire up the launch script provided in the release artifact and Mifos takes care of all the database, server-side and client-side setup for you.~~ Currently Broken
|
||||
|
||||
## 1. Launch script automatic out-of-the box setup
|
||||
|
||||
Important : Automatic setup is currently broken, please follow the instructions for **Manual Installation** instead. For details of the issue, refer comments at https://mifosforge.jira.com/browse/MIFOSX-1756
|
||||
|
||||
The Mifos release artifact contains two launch scripts with names starting with "**runmifosx**". One of them (the one with the *.bat* file extension) is used to launch the platform on a Windows machine while the other (which has the *.sh* file extension) is used to launch the platform on Mac OS X and Linux. Just double-click on the respective script (depending on your OS) and voila! you have your own Mifos X platform running locally on your computer.
|
||||
|
||||
**Note**: *In case your script does not launch by double clicking on Linux or Mac OS X, here's what you can do. Head over to bash and type the following:*
|
||||
|
||||
```
|
||||
$ cd /path/where/runmifosx.sh/is/located
|
||||
$ chmod 0755 ./runmifosx.sh
|
||||
$ ./runmifosx.sh
|
||||
```
|
||||
|
||||
## 2. Amazon Public AMI
|
||||
|
||||
Use AWS Wizard to launch instance by using this link: <a target="_blank" href="https://console.aws.amazon.com/ec2/home?region=ap-southeast-1#launchAmi=ami-2a734b78" title="Latest Mifos Platform Public AMI">Mifos Platform AMI (ami-2a734b78)</a>
|
||||
|
||||
*Note:* Read through the following as you step through the AWS Wizard
|
||||
|
||||
- You are automatically brought to Step 2 on the wizard, by default a 'micro' instance is selected, you may need to select a 'General Purpose' m1.small as the t1.micro's memory is right on the edge of whats needed to support MySQL, Tomcat 7 + Mifos Platform
|
||||
- Use default settings for steps 3 to 5 until you reach step 6 configure security group.
|
||||
- If your first time using AWS you should use the create new security group option and add the following 'rules' to the security group:
|
||||
- SSH (PORT 22), MYSQL (3306), HTTPS (443), Custom TCP Rule (8443) all with a 'Source' value of 'Anywhere'
|
||||
- Click 'Review and Launch'
|
||||
- You will be asked to use a 'keypair' which you will need to SSH onto the new instance, if this is your first time create a new keypair, be srue to download it and store in place as you will need it later, otherwise use an existing keypair.
|
||||
- When the instance starts, the following should be available at:
|
||||
- Platform application should be available @ https://[public DNS]:8443/mifosng-provider/api/v1/offices?tenantIdentifier=default&pretty=true
|
||||
- Community app should be available @ https://[public DNS]:8443/community-app
|
||||
- API docs should be available @ https://[public DNS]:8443/api-docs/apiLive.htm
|
||||
|
||||
*Name:* Mifos Platform 15.03.1.RELEASE Public AMI
|
||||
|
||||
- AMI ID: ami-2a734b78
|
||||
- Kernel ID: aki-503e7402
|
||||
- Name: Mifos Platform 15.03.1.RELEASE Public AMI
|
||||
- Owner: 239215483039
|
||||
- Source: 239215483039/Mifos X-15.03.1 release
|
||||
- Architecture: Ubuntu12.04 LTS x86_64
|
||||
- Built starting from Ubuntu AMI ami-2a734b78
|
||||
- Java 1.7.0_51 64 bit JVM
|
||||
- Tomcat 7.0.39 (with SSL configured for self-signed certificate)
|
||||
- MySql 5.5.31
|
||||
|
||||
## 3. Manual Installation
|
||||
|
||||
### 3.1 Prerequisite Software
|
||||
|
||||
Before running mifos platform you must have the following software installed:
|
||||
- Oracle Java - JDK 7 (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
|
||||
- Oracle MySQL - (http://dev.mysql.com/downloads/)
|
||||
- Apache Tomcat 7 - (http://tomcat.apache.org/download-70.cgi)
|
||||
|
||||
### 3.2 MySQL Setup
|
||||
|
||||
Assumption: MySQL server is now installed.
|
||||
|
||||
You should know your password for MySQL root user. If you wish you can change it by doing:
|
||||
```
|
||||
mysqladmin -u root -p 'oldpassword' password newpassword
|
||||
```
|
||||
The mifosplatform settings default to a mysql root user with username: root, password: mysql
|
||||
|
||||
If you have never installed mifosplatform before follow section 2.2.1 for first time setup of database, otherwise read section 2.2.2 on database upgrades.
|
||||
|
||||
#### 3.2.1 First Time Database setup
|
||||
|
||||
Mifos platform has support for hosting multiple tenants so we use two database schemas:
|
||||
- *mifosplatform-tenants*: which is responsible for persisting the tenant information which is used when deciding what schema each incoming request in the platform should route to. It acts as a registry which contains the details of all the tenant databases, and their connection information, which is used by MifosX to connect to the appropriate tenant.
|
||||
- *mifostenant-default*: All tenant specific schemas follow the pattern mifostenant-xxxx, out of the box the default schema is used.
|
||||
|
||||
Step one: create mifosplatform-tenants database
|
||||
```
|
||||
mysql -uroot -pmysql
|
||||
create database `mifosplatform-tenants`;
|
||||
exit
|
||||
```
|
||||
|
||||
Step two: create mifostenant-default database
|
||||
```
|
||||
mysql -uroot -pmysql
|
||||
create database `mifostenant-default`;
|
||||
exit
|
||||
```
|
||||
The tables and lookup data for both databases are created on application startup.
|
||||
|
||||
Step three (optional): to be followed only if your mysql credentials are other than root/mysql
|
||||
|
||||
Manually restore the contents of *mifosplatform-tenants* database
|
||||
|
||||
```
|
||||
mysql -uroot -pmysql mifosplatform-tenants < database/mifospltaform-tenants-first-time-install.sql
|
||||
```
|
||||
Next, update the default credentials for connecting to *mifoplatform-default* database stored in the *tenants* table of *mifosplatform-tenants* with your credentials
|
||||
|
||||
```
|
||||
UPDATE tenants SET schema_username = "your_username", schema_password = "your_password" WHERE identifier = "default";
|
||||
```
|
||||
|
||||
#### 3.2.2 Upgrade existing database(s)
|
||||
|
||||
The list database *mifosplatform-tenants* is upgraded when the application starts. Any *tenant* databases will also be upgraded automatically when the application starts if the *auto_update* field of the *tenants* database table is enabled(=1). This is the default setting.
|
||||
|
||||
Upgrading your database in this way is the recommended way as it will upgrade any *tenants* setup in the *mifosplatform-tenants* database but can be disabled by setting the *auto_update* field of the tenant to zero.
|
||||
|
||||
##### 3.2.2.1 Special Instructions for those upgrading from version 1.24.* or lower
|
||||
|
||||
Starting from version 1.25.* , updates to *mifosplatform-tenants* database are managed by Flyway (http://flywaydb.org/). To ensure that flyway works correctly, verify that table *schema_version* is present along with two entries in *mifosplatform-tenants* database.
|
||||
|
||||
You can do so as follows
|
||||
|
||||
````
|
||||
mysql -uroot -pmysql
|
||||
|
||||
use `mifosplatform-tenants`;
|
||||
select * from schema_version;
|
||||
```
|
||||
|
||||
If the table does not exist, create the same using the script at https://gist.github.com/vishwasbabu/dc105b6a9450cff8ff1f
|
||||
|
||||
Next, check if the patch for "externalizing mysql connection properties" has been run (i.e if you are updating from 1.21 or a higher version of Mifos X)
|
||||
|
||||
````
|
||||
mysql -uroot -pmysql
|
||||
|
||||
use `mifosplatform-tenants`;
|
||||
select pool_initial_size from tenants;
|
||||
```
|
||||
|
||||
If the above query does **not** throw an error (Unknown column 'pool_initial_size'), *schema_version* needs to be updated with the details of this patch by executing the scripts below
|
||||
|
||||
```
|
||||
mysql -uroot -pmysql
|
||||
|
||||
use `mifosplatform-tenants`;
|
||||
INSERT INTO `schema_version` (`version_rank`, `installed_rank`, `version`, `description`, `type`, `script`, `checksum`, `installed_by`, `installed_on`, `execution_time`, `success`) VALUES
|
||||
(2, 2, '2', 'externalize-connection-properties', 'SQL', 'V2__externalize-connection-properties.sql', 210473669, 'root', '2014-10-12 22:13:51', 661, 1);
|
||||
```
|
||||
|
||||
#### 3.2.3 Load *mifostenant-default* schema with sample data (optional)
|
||||
Every release ships with sample data (offices, users, customers, loan products, savings products and a chart of accounts). The same can be restored by running the following command
|
||||
|
||||
```
|
||||
mysql -uroot -pmysql mifostenant-default < database/migrations/sample_data/load_sample_data.sql
|
||||
```
|
||||
|
||||
|
||||
### 3.3 Tomcat 7 Setup
|
||||
|
||||
Assumption: You have downloaded and installed Tomcat 7 correctly for your operation system: see http://tomcat.apache.org/tomcat-7.0-doc/setup.html
|
||||
|
||||
#### 3.3.1 Environment Variables Check
|
||||
|
||||
Check that the following environment variables exist:
|
||||
- JAVA_HOME ... should point to directory where a 1.7 JDK or JRE is on machine
|
||||
- CATALINA_HOME ... should point to a directory where a Tomcat 7 instance is installed
|
||||
|
||||
Check that the following is on your path:
|
||||
- %JAVA_HOME%\bin;
|
||||
|
||||
#### 3.3.2 Logging
|
||||
|
||||
- In the [TOMCAT_HOME]/logs create a file called ```mifos-platform.log```
|
||||
|
||||
#### 3.3.3 Libraries
|
||||
|
||||
Ensure the following libraries are in the [TOMCAT_HOME]/lib folder
|
||||
- tomcat-jdbc.jar (You can download the same from http://central.maven.org/maven2/org/apache/tomcat/tomcat-jdbc/7.0.57/tomcat-jdbc-7.0.57.jar)
|
||||
- mysql-connector-java-5.1.22 (You will need to download the latest MySQL Connector/J Jar file from http://dev.mysql.com/downloads/connector/j/)
|
||||
|
||||
#### 3.3.4 Configure for SSL
|
||||
|
||||
Generate a new keystore using java keytool (if you havent already done this):
|
||||
- Follow docs to create keystore.(http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration)
|
||||
|
||||
- Update server.xml as in docs. (Ther server.xml configuration given in the configure tomcat 7 below is what is need.)
|
||||
|
||||
```sudo keytool -genkey -alias mifostom -keyalg RSA -keystore /home/ubuntu/.keystore```
|
||||
|
||||
#### 3.3.5 Update tomcat configuration files for SSL, compression and JNDI connection to MySql
|
||||
|
||||
```
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<Server port="8005" shutdown="SHUTDOWN">
|
||||
<Listener className="org.apache.catalina.core.JasperListener" />
|
||||
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
|
||||
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
|
||||
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
|
||||
|
||||
<GlobalNamingResources>
|
||||
<Resource name="UserDatabase" auth="Container"
|
||||
type="org.apache.catalina.UserDatabase"
|
||||
description="User database that can be updated and saved"
|
||||
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
|
||||
pathname="conf/tomcat-users.xml"
|
||||
/>
|
||||
|
||||
<Resource type="javax.sql.DataSource"
|
||||
name="jdbc/mifosplatform-tenants"
|
||||
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
|
||||
driverClassName="com.mysql.jdbc.Driver"
|
||||
url="jdbc:mysql://localhost:3306/mifosplatform-tenants"
|
||||
username="root"
|
||||
password="[root mysql password]"
|
||||
initialSize="3"
|
||||
maxActive="10"
|
||||
maxIdle="6"
|
||||
minIdle="3"
|
||||
validationQuery="SELECT 1"
|
||||
testOnBorrow="true"
|
||||
testOnReturn="true"
|
||||
testWhileIdle="true"
|
||||
timeBetweenEvictionRunsMillis="30000"
|
||||
minEvictableIdleTimeMillis="60000"
|
||||
logAbandoned="true"
|
||||
suspectTimeout="60"
|
||||
/>
|
||||
</GlobalNamingResources>
|
||||
|
||||
<Service name="Catalina">
|
||||
|
||||
<Connector protocol="org.apache.coyote.http11.Http11Protocol"
|
||||
port="8443" maxThreads="200" scheme="https"
|
||||
secure="true" SSLEnabled="true"
|
||||
keystoreFile="/home/ubuntu/.keystore"
|
||||
keystorePass="testmifos"
|
||||
clientAuth="false" sslProtocol="TLS"
|
||||
URIEncoding="UTF-8"
|
||||
compression="force"
|
||||
compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"/>
|
||||
|
||||
<Engine name="Catalina" defaultHost="localhost">
|
||||
|
||||
<Realm className="org.apache.catalina.realm.LockOutRealm">
|
||||
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
|
||||
</Realm>
|
||||
|
||||
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
|
||||
|
||||
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
|
||||
prefix="localhost_access_log." suffix=".log"
|
||||
pattern="%h %l %u %t "%r" %s %b" />
|
||||
</Host>
|
||||
</Engine>
|
||||
</Service>
|
||||
</Server>
|
||||
```
|
||||
|
||||
#### 3.3.6 Drop application into tomcat webapps folder
|
||||
|
||||
Drop the following from the release artifact into the [TOMCAT_HOME]/webapps folder:
|
||||
- mifosng-provider.war
|
||||
|
||||
Drop the following from the release artifact into [TOMCAT_HOME]/webapps/ROOT folder:
|
||||
- The entire ```apps/community-app``` folder.
|
||||
- The entire api-docs folder
|
||||
|
||||
#### 3.3.7 Startup tomcat
|
||||
Startup tomcat:
|
||||
- Platform application should be available @ https://[server ip address]:8443/mifosng-provider/api/v1/offices?tenantIdentifier=default&pretty=true
|
||||
- Community application should be available @ https://[server ip address]:8443/community-app?baseApiUrl=https://[server ip address]:8443/mifosng-provider/api/v1/
|
||||
- API docs should be available @ https://[server ip address]:8443/api-docs/apiLive.htm
|
||||
|
||||
*where [server ip address] is the hostname or IP address of your computer. For instance, if you've installed Mifos on your local machine then [server ip address] is localhost*
|
||||
|
||||
## How to integrate the web front-end UI with the back-end
|
||||
|
||||
To be able to use the front-end UI along with the back-end, you simply need to copy the webapp's source code files to the ```apps``` folder. For instance, you could copy the source code files of the community app to ```apps/community-app```. This would enable you to access the commuity app from the following URL:
|
||||
*https://[server ip address]:8443/mifosng-provider/apps/community-app?baseApiUrl=https://[server ip address]:8443*
|
||||
@@ -0,0 +1,340 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
******************************************
|
||||
|
||||
======================================
|
||||
LICENSES FOR INCLUDED DEPENDENCIES
|
||||
======================================
|
||||
|
||||
All the source code for the Apache Fineract project is released under the
|
||||
license above. Additionally, the Apache Fineract source and binary distribution includes a number of third-party files that are required in
|
||||
order to the software to function. Unless noted below, these jars
|
||||
and resource files are also released under the ASF license above.
|
||||
|
||||
==================================================
|
||||
*The exceptions for source release are as follows:
|
||||
==================================================
|
||||
|
||||
For API & System Architecture Documentation Apache Fineract includes following css and js packages.
|
||||
|
||||
This product bundles normalize v1.1.1 and v2.1.0, copyright Nicolas Gallagher and Jonathan Neal, which is available under a MIT license.
|
||||
For details, see licenses/source/normalize.MIT
|
||||
|
||||
This product bundles Modernizr v2.6.2, which is available under a MIT license.
|
||||
For details, see licenses/source/modernizr.MIT
|
||||
|
||||
This product bundles filesaver, copyright Eli Grey, which is available under a MIT license.
|
||||
For details, see licenses/source/filesaver.MIT
|
||||
|
||||
This product bundles Glyphicons Halflings Regular, copyright Jan Kovarik,
|
||||
which is available under a MIT license.
|
||||
For details, see licenses/source/glyphicons.MIT
|
||||
|
||||
This product bundles jszip, copyright Stuart Knightley,
|
||||
David Duponchel, Franz Buchinger and António Afonso, which is available under a MIT license.
|
||||
For details, see licenses/source/jszip.MIT
|
||||
|
||||
This product bundles jQuery v1.7, v1.7.1, v1.9.1, v1.10.2, copyright jQuery Foundation, Inc. which is available under a MIT license.
|
||||
For details, see licenses/source/jQuery.MIT
|
||||
|
||||
This product bundles Respond v1.1.0, copyright Scott Jehl,
|
||||
which is available under a MIT license.
|
||||
For details, see licenses/source/respond.MIT
|
||||
|
||||
This product bundles matchMedia polyfill, copyright Scott Jehl,
|
||||
which is available under a MIT license.
|
||||
For details, see licenses/polyfill.MIT
|
||||
|
||||
This product bundles HTML5Shiv v3.6.2pre, copyright Alexander Farkas,
|
||||
which is available under a MIT license.
|
||||
For details, see licenses/source/html5shiv.MIT
|
||||
|
||||
This product bundles UglifyJS copyright Mihai Bazon,
|
||||
which available under a BSD license.
|
||||
For details, see licenses/source/uglify.BSD
|
||||
|
||||
This product bundles sizzle copyright jQuery Foundation and other contributors, which is available under a MIT license.
|
||||
For details, see licenses/source/sizzle.MIT
|
||||
|
||||
This product bundles some parts of es5-shim, copyright Kristopher Michael Kowal and contributors, which is available under a MIT license.
|
||||
For details, see licenses/source/es5shim.MIT
|
||||
|
||||
This product bundles toc v0.1.2, copyright Greg Allen,
|
||||
which is available under a MIT license.
|
||||
For details, see licenses/source/toc.MIT
|
||||
|
||||
This product bundles livejs Version 4, copyright Martin Kool and Q42,
|
||||
which is available under a MIT license.
|
||||
For details, see licenses/source/livejs.MIT
|
||||
|
||||
This product bundles HTML5 Boilerplate, which is under a MIT license.
|
||||
For details, see licenses/source/h5bp.MIT.
|
||||
|
||||
==================================================
|
||||
*The exceptions for binary release are as follows:
|
||||
==================================================
|
||||
This product bundles AOP Alliance v1.0, which is available under a Public Domain license. For details, see licenses/binary/Aopa.PL
|
||||
|
||||
This product bundles ASM Core v3.1, which is available under a BSD license.
|
||||
For details, see licenses/binary/Asm.BSD
|
||||
|
||||
This product bundles JavaMail API(compat) v1.5.0-b01,
|
||||
which is available under a CDDL v1.0 license.
|
||||
For details, see licenses/binary/Javamail.CDDL
|
||||
|
||||
This product bundles AspectJ Runtime v1.8.2, Copyright (c) 1999-2001 Xerox Corporation, 2002 Palo Alto Research Center, Incorporated (PARC), which is available under a EPL v1.0 license.
|
||||
For details, see licenses/binary/Aspectrt.EPL
|
||||
|
||||
This product bundles AspectJ Weaver v1.8.2, Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), which is available under a EPL v1.0 license. For details, see licenses/binary/Aspectweaver.EPL
|
||||
|
||||
This product bundles IText(A Free Java PDF Library) v2.1.7, Copyright 2007 Bruno Lowagie, which is available under a MPL v1.1 license.
|
||||
For details, see licenses/binary/IText.MPL
|
||||
|
||||
This product bundles DOM4J, Copyright 2001-2005 (C) MetaStuff, Ltd., which is available under a BSD license.
|
||||
For details, see licenses/binary/Dom4J.BSD
|
||||
|
||||
This product bundles JDBC driver for MySQL and Drizzle v1.3, Copyright (c) 2009-2013, Marcus Eriksson which is available under a BSD license.
|
||||
For details, see licenses/binary/Drizzle.BSD
|
||||
|
||||
This product bundles Ical4J v1.0.4, Copyright (c) 2012, Ben Fortuna,
|
||||
which is available under a BSD license.
|
||||
For details, see licenses/binary/Ical4J.BSD
|
||||
|
||||
This product bundles Jersey Core v1.17, Copyright (c) 2010-2012 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
|
||||
For details, see licenses/binary/Jersey.CDDL
|
||||
|
||||
This product bundles Jersey Json v1.17, Copyright (c) 2010-2012 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
|
||||
For details, see licenses/binary/Jersey.CDDL
|
||||
|
||||
This product bundles Jersey Multipart v1.17, Copyright (c) 2010-2011 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
|
||||
For details, see licenses/binary/Jersey.CDDL
|
||||
|
||||
This product bundles Jersey Server v1.17, Copyright (c) 2010-2011 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
|
||||
For details, see licenses/binary/Jersey.CDDL
|
||||
|
||||
This product bundles Jersey Servlet v1.17, Copyright (c) 2010-2011 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
|
||||
For details, see licenses/binary/Jersey.CDDL
|
||||
|
||||
This product bundles Jersey Spring v1.17, Copyright (c) 2010-2011 Oracle and/or its affiliates, which is available under a CDDL 1.1 license.
|
||||
For details, see licenses/binary/Jersey.CDDL
|
||||
|
||||
This product bundles Logback Classic Module v1.1.2, Copyright (C) 1999-2012, QOS.ch. All rights reserved, which is available under a EPL v1.0 license.
|
||||
For details, see licenses/binary/Logback.EPL
|
||||
|
||||
This product bundles Logback Core Module v1.1.2, Copyright (C) 1999-2012, QOS.ch. All rights reserved, which is available under a EPL v1.0 license.
|
||||
For details, see licenses/binary/Logback.EPL
|
||||
|
||||
This product bundles MIME Streaming Extension v1.6, Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved., which is available under a CDDL v1.1 license.
|
||||
For details, see licenses/binary/Mimepull.CDDL
|
||||
|
||||
This product bundles JUnit v3.8.1 created by Erich Gamma and Kent Beck which is available under a CPL v1.0 license.
|
||||
For details, see licenses/binary/Junit.CPL
|
||||
|
||||
This product bundles SLF4J API Module v1.7.7 opyright (c) 2004-2013 QOS.ch All rights reserved., which is available under a MIT license.
|
||||
For details, see licenses/binary/Slf4j.MIT
|
||||
|
||||
This product bundles Backport Util Concurrent v3.1 written by Dawid Kurzyniec,
|
||||
which is avilable under Public Domain license. For details see licenses/binary/Backport.PL
|
||||
|
||||
******************************************
|
||||
+16
-3
@@ -1,3 +1,16 @@
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
@@ -0,0 +1,62 @@
|
||||
Apache Fineract
|
||||
Copyright 2008-2016 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by The Apache Software
|
||||
Foundation (http://www.apache.org/).
|
||||
|
||||
Apache Fineract - notice for binary distribution
|
||||
==========================================
|
||||
Apache Fineract includes JavaMail API(compat) v1.5.0-b01.
|
||||
Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.
|
||||
Fineract elects to include this software in this distribution under the
|
||||
CDDL license. You can obtain a copy of the License at:
|
||||
https://glassfish.java.net/public/CDDL+GPL.html
|
||||
|
||||
Apache Fineract includes all Jersey libraries (Jersey Core v1.17, Jersey Json v1.17, Jersey Multipart v1.17, Jersey Server v1.17,Jersey Servlet v1.17,
|
||||
Jersey Spring v1.17). Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved. Fineract elects to include this software in this distribution under the CDDL license. You can obtain a copy of the License at:
|
||||
https://glassfish.java.net/public/CDDL+GPL.html
|
||||
|
||||
Apache Fineract includes Logback Classic Module v1.1.2 and Logback Core Module v1.1.2, Copyright (C) 1999-2012, QOS.ch. All rights reserved. Fineract elects to include this software in this distribution under the
|
||||
EPL license. You can obtain a copy of the License at:
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Apache Fineract includes MIME Streaming Extension v1.6, CCopyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
|
||||
Fineract elects to include this software in this distribution under the
|
||||
CDDL license. You can obtain a copy of the License at:
|
||||
https://glassfish.java.net/public/CDDL+GPL_1_1.html
|
||||
|
||||
Apache Fineract includes JUnit v3.8.1 created by Erich Gamma and Kent Beck.
|
||||
Fineract elects to include this software in this distribution under the
|
||||
CPL license. You can obtain a copy of the License at:
|
||||
https://opensource.org/licenses/cpl1.0.txt
|
||||
|
||||
Apache Fineract includes Log4j Implemented Over SLF4J. Fineract elects to include this software in this distribution under the Apache license. You can obtain a copy of the License at:
|
||||
http://apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Apache Fineract includes Jackson Core v2.3.4, Jackson Annotations v2.3.0,
|
||||
Jackson Databind v2.3.4, JAX RS Provider For JSON Content Type v1.9.2, Xml Compatibility Extensions For Jackson v1.9.2 libraries. Fineract elects to include this software in this distribution under the Apache license. You can obtain a copy of the License at:
|
||||
http://apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Apache Fineract includes AspectJ Runtime v1.8.2, Copyright (c) 1999-2001 Xerox Corporation, 2002 Palo Alto Research Center, Incorporated (PARC) and AspectJ Weaver v1.8.2 Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC)., libraries. The library information is available at
|
||||
(https://eclipse.org/aspectj/)
|
||||
|
||||
Apache Fineract includes IText(A Free Java PDF Library) v2.1.7 library, Copyright 2007 Bruno Lowagie. The library information is available at (http://developers.itextpdf.com/itext-java)
|
||||
|
||||
=====================
|
||||
Apache OpenJPA NOTICE
|
||||
|
||||
OpenJPA includes software developed by the SERP project
|
||||
Copyright (c) 2002-2006, A. Abram White. All rights reserved.
|
||||
|
||||
OpenJPA includes the persistence and orm schemas from the JPA specifications.
|
||||
Copyright 2005-2014 Sun Microsystems, Inc. All rights reserved.
|
||||
|
||||
OpenJPA includes the persistence and orm schemas from the JPA specifications.
|
||||
Copyright 2005-2009 Sun Microsystems, Inc. All rights reserved.
|
||||
OpenJPA elects to include this software in this distribution under the
|
||||
CDDL license. You can obtain a copy of the License at:
|
||||
https://glassfish.dev.java.net/public/CDDL+GPL.html
|
||||
The source code is available at:
|
||||
https://glassfish.dev.java.net/source/browse/glassfish/
|
||||
|
||||
OpenJPA includes software written by Miroslav Nachev
|
||||
@@ -1,72 +1,69 @@
|
||||
Mifos X: A Platform for Microfinance
|
||||
======
|
||||
|
||||
The next evolution of mifos focussing being faster, lighter and cheaper to change (than existing mifos) so that it is more responsive to the needs of MFI’s and Integrators
|
||||
|
||||
Build Status
|
||||
Apache Fineract: A Platform for Microfinance
|
||||
============
|
||||
|
||||
Travis
|
||||
The next evolution of Apache Fineract focuses on being faster, lighter and cheaper to change (than the existing Mifos) so that it is more responsive to the needs of Microfinance Institutions and Integrators.
|
||||
|
||||
[](https://travis-ci.org/openMF/mifosx)
|
||||
Requirements
|
||||
============
|
||||
* Java >= 1.8 (Oracle JVMS have been tested)
|
||||
* gradle-wrapper.jar version 2.10
|
||||
* MySQL 5.5
|
||||
|
||||
Cloudbees Jenkins
|
||||
Instructions to build war file
|
||||
============
|
||||
|
||||
[](https://openmf.ci.cloudbees.com/job/MIFOSX%20INTEGRATION%20TEST/)
|
||||
1. Extract the archive file to your local directory.
|
||||
2. Download gradle-wrapper.jar version 2.10 and place it in the fineract-provider/gradle/wrapper folder.
|
||||
3. Change the current working directory to fineract-provider.
|
||||
4. Run `./gradlew clean war` or `./gradlew build` to build deployable war file which will be created at fineract-provider/build/libs directory.
|
||||
|
||||
<a target="_blank" href="https://openmf.ci.cloudbees.com/job/MIFOSX%20INTEGRATION%20TEST/" title="Jenkins@CloudBees">Jenkins@CloudBees Unit + Integration Tests</a>
|
||||
|
||||
Instructions to execute Integration tests
|
||||
============
|
||||
1. Login to mysql DB using `mysql -u root -pmysql`
|
||||
2. Create the mifosplatform-tenants database using `CREATE DATABASE mifosplatform-tenants`.
|
||||
3. Create the default tenant database using `CREATE DATABASE mifostenant-default`.
|
||||
4. With fineract-provider as current working directory run the following commands:
|
||||
1. `./gradlew migrateTenantListDB -PdbName=mifosplatform-tenants`
|
||||
2. `./gradlew migrateTenantDB -PdbName=mifostenant-default`
|
||||
5. Run `./gradlew clean integrationTest`
|
||||
|
||||
Version
|
||||
==========
|
||||
============
|
||||
|
||||
The API for the mifos-platform (project named 'Mifos X')is documented in the api-docs under <b>Full API Matrix</b> and can be viewed <a target="_blank" href="https://demo.openmf.org/api-docs/apiLive.htm" title="API Documentation"> here
|
||||
</a>
|
||||
|
||||
Latest stable release can always been viewed on master branch: <a target="_blank" href="https://github.com/openMF/mifosx/tree/master" title="Latest Release">Latest Release on Master</a>, <a target="_blank" href="https://github.com/openMF/mifosx/blob/master/CHANGELOG.md" title="Latest release change log">View change log</a>
|
||||
The latest stable release can be viewed on the develop branch: [Latest Release on Develop](https://github.com/apache/incubator-fineract/tree/develop "Latest Release"), [View change log](https://github.com/apache/incubator-fineract/blob/develop/CHANGELOG.md "Latest release change log")
|
||||
|
||||
License
|
||||
=============
|
||||
============
|
||||
|
||||
This project is licensed under the open source MPL V2. See https://github.com/openMF/mifosx/blob/master/LICENSE.md
|
||||
This project is licensed under Apache License Version 2.0. See <https://github.com/apache/incubator-fineract/blob/develop/LICENSE.md>.
|
||||
|
||||
Mifos Platform API
|
||||
=====================
|
||||
|
||||
<a target="_blank" href="https://demo.openmf.org/api-docs/apiLive.htm" title="mifos platform api">API Documentation (Demo Server)</a>
|
||||
Apache Fineract Platform API
|
||||
============
|
||||
|
||||
The API for the Fineract-platform (project named 'Apache Fineract') is documented in the API-docs under <b>Full API Matrix</b> and can be viewed [here](https://demo.openmf.org/api-docs/apiLive.htm "API Documentation").
|
||||
|
||||
Online Demos
|
||||
=============================
|
||||
============
|
||||
|
||||
* <a target="_blank" href="https://demo.openmf.org" title="Reference Client App">Community App</a>
|
||||
* ~~<a target="_blank" href="https://demo.openmf.org/old/" title="Community App">Reference Client App (Deprecated)</a>~~
|
||||
* [Community App](https://demo.openmf.org "Reference Client App")
|
||||
|
||||
Developers
|
||||
==========
|
||||
see https://mifosforge.jira.com/wiki/display/MIFOSX/MifosX+Technical - Developers Wiki Page
|
||||
============
|
||||
Please see <https://cwiki.apache.org/confluence/display/FINERACT/Contributor%27s+Zone> for the developers wiki page.
|
||||
|
||||
see https://mifosforge.jira.com/wiki/display/MIFOSX/Getting+started+-+Contributing+to+MifosX - Getting Started.
|
||||
|
||||
see https://mifosforge.jira.com/wiki/display/MIFOSX/The+Basic+Design - Overview of Platform Implementation
|
||||
|
||||
see https://github.com/openMF/mifosx/wiki/Screen-Based-Reporting for info around reporting
|
||||
|
||||
see https://github.com/openMF/mifosx/wiki/Git-Usuage for info around using git
|
||||
|
||||
see https://www.ohloh.net/p/mifosx for activity overview and basic code analysis.
|
||||
Please see <https://cwiki.apache.org/confluence/display/FINERACT/How-to+articles> for technical details to get started.
|
||||
|
||||
Roadmap
|
||||
==============
|
||||
============
|
||||
|
||||
<a target="_blank" href="http://goo.gl/IXS9Q" title="Community Roadmap (High Level)">Community Roadmap (High Level)</a>
|
||||
|
||||
<a target="_blank" href="https://mifosforge.jira.com/browse/MIFOSX#selectedTab=com.atlassian.jira.plugin.system.project%3Aroadmap-panel"
|
||||
title="Project Release Roadmap on JIRA (Detailed View)">Project Release Roadmap on JIRA (Detailed View)</a>
|
||||
[Project Release Roadmap on JIRA (Detailed View)](https://issues.apache.org/jira/browse/FINERACT-268?jql=project%20%3D%20FINERACT "Project Release Roadmap on JIRA (Detailed View)")
|
||||
|
||||
Video Demonstration
|
||||
===============
|
||||
============
|
||||
|
||||
Demonstration of first Prototype of this platform with browser App (April 2012) - http://www.youtube.com/watch?v=zN5Dn1Lc_js
|
||||
Apache Fineract / Mifos X Demo (November 2016) - <https://www.youtube.com/watch?v=h61g9TptMBo>
|
||||
|
||||
More Information
|
||||
============
|
||||
More details of the project can be found at <https://cwiki.apache.org/confluence/display/FINERACT>.
|
||||
@@ -1,46 +0,0 @@
|
||||
Versioning
|
||||
=====
|
||||
For releases, we follow a simplified date versioning scheme which ties in nicely with our time based release cycle (with stables releases being promoted on a three month cycle)
|
||||
|
||||
Prior to 15.03.RELEASE, we followed a semantic versioning approach. (http://semver.org/)
|
||||
|
||||
Date Versioning
|
||||
===================
|
||||
|
||||
Our date versioning scheme is built around the YY.MM.{PATCH}.{release_type} concept (for example 15.06.RELEASE or 15.06.1.BUILD-SNAPSHOT) where
|
||||
|
||||
YY represents the year of the release
|
||||
MM represents the month of the major release
|
||||
PATCH (optional) gets incremented whenever a new release is made from an existing major release
|
||||
release_type differentiates different builds off the same branch. It also differentiates between development, test and production builds.
|
||||
|
||||
Version structure
|
||||
|
||||
{number}.{release_type}
|
||||
|
||||
where {number} is further broken down as YY.MM.{PATCH}.
|
||||
|
||||
Examples:
|
||||
|
||||
15.03.BUILD-SNAPSHOT
|
||||
15.03.M1
|
||||
15.03.RC1
|
||||
15.03.RELEASE
|
||||
15.03.1.RC1
|
||||
15.03.1.RELEASE
|
||||
|
||||
Number semantics
|
||||
|
||||
In general:
|
||||
|
||||
a major version (Ex:15.03) does not have a patch number and suggests many significant new features, an associated marketing campaign, and possible breaking of backward compatibility. You can expect major releases every 3 months
|
||||
a minor version (Ex:15.03.1) may also contain serious new features, but typically contains many bug fixes and improvements and does not break compatibility. You can expect minor releases between the quarterly major release cycle.
|
||||
|
||||
|
||||
What You Should Install Where
|
||||
|
||||
As a rule of thumb …
|
||||
|
||||
Snapshot or Milestone versions should only be installed on dev boxes and integration environments. They shouldn’t be deployed to any of the dedicated test environments.
|
||||
Release candidates should be installed in the dedicated test environments. In an emergency, a release candidate can be installed into the production environment.
|
||||
Production releases can be installed anywhere - and they are the only kind of build that should be installed into the production environment.
|
||||
+11760
-364
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,7 @@
|
||||
background-color: #6eb4db !important;
|
||||
}
|
||||
|
||||
.mifosXHeading2 {
|
||||
.fineractHeading2 {
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
//font-size: 125%
|
||||
@@ -192,7 +192,7 @@ body {
|
||||
.flybar-nav {
|
||||
display: block;
|
||||
float: left;
|
||||
min-width: 90px;
|
||||
min-width: 60px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
Mifos Platform Apps
|
||||
======
|
||||
|
||||
Community created apps built on top of mifosplatform are stored in source control repository @ https://github.com/openMF/
|
||||
|
||||
To get the Git sub modules from here, use "--recursive" in your original git clone, or, if already cloned, do:
|
||||
|
||||
git submodule update --init --recursive; git submodule status
|
||||
|
||||
Later to update both this main repo but also get the latest from the submodule(s), do:
|
||||
|
||||
git pull; git submodule update --remote
|
||||
|
||||
Here is how a new Git submodule can (was originally) added here:
|
||||
|
||||
git submodule add -b develop https://github.com/openMF/community-app.git
|
||||
git submodule init
|
||||
|
||||
|
||||
The Community App (AngularJS-based)
|
||||
===============
|
||||
https://github.com/openMF/community-app
|
||||
|
||||
The Default app shipped which is a core part of every community release.
|
||||
|
||||
The original Reference App (Now Deprecated)
|
||||
===============
|
||||
|
||||
https://github.com/openMF/mifosx-community-apps/tree/master/IndividualLendingGeneralJavaScript
|
||||
|
||||
The reference app was used to showcase platform API capabilities and is also used in production by MFIs.
|
||||
Submodule apps/community-app deleted from e4cf52eb74
@@ -1,4 +1,23 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# https://developer.cloudbees.com/bin/view/DEV/Node+Builds
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
|
||||
# Exit the script if any command returns a non-true return value (http://www.davidpashley.com/articles/writing-robust-shell-scripts/)
|
||||
set -e
|
||||
@@ -15,5 +34,5 @@ git submodule foreach 'git checkout develop && git pull --ff-only origin develop
|
||||
|
||||
cd apps/community-app
|
||||
./build.sh
|
||||
cd ../../mifosng-provider/
|
||||
cd ../../fineract-provider/
|
||||
./gradlew -Penv=dev clean dist
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifosplatform-tenants
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifosplatform-tenants
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifostenant-default
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifostenant-default
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifostenant-ceda
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifostenant-ceda
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
DELETE FROM `ref_loan_transaction_processing_strategy` WHERE id in (1, 3, 4);
|
||||
|
||||
INSERT INTO `m_code` (`code_name`, `is_system_defined`)
|
||||
@@ -0,0 +1,123 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
DELETE FROM `m_organisation_currency` WHERE id>0;
|
||||
|
||||
INSERT INTO `m_organisation_currency`
|
||||
(
|
||||
`code`,
|
||||
`decimal_places`,
|
||||
`name`,
|
||||
`display_symbol`,
|
||||
`internationalized_name_code`)
|
||||
VALUES
|
||||
('UGX', 2, 'Uganda Shilling', 'USh', 'currency.UGX');
|
||||
|
||||
|
||||
UPDATE `m_appuser` SET `username` = 'admin' WHERE id=1;
|
||||
|
||||
INSERT INTO `m_appuser`
|
||||
(`is_deleted`,
|
||||
`office_id`,
|
||||
`username`,
|
||||
`firstname`,
|
||||
`lastname`,
|
||||
`password`,
|
||||
`email`,
|
||||
`firsttime_login_remaining`,
|
||||
`nonexpired`,
|
||||
`nonlocked`,
|
||||
`nonexpired_credentials`,
|
||||
`enabled`)
|
||||
VALUES
|
||||
(0, 1, 'keithwoodlock', 'Keith', 'Woodlock',
|
||||
'4f607e9b6cffbe7d3db92d4bfa3391c7aa751727b4ea29d08fddf9dd72e6e7e3', 'keithwoodlock@gmail.com', 0, 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO `m_appuser_role`
|
||||
(`appuser_id`,`role_id`) VALUES (2,1);
|
||||
|
||||
UPDATE `m_office` SET `name` = 'CEDA Microfinance Ltd.' WHERE id=1;
|
||||
|
||||
INSERT INTO `m_office`
|
||||
(
|
||||
`parent_id`,
|
||||
`hierarchy`,
|
||||
`external_id`,
|
||||
`name`,
|
||||
`opening_date`)
|
||||
VALUES
|
||||
(1, '.2.', 2, 'Uganda (Kampala)', '2009-01-01');
|
||||
|
||||
|
||||
INSERT INTO `m_staff`
|
||||
(
|
||||
`is_loan_officer`,
|
||||
`office_id`,
|
||||
`firstname`,
|
||||
`lastname`,
|
||||
`display_name`)
|
||||
VALUES
|
||||
(1, 1, 'CEDA HO', 'LoanOfficer', 'LoanOfficer, CEDA HO'),
|
||||
(1, 2, 'Kampala', 'LoanOfficer', 'LoanOfficer, Kampala');
|
||||
|
||||
|
||||
INSERT INTO `m_charge`
|
||||
(
|
||||
`name`,
|
||||
`currency_code`,
|
||||
`charge_applies_to_enum`,
|
||||
`charge_time_enum`,
|
||||
`charge_calculation_enum`,
|
||||
`amount`,
|
||||
`is_penalty`,
|
||||
`is_active`,
|
||||
`is_deleted`)
|
||||
VALUES ('Bank Fee (per installment)', 'UGX', 1, 2, 1, 1500.000000, 0, 1, 0);
|
||||
|
||||
|
||||
INSERT INTO `m_product_loan`
|
||||
(
|
||||
`currency_code`,
|
||||
`currency_digits`,
|
||||
`principal_amount`,
|
||||
`min_principal_amount`,
|
||||
`max_principal_amount`,
|
||||
`arrearstolerance_amount`,
|
||||
`name`,
|
||||
`description`,
|
||||
`fund_id`,
|
||||
`nominal_interest_rate_per_period`,
|
||||
`interest_period_frequency_enum`,
|
||||
`annual_nominal_interest_rate`,
|
||||
`interest_method_enum`,
|
||||
`interest_calculated_in_period_enum`,
|
||||
`repay_every`,
|
||||
`repayment_period_frequency_enum`,
|
||||
`number_of_repayments`,
|
||||
`amortization_method_enum`,
|
||||
`accounting_type`,
|
||||
`loan_transaction_strategy_id`)
|
||||
VALUES
|
||||
('UGX', 2, 1000000.000000, 0, 1000000000000.000000, null , 'Kampala Product (with cash accounting)',
|
||||
'Typical Kampala loan product with cash accounting enabled for testing.', null ,
|
||||
24.000000, 3, 24.000000, 1, 1, 1, 2, 12, 1, 2, 2);
|
||||
|
||||
-- mapping of that loan product to GL Accounts
|
||||
INSERT INTO `acc_product_mapping`
|
||||
VALUES (1,4,1,1,1),(2,8,1,1,2),(3,34,1,1,3),(4,37,1,1,4),(5,35,1,1,5),(6,97,1,1,6);
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifostenant-default
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- add code and code values for datatables dropdowns
|
||||
|
||||
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
|
||||
@@ -0,0 +1,58 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `risk_analysis`;
|
||||
CREATE TABLE `risk_analysis` (
|
||||
`client_id` bigint(20) NOT NULL,
|
||||
`proposed_loan_amount` decimal(19,6) DEFAULT NULL,
|
||||
`assets_cash` decimal(19,6) DEFAULT NULL,
|
||||
`assets_bank_accounts` decimal(19,6) DEFAULT NULL,
|
||||
`assets_accounts_receivable` decimal(19,6) DEFAULT NULL,
|
||||
`assets_inventory` decimal(19,6) DEFAULT NULL,
|
||||
`assets_total_fixed_business` decimal(19,6) DEFAULT NULL,
|
||||
`assets_total_business` decimal(19,6) DEFAULT NULL,
|
||||
`assets_total_household` decimal(19,6) DEFAULT NULL,
|
||||
`liabilities_accounts_payable` decimal(19,6) DEFAULT NULL,
|
||||
`liabilities_business_debts` decimal(19,6) DEFAULT NULL,
|
||||
`liabilities_total_business` decimal(19,6) DEFAULT NULL,
|
||||
`liabilities_equity_working_capital` decimal(19,6) DEFAULT NULL,
|
||||
`liabilities_total_household` decimal(19,6) DEFAULT NULL,
|
||||
`liabilities_household_equity` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_cash_sales` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_cash_sales2` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_cost_goods_sold` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_cost_goods_sold2` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_gross_profit` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_other_income1` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_total_income2` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_household_expense` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_payments_to_savings` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_operational_expenses` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_disposable_income` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_amount_loan_installment` decimal(19,6) DEFAULT NULL,
|
||||
`cashflow_available_surplus` decimal(19,6) DEFAULT NULL,
|
||||
`fi_inventory_turnover` decimal(19,6) DEFAULT NULL,
|
||||
`fi_gross_margin` decimal(19,6) DEFAULT NULL,
|
||||
`fi_indebtedness` decimal(19,6) DEFAULT NULL,
|
||||
`fi_loan_recommendation` decimal(19,6) DEFAULT NULL,
|
||||
`fi_roe` decimal(19,6) DEFAULT NULL,
|
||||
`fi_repayment_capacity` decimal(19,6) DEFAULT NULL,
|
||||
PRIMARY KEY (`client_id`),
|
||||
CONSTRAINT `FK_risk_analysis_1` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifostenant-default
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `latam_extra_client_details`;
|
||||
CREATE TABLE `latam_extra_client_details` (
|
||||
`client_id` bigint(20) NOT NULL,
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- drop tables in base-schema
|
||||
SET foreign_key_checks = 0;
|
||||
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
-- currency symbols may not apply through command line on windows so use a different client like mysql workbench
|
||||
|
||||
INSERT INTO `ref_loan_transaction_processing_strategy`
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
|
||||
-- ========= roles and permissions =========
|
||||
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
--
|
||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||
-- or more contributor license agreements. See the NOTICE file
|
||||
-- distributed with this work for additional information
|
||||
-- regarding copyright ownership. The ASF licenses this file
|
||||
-- to you under the Apache License, Version 2.0 (the
|
||||
-- "License"); you may not use this file except in compliance
|
||||
-- with the License. You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing,
|
||||
-- software distributed under the License is distributed on an
|
||||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
-- KIND, either express or implied. See the License for the
|
||||
-- specific language governing permissions and limitations
|
||||
-- under the License.
|
||||
--
|
||||
|
||||
truncate table stretchy_report;
|
||||
truncate table stretchy_parameter;
|
||||
truncate table stretchy_report_parameter;
|
||||
@@ -0,0 +1,11 @@
|
||||
bin
|
||||
out/
|
||||
build
|
||||
repos
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
.gradle
|
||||
*.log
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
/gradle
|
||||
@@ -0,0 +1,498 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
description = '''\
|
||||
Run as:
|
||||
gradle clean tomcatrunwar
|
||||
'''
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
maven { url "https://plugins.gradle.org/m2/" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:1.0',
|
||||
'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0',
|
||||
'org.zeroturnaround:gradle-jrebel-plugin:1.1.2',
|
||||
'org.springframework.boot:spring-boot-gradle-plugin:1.1.6.RELEASE' // also change springDataJpaVersion below
|
||||
classpath 'org.apache.openjpa:openjpa-all:2.4.1'
|
||||
classpath 'at.schmutterer.oss.gradle:gradle-openjpa:0.2.0'
|
||||
classpath 'gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.2'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: "org.nosphere.apache.rat"
|
||||
apply plugin: 'rebel'
|
||||
apply plugin: 'license'
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'spring-boot'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'tomcat'
|
||||
apply plugin: 'project-report'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'openjpa'
|
||||
|
||||
/* define the valid syntax level for source files */
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
/* define binary compatibility version */
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
project.ext.springBootVersion = '1.1.6.RELEASE'
|
||||
project.ext.springVersion = '4.0.7.RELEASE'
|
||||
project.ext.springOauthVersion = '2.0.4.RELEASE'
|
||||
project.ext.jerseyVersion = '1.17'
|
||||
project.ext.springDataJpaVersion = '1.7.0.RELEASE' // also change spring-boot-gradle-plugin version above
|
||||
|
||||
project.ext.mysqlUser='root'
|
||||
project.ext.mysqlPassword='mysql'
|
||||
|
||||
|
||||
group = 'org.apache.fineract'
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
// mavenLocal() // useful for local dev using MariaDB4j SNAPSHOTs (not needed for real-world non-SNAPHOT builds)
|
||||
}
|
||||
openjpa {
|
||||
files = fileTree(sourceSets.main.output.classesDir).matching {
|
||||
include '**/AbstractPersistableCustom.class'
|
||||
include '**/domain/*.class'
|
||||
|
||||
}
|
||||
enforcePropertyRestrictions = true
|
||||
}
|
||||
|
||||
rat {
|
||||
xmlOutput = false
|
||||
htmlOutput = false
|
||||
plainOutput = true
|
||||
verbose = true
|
||||
inputDir = './..'
|
||||
excludes = [
|
||||
'**/licenses/**',
|
||||
'**/*.md',
|
||||
'**/*.txt',
|
||||
'**/*.log',
|
||||
'**/fineractdev-eclipse-preferences.epf',
|
||||
'**/template-expected.html',
|
||||
'**/template.mustache',
|
||||
'**/.classpath',
|
||||
'**/.project',
|
||||
'**/.idea/**',
|
||||
'**/.settings/**',
|
||||
'**/bin/**',
|
||||
'**/.git/**',
|
||||
'**/.gitignore',
|
||||
'**/.gitkeep',
|
||||
'**/*.iml',
|
||||
|
||||
// gradle
|
||||
'**/.gradle/**',
|
||||
'**/gradlew',
|
||||
'**/gradlew.bat',
|
||||
'**/gradle/wrapper/gradle-wrapper.properties',
|
||||
'**/caches/**',
|
||||
'**/daemon/**',
|
||||
'**/native/**',
|
||||
'**/wrapper/**',
|
||||
'**/build/**',
|
||||
|
||||
//Api Docs
|
||||
'**/api-docs/*.*',
|
||||
'**/docs/system-architecture/.htaccess',
|
||||
'**/docs/system-architecture/404.html',
|
||||
'**/docs/system-architecture/index.html',
|
||||
'**/docs/system-architecture/**/*.xml',
|
||||
'**/bootstrap-3.0.0/assets/application.js',
|
||||
'**/system-architecture/js/plugins.js',
|
||||
|
||||
//Apache License
|
||||
'**/bootstrap-3.0.0/assets/less.js',
|
||||
'**/css/bootstrap-3.0.0/**/*.*',
|
||||
|
||||
//Public Domain See http://www.JSON.org/js.html
|
||||
'**/bootstrap-3.0.0/assets/json2.js.htm',
|
||||
|
||||
// MIT License
|
||||
'**/modernizr-2.6.2.min.js',
|
||||
'**/css/normalize.css',
|
||||
'**/assets/filesaver.js',
|
||||
'**/css/fonts/glyphicons-halflings-regular.svg',
|
||||
'**/assets/jszip.js',
|
||||
'**/assets/jquery.js',
|
||||
'**/api-docs/jquery-1.7.min.js',
|
||||
'**/css/toc-0.1.2/**/*.*',
|
||||
'**/docs/system-architecture/css/main.css',
|
||||
'**/system-architecture/js/vendor/jquery-1.9.1.min.js',
|
||||
'**/system-architecture/js/vendor/toc-0.1.2/jquery.toc.min.js',
|
||||
'**/assets/respond.min.js',
|
||||
'**/assets/html5shiv.js',
|
||||
|
||||
//BSD License
|
||||
'**/assets/uglify.js'
|
||||
]
|
||||
}
|
||||
|
||||
configurations {
|
||||
providedRuntime // needed for Spring Boot executable WAR
|
||||
providedCompile
|
||||
compile() {
|
||||
exclude module: 'hibernate-entitymanager'
|
||||
exclude module: 'hibernate-validator'
|
||||
exclude module: 'activation'
|
||||
exclude module: 'bcmail-jdk14'
|
||||
exclude module: 'bcprov-jdk14'
|
||||
exclude module: 'bctsp-jdk14'
|
||||
exclude module: 'bval-core'
|
||||
exclude module: 'org.apache.bval.bundle'
|
||||
exclude module: 'bval-jsr303'
|
||||
exclude module: 'c3p0'
|
||||
exclude module: 'stax-api'
|
||||
exclude module: 'jaxb-api'
|
||||
exclude module: 'jaxb-impl'
|
||||
exclude module: 'jboss-logging'
|
||||
exclude module: 'itext-rtf'
|
||||
exclude module: 'classworlds'
|
||||
exclude module: 'jcl-over-slf4j'
|
||||
exclude module: 'jul-to-slf4j'
|
||||
exclude module: 'serp'
|
||||
}
|
||||
runtime
|
||||
all*.exclude group: 'commons-logging'
|
||||
}
|
||||
/* Pick up dependencies based on the environemnt, defaults to production */
|
||||
if (project.hasProperty('env') && project.getProperty('env') == 'dev') {
|
||||
apply from: 'dev-dependencies.gradle'
|
||||
} else {
|
||||
apply from: 'dependencies.gradle'
|
||||
}
|
||||
|
||||
/* Enable Oauth2 authentication based on environment, default to HTTP basic auth */
|
||||
if (project.hasProperty('security') && project.getProperty('security') == 'oauth') {
|
||||
copy {
|
||||
from './properties/oauth/'
|
||||
into 'src/main/resources/'
|
||||
include '*.properties'
|
||||
}
|
||||
} else {
|
||||
copy {
|
||||
from './properties/basicauth/'
|
||||
into 'src/main/resources/'
|
||||
include '*.properties'
|
||||
}
|
||||
}
|
||||
|
||||
task dist(type:Zip){
|
||||
baseName = 'fineractplatform'
|
||||
version = qualifyVersionIfNecessary(releaseVersion)
|
||||
includeEmptyDirs = true
|
||||
from('../') {
|
||||
fileMode = 0755
|
||||
include '*.md'
|
||||
}
|
||||
from('src/main/dist') {
|
||||
fileMode = 0755
|
||||
include '*'
|
||||
}
|
||||
from('../apps') {
|
||||
fileMode = 0755
|
||||
include '**/*'
|
||||
into('apps')
|
||||
}
|
||||
from('../api-docs/') {
|
||||
fileMode = 0755
|
||||
include '*'
|
||||
into('api-docs')
|
||||
}
|
||||
from('../fineract-db/') {
|
||||
fileMode = 0755
|
||||
include '*.sql'
|
||||
into('database')
|
||||
}
|
||||
from('src/main/resources/sql/migrations') {
|
||||
fileMode = 0755
|
||||
include '**/*'
|
||||
into('database/migrations')
|
||||
}
|
||||
|
||||
from war.outputs.files
|
||||
into(baseName + '-' + version)
|
||||
}
|
||||
|
||||
compileJava{
|
||||
dependsOn rat
|
||||
}
|
||||
|
||||
war {
|
||||
from('../licenses') { // notice the parens
|
||||
into "WEB-INF/licenses/" // no leading slash
|
||||
}
|
||||
from('../LICENSE') { // notice the parens
|
||||
into "WEB-INF/" // no leading slash
|
||||
}
|
||||
from('../NOTICE') { // notice the parens
|
||||
into "WEB-INF/" // no leading slash
|
||||
}
|
||||
war.finalizedBy(bootRepackage)
|
||||
}
|
||||
|
||||
license {
|
||||
header rootProject.file('../LICENSE.md')
|
||||
excludes(["**/*.html", "**/*.mustache", "**/package-info.java", "**/keystore.jks"])
|
||||
strictCheck true
|
||||
}
|
||||
|
||||
task licenseFormatBuildScripts (type:nl.javadude.gradle.plugins.license.License) {
|
||||
source = fileTree(dir: '../', includes: ['**/*.bat', '**/*.sh', '**/*.sql'])
|
||||
}
|
||||
licenseFormat.dependsOn licenseFormatBuildScripts
|
||||
|
||||
tomcatRun {
|
||||
httpPort = 8080
|
||||
httpsPort = 8443
|
||||
stopPort = 8081
|
||||
stopKey= 'stopKey'
|
||||
enableSSL = true
|
||||
configFile = file('src/test/resources/META-INF/context.xml')
|
||||
}
|
||||
|
||||
tomcatRunWar {
|
||||
httpPort = 8080
|
||||
httpsPort = 8443
|
||||
stopPort = 8081
|
||||
stopKey= 'stopKey'
|
||||
enableSSL = true
|
||||
keystoreFile = file('src/main/resources/keystore.jks')
|
||||
keystorePass = 'openmf'
|
||||
configFile = file('src/test/resources/META-INF/context.xml')
|
||||
}
|
||||
|
||||
/* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
|
||||
sourceSets.main.output.resourcesDir = sourceSets.main.output.classesDir
|
||||
sourceSets.test.output.resourcesDir = sourceSets.test.output.classesDir
|
||||
|
||||
/* Exclude maria db and embedded tomcat related files for non dev builds */
|
||||
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
exclude '**/Server*'
|
||||
exclude '**/MariaDB4j*'
|
||||
exclude '**/EmbeddedTomcatWithSSLConfiguration.java'
|
||||
}
|
||||
}
|
||||
test {
|
||||
java {
|
||||
exclude '**/core/boot/tests/**'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
integrationTest {
|
||||
compileClasspath += main.output + test.output
|
||||
runtimeClasspath += main.output + test.output
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
integrationTestCompile.extendsFrom testCompile
|
||||
integrationTestRuntime.extendsFrom testRuntime
|
||||
}
|
||||
|
||||
task integrationTest(type:Test){
|
||||
description = "Run integration tests (located in src/integrationTest/java). Starts tomcat in daemon mode before executing the tests."
|
||||
it.dependsOn war
|
||||
doFirst {
|
||||
tomcatRunWar.daemon = true
|
||||
tomcatRunWar.execute()
|
||||
}
|
||||
testClassesDir = project.sourceSets.integrationTest.output.classesDir
|
||||
classpath = project.sourceSets.integrationTest.runtimeClasspath
|
||||
}
|
||||
|
||||
|
||||
import groovy.sql.Sql
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
configurations {
|
||||
driver
|
||||
}
|
||||
dependencies {
|
||||
driver 'org.drizzle.jdbc:drizzle-jdbc:1.3'
|
||||
}
|
||||
|
||||
test {
|
||||
filter {
|
||||
//includeTestsMatching "org.apache.fineract.infrastructure.configuration.spring.SpringConfigurationTest.*"
|
||||
includeTestsMatching "org.apache.fineract.template.TemplateMergeServiceTest.*"
|
||||
}
|
||||
}
|
||||
|
||||
URLClassLoader loader = GroovyObject.class.classLoader
|
||||
configurations.driver.each {File file ->
|
||||
loader.addURL(file.toURL())
|
||||
}
|
||||
|
||||
task createDB<<{
|
||||
description= "Creates the Database. Needs database name to be passed (like: -PdbName=someDBname)"
|
||||
sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
|
||||
sql.execute( 'create database '+"`$dbName`" )
|
||||
}
|
||||
|
||||
task dropDB<<{
|
||||
description= "Drops the specified database. The database name has to be passed (like: -PdbName=someDBname)"
|
||||
sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
|
||||
sql.execute( 'DROP DATABASE '+"`$dbName`")
|
||||
}
|
||||
task setBlankPassword<<{
|
||||
sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
|
||||
sql.execute('USE `mifosplatform-tenants`')
|
||||
sql.execute('UPDATE mifosplatform-tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;')
|
||||
}
|
||||
|
||||
|
||||
apply plugin: 'flyway'
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.flywaydb:flyway-gradle-plugin:3.0" // version upgraded during Spring Boot & MariaDB4j work, as prev. used v0.2 didn't work well after *.sql moved from fineract-db to fineract-provider/src/main/resources (new version also has clearer errors, e.g. in case of missing DB)
|
||||
classpath 'org.drizzle.jdbc:drizzle-jdbc:1.3'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flyway {
|
||||
url = "jdbc:mysql:thin://localhost:3306/mifostenant-default"
|
||||
driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
user = mysqlUser
|
||||
password = mysqlPassword
|
||||
}
|
||||
|
||||
task migrateTenantDB<<{
|
||||
description="Migrates a Tenant DB. Optionally can pass dbName. Defaults to 'mifostenant-default' (Example: -PdbName=someTenantDBname)"
|
||||
|
||||
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/core_db'
|
||||
def tenantDbName = 'mifostenant-default';
|
||||
if (rootProject.hasProperty("dbName")) {
|
||||
tenantDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantDbName"
|
||||
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
flyway.locations= [filePath]
|
||||
/**We use ${ as the prefix for strecthy reporting, do not want them to be interpreted by Flyway**/
|
||||
flyway.placeholderPrefix = "\$\${"
|
||||
flywayMigrate.execute()
|
||||
}
|
||||
|
||||
task showTenantDBInfo<<{
|
||||
description="Shows the migration info for a Tenant DB. Optionally can pass dbName. Defaults to 'mifostenant-default' (Example: -PdbName=someTenantDBname)"
|
||||
|
||||
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/core_db'
|
||||
def tenantDbName = 'mifostenant-default';
|
||||
if (rootProject.hasProperty("dbName")) {
|
||||
tenantDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantDbName"
|
||||
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
flyway.locations= [filePath]
|
||||
flywayInfo.execute()
|
||||
}
|
||||
|
||||
|
||||
task migrateTenantListDB<<{
|
||||
description="Migrates a Tenant List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
|
||||
|
||||
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/list_db'
|
||||
def tenantsDbName = 'mifosplatform-tenants';
|
||||
if (rootProject.hasProperty("dbName")) {
|
||||
tenantsDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
flyway.locations= [filePath]
|
||||
|
||||
flywayMigrate.execute()
|
||||
}
|
||||
|
||||
task showTenantListDBInfo<<{
|
||||
description="Shows the migration info for a List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
|
||||
|
||||
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/list_db'
|
||||
def tenantsDbName = 'mifosplatform-tenants';
|
||||
if (rootProject.hasProperty("dbName")) {
|
||||
tenantsDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
flyway.locations= [filePath]
|
||||
flywayInfo.execute()
|
||||
}
|
||||
|
||||
task repairTenantDB<<{
|
||||
description="repair migrate"
|
||||
|
||||
def filePath = "filesystem:$projectDir" + '/src/main/resources/sql/migrations/list_db'
|
||||
def tenantsDbName = 'mifosplatform-tenants';
|
||||
if (rootProject.hasProperty("dbName")) {
|
||||
tenantsDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
flyway.locations= [filePath]
|
||||
flywayRepair.execute()
|
||||
}
|
||||
|
||||
/*
|
||||
* Support publication of artifacts versioned by topic branch.
|
||||
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
|
||||
* If <TOPIC> starts with 'MIFOSX-', change version
|
||||
* from BUILD-SNAPSHOT => <TOPIC>-SNAPSHOT
|
||||
* e.g. 1.1.0.BUILD-SNAPSHOT => 1.0.0.MIFOSX-1234-SNAPSHOT
|
||||
*/
|
||||
def qualifyVersionIfNecessary(version) {
|
||||
|
||||
if (rootProject.hasProperty("BRANCH_NAME")) {
|
||||
def qualifier = rootProject.getProperty("BRANCH_NAME")
|
||||
if (qualifier.startsWith("MIFOSX-")) {
|
||||
return version.replace('BUILD', qualifier)
|
||||
}
|
||||
}
|
||||
return version
|
||||
}
|
||||
|
||||
springBoot {
|
||||
mainClass = 'org.apache.fineract.ServerWithMariaDB4jApplication'
|
||||
}
|
||||
bootRepackage {
|
||||
mainClass = 'org.apache.fineract.ServerWithMariaDB4jApplication'
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
dependencies {
|
||||
def tomcatVersion = '7.0.54'
|
||||
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
|
||||
"org.apache.tomcat.embed:tomcat-embed-logging-log4j:${tomcatVersion}" // NOT tomcat-embed-logging-juli (http://stackoverflow.com/questions/23963049/classcircularityerror-java-util-logging-logrecord-running-gradle-webapp-with-ja)
|
||||
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
|
||||
exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj'
|
||||
}
|
||||
tomcat "org.apache.tomcat:tomcat-dbcp:${tomcatVersion}"
|
||||
|
||||
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
|
||||
|
||||
providedCompile(
|
||||
// [group: 'javax.servlet', name: 'servlet-api', version: '2.5'],
|
||||
)
|
||||
|
||||
compile(
|
||||
// [group: 'ch.vorburger.mariaDB4j', name: 'mariaDB4j', version: '2.1.3'],
|
||||
|
||||
[group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion],
|
||||
[group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: springBootVersion],
|
||||
[group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: springBootVersion],
|
||||
//[group: 'org.eclipse.persistence', name: 'javax.persistence', version: '2.0.0'],
|
||||
[group: 'org.springframework', name: 'spring-context-support', version: springVersion],
|
||||
|
||||
[group: 'org.springframework.security.oauth', name: 'spring-security-oauth2', version: springOauthVersion],
|
||||
|
||||
[group: 'org.apache.openjpa', name:'openjpa-all', version:'2.4.1'],
|
||||
//[group: 'org.apache.openjpa', name:'openjpa-maven-plugin', version:'2.4.1'],
|
||||
//[group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1'],
|
||||
[group: 'com.sun.jersey', name: 'jersey-core', version: jerseyVersion],
|
||||
[group: 'com.sun.jersey', name: 'jersey-servlet', version: jerseyVersion],
|
||||
[group: 'com.sun.jersey', name: 'jersey-server', version: jerseyVersion],
|
||||
[group: 'com.sun.jersey', name: 'jersey-json', version: jerseyVersion],
|
||||
[group: 'com.sun.jersey.contribs', name: 'jersey-spring', version: jerseyVersion],
|
||||
[group: 'com.sun.jersey.contribs', name: 'jersey-multipart', version: jerseyVersion],
|
||||
|
||||
[group: 'com.squareup.retrofit', name: 'retrofit', version: '1.6.1'],
|
||||
[group: 'com.squareup.okhttp', name: 'okhttp', version: '2.0.0'],
|
||||
[group: 'com.squareup.okhttp', name: 'okhttp-urlconnection', version: '2.0.0'],
|
||||
|
||||
|
||||
[group: 'com.google.code.gson', name: 'gson', version: '2.2.4'],
|
||||
[group: 'com.google.guava', name: 'guava', version: '15.0'],
|
||||
|
||||
[group: 'joda-time', name: 'joda-time', version: '2.4'],
|
||||
//[group: 'net.sourceforge.javacsv', name: 'javacsv', version: '2.0'],
|
||||
[group: 'org.apache.commons', name: 'commons-email', version: '1.3.3'],
|
||||
[group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'],
|
||||
|
||||
// no slf4j & logback here (anymore), as spring-boot-starter-logging already brings this now, better assembled (log4j-over-slf4j was originally forgotten here)
|
||||
|
||||
//[group: 'mysql', name: 'mysql-connector-java', version: '5.1.27'],
|
||||
[group: 'org.drizzle.jdbc', name: 'drizzle-jdbc', version: '1.3'],
|
||||
// [group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: tomcatVersion],
|
||||
|
||||
|
||||
[group: 'org.apache.poi',name: 'poi', version: '3.9'],
|
||||
[group: 'org.apache.poi',name: 'poi-ooxml', version: '3.9'],
|
||||
[group: 'org.apache.poi',name: 'poi-ooxml-schemas', version: '3.9'],
|
||||
|
||||
[group: 'com.lowagie', name: 'itext', version: '2.1.7'],
|
||||
//[group: 'com.lowagie', name: 'itext-rtf', version: '2.1.7'],
|
||||
[group: 'org.mnode.ical4j', name: 'ical4j', version: '1.0.4'],
|
||||
[group: 'com.googlecode.flyway', name: 'flyway-core', version: '2.1.1'],
|
||||
[group: 'org.quartz-scheduler', name: 'quartz', version: '2.1.7'],
|
||||
[group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.2.1'],
|
||||
[group: 'net.sf.ehcache', name: 'ehcache', version: '2.7.2'],
|
||||
[group: 'com.github.spullara.mustache.java', name: 'compiler', version: '0.8.12'],
|
||||
[group: 'com.jayway.jsonpath', name: 'json-path', version: '0.9.1'],
|
||||
|
||||
// Although fineract (at the time of writing) doesn't have any compile time dep. on this,
|
||||
// it's useful to have this for the Spring Boot TestRestTemplate http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-rest-templates-test-utility
|
||||
[group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.5'],
|
||||
// Once we've switched to Java 8 this dep can be removed.
|
||||
//[group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0']
|
||||
)
|
||||
testCompile 'junit:junit:4.11',
|
||||
'junit:junit-dep:4.11',
|
||||
'org.mockito:mockito-core:1.9.5',
|
||||
'com.jayway.restassured:rest-assured:2.3.3',
|
||||
[group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion]
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
dependencies {
|
||||
def tomcatVersion = '7.0.54'
|
||||
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
|
||||
"org.apache.tomcat.embed:tomcat-embed-logging-log4j:${tomcatVersion}" // NOT tomcat-embed-logging-juli (http://stackoverflow.com/questions/23963049/classcircularityerror-java-util-logging-logrecord-running-gradle-webapp-with-ja)
|
||||
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
|
||||
exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj'
|
||||
}
|
||||
tomcat "org.apache.tomcat:tomcat-dbcp:${tomcatVersion}"
|
||||
|
||||
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
|
||||
|
||||
providedCompile(
|
||||
// [group: 'javax.servlet', name: 'servlet-api', version: '2.5'],
|
||||
)
|
||||
|
||||
compile(
|
||||
[group: 'ch.vorburger.mariaDB4j', name: 'mariaDB4j', version: '2.1.3'],
|
||||
|
||||
[group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion],
|
||||
[group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: springBootVersion],
|
||||
[group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: springBootVersion],
|
||||
//[group: 'org.eclipse.persistence', name: 'javax.persistence', version: '2.0.0'],
|
||||
[group: 'org.springframework', name: 'spring-context-support', version: springVersion],
|
||||
[group: 'org.springframework.security.oauth', name: 'spring-security-oauth2', version: springOauthVersion],
|
||||
|
||||
[group: 'org.apache.openjpa', name:'openjpa-all', version:'2.4.1'],
|
||||
[group: 'org.apache.openjpa', name:'openjpa-maven-plugin', version:'2.4.1'],
|
||||
[group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1'],
|
||||
[group: 'com.sun.jersey', name: 'jersey-core', version: jerseyVersion],
|
||||
[group: 'com.sun.jersey', name: 'jersey-servlet', version: jerseyVersion],
|
||||
[group: 'com.sun.jersey', name: 'jersey-server', version: jerseyVersion],
|
||||
[group: 'com.sun.jersey', name: 'jersey-json', version: jerseyVersion],
|
||||
[group: 'com.sun.jersey.contribs', name: 'jersey-spring', version: jerseyVersion],
|
||||
[group: 'com.sun.jersey.contribs', name: 'jersey-multipart', version: jerseyVersion],
|
||||
|
||||
[group: 'com.squareup.retrofit', name: 'retrofit', version: '1.6.1'],
|
||||
[group: 'com.squareup.okhttp', name: 'okhttp', version: '2.0.0'],
|
||||
[group: 'com.squareup.okhttp', name: 'okhttp-urlconnection', version: '2.0.0'],
|
||||
|
||||
|
||||
[group: 'com.google.code.gson', name: 'gson', version: '2.2.4'],
|
||||
[group: 'com.google.guava', name: 'guava', version: '15.0'],
|
||||
|
||||
[group: 'joda-time', name: 'joda-time', version: '2.4'],
|
||||
//[group: 'net.sourceforge.javacsv', name: 'javacsv', version: '2.0'],
|
||||
[group: 'org.apache.commons', name: 'commons-email', version: '1.3.3'],
|
||||
[group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'],
|
||||
|
||||
// no slf4j & logback here (anymore), as spring-boot-starter-logging already brings this now, better assembled (log4j-over-slf4j was originally forgotten here)
|
||||
|
||||
//[group: 'mysql', name: 'mysql-connector-java', version: '5.1.27'],
|
||||
[group: 'org.drizzle.jdbc', name: 'drizzle-jdbc', version: '1.3'],
|
||||
[group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: tomcatVersion],
|
||||
|
||||
|
||||
[group: 'org.apache.poi',name: 'poi', version: '3.9'],
|
||||
[group: 'org.apache.poi',name: 'poi-ooxml', version: '3.9'],
|
||||
[group: 'org.apache.poi',name: 'poi-ooxml-schemas', version: '3.9'],
|
||||
|
||||
[group: 'com.lowagie', name: 'itext', version: '2.1.7'],
|
||||
[group: 'com.lowagie', name: 'itext-rtf', version: '2.1.7'],
|
||||
[group: 'org.mnode.ical4j', name: 'ical4j', version: '1.0.4'],
|
||||
[group: 'com.googlecode.flyway', name: 'flyway-core', version: '2.1.1'],
|
||||
[group: 'org.quartz-scheduler', name: 'quartz', version: '2.1.7'],
|
||||
[group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.2.1'],
|
||||
[group: 'net.sf.ehcache', name: 'ehcache', version: '2.7.2'],
|
||||
[group: 'com.github.spullara.mustache.java', name: 'compiler', version: '0.8.12'],
|
||||
[group: 'com.jayway.jsonpath', name: 'json-path', version: '0.9.1'],
|
||||
|
||||
// Although fineract (at the time of writing) doesn't have any compile time dep. on this,
|
||||
// it's useful to have this for the Spring Boot TestRestTemplate http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-rest-templates-test-utility
|
||||
[group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.5'],
|
||||
// Once we've switched to Java 8 this dep can be removed.
|
||||
//[group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0']
|
||||
)
|
||||
testCompile 'junit:junit:4.11',
|
||||
'junit:junit-dep:4.11',
|
||||
'org.mockito:mockito-core:1.9.5',
|
||||
'com.jayway.restassured:rest-assured:2.3.3',
|
||||
[group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion]
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
releaseVersion=0.3.2-incubating
|
||||
buildType=BUILD
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
#Fri Jan 29 13:04:36 IST 2016
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
DEFAULT_JVM_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8005,server=y,suspend=n"
|
||||
|
||||
CATALINA_OPTS="-Xms512m -Xmx2048m"
|
||||
JAVA_OPTS="-Xms512m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=512m"
|
||||
JAVA_OPTS="-Xms512m -Xmx2048m"
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
Vendored
+113
@@ -0,0 +1,113 @@
|
||||
@REM
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8005,server=y,suspend=n
|
||||
|
||||
set CATALINA_OPTS=-Xms512m -Xmx512m
|
||||
set JAVA_OPTS=-Xms512m -Xmx512m
|
||||
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
spring.profiles.default=basicauth
|
||||
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
spring.profiles.default=basicauth
|
||||
spring.profiles.active=oauth
|
||||
+33
-20
@@ -1,31 +1,44 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.CenterDomain;
|
||||
import org.apache.fineract.integrationtests.common.CenterHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.GroupHelper;
|
||||
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.system.AccountNumberPreferencesHelper;
|
||||
import org.apache.fineract.integrationtests.common.system.CodeHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.CenterDomain;
|
||||
import org.mifosplatform.integrationtests.common.CenterHelper;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.GroupHelper;
|
||||
import org.mifosplatform.integrationtests.common.OfficeHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.system.AccountNumberPreferencesHelper;
|
||||
import org.mifosplatform.integrationtests.common.system.CodeHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -274,7 +287,7 @@ public class AccountNumberPreferencesTest {
|
||||
this.groupID = GroupHelper.activateGroup(this.requestSpec, this.responseSpec, groupID.toString());
|
||||
GroupHelper.verifyGroupActivatedOnServer(this.requestSpec, this.responseSpec, groupID, true);
|
||||
|
||||
final String GROUP_URL = "/mifosng-provider/api/v1/groups/" + this.groupID + "?" + Utils.TENANT_IDENTIFIER;
|
||||
final String GROUP_URL = "/fineract-provider/api/v1/groups/" + this.groupID + "?" + Utils.TENANT_IDENTIFIER;
|
||||
this.groupAccountNo = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "accountNo");
|
||||
|
||||
if (isAccountPreferenceSetUp) {
|
||||
@@ -305,7 +318,7 @@ public class AccountNumberPreferencesTest {
|
||||
if (isAccountPreferenceSetUp) {
|
||||
String centerPrefixName = (String) this.accountNumberPreferencesHelper.getAccountNumberPreference(
|
||||
this.centerAccountNumberPreferenceId, "prefixType.value");
|
||||
final String CENTER_URL = "/mifosng-provider/api/v1/centers/" + this.centerId + "?" + Utils.TENANT_IDENTIFIER;
|
||||
final String CENTER_URL = "/fineract-provider/api/v1/centers/" + this.centerId + "?" + Utils.TENANT_IDENTIFIER;
|
||||
|
||||
if (centerPrefixName.equals(this.officeName)) {
|
||||
final String centerOfficeName = Utils.performServerGet(requestSpec, responseSpec, CENTER_URL, "officeName");
|
||||
+35
-22
@@ -1,37 +1,50 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntry;
|
||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account.AccountType;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.AccountTransferHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.OfficeHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.FinancialActivityAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account.AccountType;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.AccountTransferHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+50
-39
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -18,34 +31,34 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntry;
|
||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.PeriodicAccrualAccountingHelper;
|
||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositAccountStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
|
||||
import org.joda.time.Days;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.SchedulerJobHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.PeriodicAccrualAccountingHelper;
|
||||
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositAccountStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -153,8 +166,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
float expected_value = this.LP_PRINCIPAL - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(1, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountFirstEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[1], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(FIRST_INTEREST, JournalEntry.TransactionType.CREDIT),
|
||||
new JournalEntry(FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
|
||||
new JournalEntry(FIRST_INTEREST + FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountFirstEntry);
|
||||
System.out.println("Repayment 1 Done......");
|
||||
|
||||
@@ -166,8 +178,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
expected_value = expected_value - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(2, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountSecondEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[2], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(SECOND_AND_THIRD_INTEREST, JournalEntry.TransactionType.CREDIT),
|
||||
new JournalEntry(SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
|
||||
new JournalEntry(SECOND_AND_THIRD_INTEREST + SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[2], assetAccountSecondEntry);
|
||||
System.out.println("Repayment 2 Done ......");
|
||||
|
||||
@@ -303,7 +314,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
ChargesHelper.getSavingsWithdrawalFeeJSON());
|
||||
Assert.assertNotNull(withdrawalChargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsID, withdrawalChargeId);
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsID, withdrawalChargeId, false);
|
||||
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsID);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
HashMap savingsChargeForPay = chargesPendingState.get(0);
|
||||
@@ -508,6 +519,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
final String fixedDepositProductJSON = fixedDepositProductHelper //
|
||||
.withPeriodRangeChart()//
|
||||
.withAccountingRuleAsCashBased(accounts).build(validFrom, validTo);
|
||||
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
@@ -516,7 +528,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
final String validTo, final String submittedOnDate, final String penalInterestType) {
|
||||
System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
|
||||
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, penalInterestType);
|
||||
return this.fixedDepositAccountHelper
|
||||
.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
|
||||
}
|
||||
@@ -525,6 +537,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
|
||||
RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
final String recurringDepositProductJSON = recurringDepositProductHelper //
|
||||
.withPeriodRangeChart()//
|
||||
.withAccountingRuleAsCashBased(accounts).build(validFrom, validTo);
|
||||
return RecurringDepositProductHelper.createRecurringDepositProduct(recurringDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
@@ -535,7 +548,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
//
|
||||
.withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate)
|
||||
.build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
.build(clientID, productID, penalInterestType);
|
||||
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
}
|
||||
@@ -590,8 +603,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
float expected_value = this.LP_PRINCIPAL - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(1, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountFirstEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[1], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(FIRST_INTEREST, JournalEntry.TransactionType.CREDIT),
|
||||
new JournalEntry(FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
|
||||
new JournalEntry(FIRST_INTEREST + FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountFirstEntry);
|
||||
System.out.println("Repayment 1 Done......");
|
||||
|
||||
@@ -607,8 +619,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
FEE_PORTION, PENALTY_PORTION, loanID);
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(2, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountSecondEntry = { new JournalEntry(this.REPAYMENT_AMOUNT[2], JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(SECOND_AND_THIRD_INTEREST, JournalEntry.TransactionType.CREDIT),
|
||||
new JournalEntry(SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
|
||||
new JournalEntry(SECOND_AND_THIRD_INTEREST + SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[2], assetAccountSecondEntry);
|
||||
System.out.println("Repayment 2 Done ......");
|
||||
|
||||
@@ -708,7 +719,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
float expected_value = this.LP_PRINCIPAL - PRINCIPAL_VALUE_FOR_EACH_PERIOD;
|
||||
this.loanTransactionHelper.verifyRepaymentScheduleEntryFor(1, expected_value, loanID);
|
||||
final JournalEntry[] assetAccountEntry = { new JournalEntry(15000f, JournalEntry.TransactionType.DEBIT),
|
||||
new JournalEntry(1000f, JournalEntry.TransactionType.CREDIT), new JournalEntry(10000f, JournalEntry.TransactionType.CREDIT) };
|
||||
new JournalEntry(11000f, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(overpaymentAccount, this.REPAYMENT_DATE[1], new JournalEntry(4000f,
|
||||
JournalEntry.TransactionType.CREDIT));
|
||||
+41
-28
@@ -1,24 +1,37 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.batch.domain.BatchRequest;
|
||||
import org.apache.fineract.batch.domain.BatchResponse;
|
||||
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
|
||||
import org.apache.fineract.integrationtests.common.BatchHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.batch.domain.BatchRequest;
|
||||
import org.mifosplatform.batch.domain.BatchResponse;
|
||||
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
||||
import org.mifosplatform.integrationtests.common.BatchHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -30,14 +43,14 @@ import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
/**
|
||||
* Test class for
|
||||
* {@link org.mifosplatform.batch.command.CommandStrategyProvider}. This tests
|
||||
* {@link org.apache.fineract.batch.command.CommandStrategyProvider}. This tests
|
||||
* the response provided by commandStrategy by injecting it with a
|
||||
* {@code BatchRequest}.
|
||||
*
|
||||
* @author RishabhShukla
|
||||
*
|
||||
* @see org.mifosplatform.integrationtests.common.BatchHelper
|
||||
* @see org.mifosplatform.batch.domain.BatchRequest
|
||||
* @see org.apache.fineract.integrationtests.common.BatchHelper
|
||||
* @see org.apache.fineract.batch.domain.BatchRequest
|
||||
*/
|
||||
public class BatchApiTest {
|
||||
|
||||
@@ -66,7 +79,7 @@ public class BatchApiTest {
|
||||
* code. For a unknownRequest a statusCode 501 is returned back with
|
||||
* response.
|
||||
*
|
||||
* @see org.mifosplatform.batch.command.internal.UnknownCommandStrategy
|
||||
* @see org.apache.fineract.batch.command.internal.UnknownCommandStrategy
|
||||
*/
|
||||
@Test
|
||||
public void shouldReturnStatusNotImplementedUnknownCommand() {
|
||||
@@ -89,7 +102,7 @@ public class BatchApiTest {
|
||||
* createClientCommand. A successful response with statusCode '200' is
|
||||
* returned back.
|
||||
*
|
||||
* @see org.mifosplatform.batch.command.internal.CreateClientCommandStrategy
|
||||
* @see org.apache.fineract.batch.command.internal.CreateClientCommandStrategy
|
||||
*/
|
||||
@Test
|
||||
public void shouldReturnOkStatusForCreateClientCommand() {
|
||||
@@ -110,9 +123,9 @@ public class BatchApiTest {
|
||||
* one of the request in BatchRequest fails then all transactions are rolled
|
||||
* back.
|
||||
*
|
||||
* @see org.mifosplatform.batch.command.internal.CreateClientCommandStrategy
|
||||
* @see org.mifosplatform.batch.api.BatchApiResource
|
||||
* @see org.mifosplatform.batch.service.BatchApiService
|
||||
* @see org.apache.fineract.batch.command.internal.CreateClientCommandStrategy
|
||||
* @see org.apache.fineract.batch.api.BatchApiResource
|
||||
* @see org.apache.fineract.batch.service.BatchApiService
|
||||
*/
|
||||
@Test
|
||||
public void shouldRollBackAllTransactionsOnFailure() {
|
||||
@@ -152,7 +165,7 @@ public class BatchApiTest {
|
||||
* updateClientCommand. A 'changes' parameter is returned in the response
|
||||
* after successful update of client information.
|
||||
*
|
||||
* @see org.mifosplatform.batch.command.internal.UpdateClientCommandStrategy
|
||||
* @see org.apache.fineract.batch.command.internal.UpdateClientCommandStrategy
|
||||
*/
|
||||
@Test
|
||||
public void shouldReflectChangesOnClientUpdate() {
|
||||
@@ -187,7 +200,7 @@ public class BatchApiTest {
|
||||
* This also verifies the successful resolution of dependencies among two
|
||||
* requests.
|
||||
*
|
||||
* @see org.mifosplatform.batch.command.internal.ApplyLoanCommandStrategy
|
||||
* @see org.apache.fineract.batch.command.internal.ApplyLoanCommandStrategy
|
||||
*/
|
||||
@Test
|
||||
public void shouldReturnOkStatusForApplyLoanCommand() {
|
||||
@@ -236,7 +249,7 @@ public class BatchApiTest {
|
||||
* 200(OK) status was returned. It first creates a new client and a savings
|
||||
* product, then uses the cliendId and ProductId to apply a savings account.
|
||||
*
|
||||
* @see org.mifosplatform.batch.command.internal.ApplySavingsCommandStrategy
|
||||
* @see org.apache.fineract.batch.command.internal.ApplySavingsCommandStrategy
|
||||
*/
|
||||
@Test
|
||||
public void shouldReturnOkStatusForApplySavingsCommand() {
|
||||
@@ -279,8 +292,8 @@ public class BatchApiTest {
|
||||
* It first creates a new client and apply a loan, then creates a new charge
|
||||
* for the create loan and then fetches all the applied charges
|
||||
*
|
||||
* @see org.mifosplatform.batch.command.internal.CollectChargesCommandStrategy
|
||||
* @see org.mifosplatform.batch.command.internal.CreateChargeCommandStrategy
|
||||
* @see org.apache.fineract.batch.command.internal.CollectChargesCommandStrategy
|
||||
* @see org.apache.fineract.batch.command.internal.CreateChargeCommandStrategy
|
||||
*/
|
||||
@Test
|
||||
public void shouldReturnOkStatusForCollectChargesCommand() {
|
||||
@@ -330,7 +343,7 @@ public class BatchApiTest {
|
||||
* 'ActivateClientCommandStrategy'. A '200' status code is expected on
|
||||
* successful activation.
|
||||
*
|
||||
* @see org.mifosplatform.batch.command.internal.ActivateClientCommandStrategy
|
||||
* @see org.apache.fineract.batch.command.internal.ActivateClientCommandStrategy
|
||||
*/
|
||||
@Test
|
||||
public void shouldReturnOkStatusOnSuccessfulClientActivation() {
|
||||
@@ -360,8 +373,8 @@ public class BatchApiTest {
|
||||
* 'ApproveLoanCommandStrategy' and 'DisburseLoanCommandStrategy'. A '200'
|
||||
* status code is expected on successful activation.
|
||||
*
|
||||
* @see org.mifosplatform.batch.command.internal.ApproveLoanCommandStrategy
|
||||
* @see org.mifosplatform.batch.command.internal.DisburseLoanCommandStrategy
|
||||
* @see org.apache.fineract.batch.command.internal.ApproveLoanCommandStrategy
|
||||
* @see org.apache.fineract.batch.command.internal.DisburseLoanCommandStrategy
|
||||
*/
|
||||
@Test
|
||||
public void shouldReturnOkStatusOnSuccessfulLoanApprovalAndDisburse() {
|
||||
+25
-12
@@ -1,24 +1,37 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.batch.domain.BatchRequest;
|
||||
import org.apache.fineract.batch.domain.BatchResponse;
|
||||
import org.apache.fineract.integrationtests.common.BatchHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.GroupHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.batch.domain.BatchRequest;
|
||||
import org.mifosplatform.batch.domain.BatchResponse;
|
||||
import org.mifosplatform.integrationtests.common.BatchHelper;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.GroupHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+23
-10
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -12,14 +25,14 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.CenterDomain;
|
||||
import org.apache.fineract.integrationtests.common.CenterHelper;
|
||||
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.CenterDomain;
|
||||
import org.mifosplatform.integrationtests.common.CenterHelper;
|
||||
import org.mifosplatform.integrationtests.common.OfficeHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.organisation.StaffHelper;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
@@ -177,7 +190,7 @@ public class CenterIntegrationTest {
|
||||
map.put("active", "true");
|
||||
map.put("activationDate", "04 March 2011");
|
||||
|
||||
groupMembers[i] = Utils.performServerPost(requestSpec, responseSpec, "/mifosng-provider/api/v1/groups?"
|
||||
groupMembers[i] = Utils.performServerPost(requestSpec, responseSpec, "/fineract-provider/api/v1/groups?"
|
||||
+ Utils.TENANT_IDENTIFIER, new Gson().toJson(map), "groupId");
|
||||
}
|
||||
return groupMembers;
|
||||
+19
-6
@@ -1,18 +1,31 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+298
-229
File diff suppressed because it is too large
Load Diff
+2118
File diff suppressed because it is too large
Load Diff
+61
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ClientStatusChecker {
|
||||
|
||||
public static void verifyClientIsActive(final HashMap<String, Object> clientStatusHashMap) {
|
||||
assertEquals((int) clientStatusHashMap.get("id"), 300);
|
||||
}
|
||||
|
||||
public static void verifyClientClosed(final HashMap<String, Object> clientStatusHashMap) {
|
||||
System.out.println("\n-------------------------------------- VERIFYING CLIENT IS CLOSED ------------------------------------");
|
||||
assertEquals((int) clientStatusHashMap.get("id"), 600);
|
||||
System.out.println("Client Status:" + clientStatusHashMap + "\n");
|
||||
}
|
||||
|
||||
public static void verifyClientPending(final HashMap<String, Object> clientStatusHashMap) {
|
||||
System.out.println("\n-------------------------------------- VERIFYING CLIENT IS PENDING ------------------------------------");
|
||||
assertEquals((int) clientStatusHashMap.get("id"), 100);
|
||||
System.out.println("Client Status:" + clientStatusHashMap + "\n");
|
||||
}
|
||||
|
||||
public static void verifyClientRejected(final HashMap<String, Object> clientStatusHashMap) {
|
||||
System.out.println("\n-------------------------------------- VERIFYING CLIENT IS REJECTED ------------------------------------");
|
||||
assertEquals((int) clientStatusHashMap.get("id"), 700);
|
||||
System.out.println("Client Status:" + clientStatusHashMap + "\n");
|
||||
}
|
||||
|
||||
public static void verifyClientActiavted(final HashMap<String, Object> clientStatusHashMap) {
|
||||
System.out.println("\n-------------------------------------- VERIFYING CLIENT IS ACTIVATED ------------------------------------");
|
||||
assertEquals((int) clientStatusHashMap.get("id"), 300);
|
||||
System.out.println("Client Status:" + clientStatusHashMap + "\n");
|
||||
}
|
||||
|
||||
public static void verifyClientWithdrawn(final HashMap<String, Object> clientStatusHashMap) {
|
||||
System.out.println("\n-------------------------------------- VERIFYING CLIENT IS WITHDRAWN ------------------------------------");
|
||||
assertEquals((int) clientStatusHashMap.get("id"), 800);
|
||||
System.out.println("Client Status:" + clientStatusHashMap + "\n");
|
||||
}
|
||||
|
||||
}
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
public class ClientTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private ClientHelper clientHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClientStatus() {
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
|
||||
ClientStatusChecker.verifyClientIsActive(status);
|
||||
|
||||
HashMap<String, Object> clientStatusHashMap = this.clientHelper.closeClient(clientId);
|
||||
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
|
||||
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.rejectClient(clientId);
|
||||
ClientStatusChecker.verifyClientRejected(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.activateClient(clientId);
|
||||
ClientStatusChecker.verifyClientActiavted(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.closeClient(clientId);
|
||||
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
|
||||
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.withdrawClient(clientId);
|
||||
ClientStatusChecker.verifyClientWithdrawn(clientStatusHashMap);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClientAsPersonStatus() {
|
||||
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientAsPerson(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
|
||||
ClientStatusChecker.verifyClientIsActive(status);
|
||||
|
||||
HashMap<String, Object> clientStatusHashMap = this.clientHelper.closeClient(clientId);
|
||||
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
|
||||
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.rejectClient(clientId);
|
||||
ClientStatusChecker.verifyClientRejected(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.activateClient(clientId);
|
||||
ClientStatusChecker.verifyClientActiavted(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.closeClient(clientId);
|
||||
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
|
||||
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.withdrawClient(clientId);
|
||||
ClientStatusChecker.verifyClientWithdrawn(clientStatusHashMap);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClientAsEntityStatus() {
|
||||
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientAsEntity(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
|
||||
ClientStatusChecker.verifyClientIsActive(status);
|
||||
|
||||
HashMap<String, Object> clientStatusHashMap = this.clientHelper.closeClient(clientId);
|
||||
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
|
||||
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.rejectClient(clientId);
|
||||
ClientStatusChecker.verifyClientRejected(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.activateClient(clientId);
|
||||
ClientStatusChecker.verifyClientActiavted(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.closeClient(clientId);
|
||||
ClientStatusChecker.verifyClientClosed(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.reactivateClient(clientId);
|
||||
ClientStatusChecker.verifyClientPending(clientStatusHashMap);
|
||||
|
||||
clientStatusHashMap = this.clientHelper.withdrawClient(clientId);
|
||||
ClientStatusChecker.verifyClientWithdrawn(clientStatusHashMap);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+353
@@ -0,0 +1,353 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.apache.fineract.portfolio.client.api.ClientApiConstants;
|
||||
import org.apache.fineract.portfolio.client.domain.Client;
|
||||
import org.apache.fineract.portfolio.client.exception.InvalidClientStateTransitionException;
|
||||
import org.apache.fineract.useradministration.domain.AppUser;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "unused" })
|
||||
public class ClientUndoRejectAndWithdrawalIntegrationTest {
|
||||
|
||||
private static final String CREATE_CLIENT_URL = "/fineract-provider/api/v1/clients?" + Utils.TENANT_IDENTIFIER;
|
||||
public static final String DATE_FORMAT = "dd MMMM yyyy";
|
||||
private final String submittedOnDate = "submittedOnDate";
|
||||
private final String officeId = "officeId";
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private ClientHelper clientHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization",
|
||||
"Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clientUndoRejectIntegrationTest() {
|
||||
|
||||
// CREATE CLIENT
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
// GET CLIENT STATUS
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
|
||||
String.valueOf(clientId));
|
||||
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
status = this.clientHelper.rejectClient(clientId);
|
||||
ClientStatusChecker.verifyClientRejected(status);
|
||||
|
||||
status = this.clientHelper.undoReject(clientId);
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClientUndoRejectWithDateBeforeRejectDate() {
|
||||
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
|
||||
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
|
||||
|
||||
// CREATE CLIENT
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
// GET CLIENT STATUS
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
|
||||
String.valueOf(clientId));
|
||||
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
status = this.clientHelper.rejectClient(clientId);
|
||||
ClientStatusChecker.verifyClientRejected(status);
|
||||
|
||||
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoRejectedclient(clientId,
|
||||
CommonConstants.RESPONSE_ERROR, ClientHelper.CREATED_DATE);
|
||||
assertEquals("error.msg.client.reopened.date.cannot.before.client.rejected.date",
|
||||
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
status = this.clientHelper.undoReject(clientId);
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Test
|
||||
public void testClientUndoRejectWithoutReject() {
|
||||
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
|
||||
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
|
||||
|
||||
// CREATE CLIENT
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
// GET CLIENT STATUS
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
|
||||
String.valueOf(clientId));
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
final String undoRejectDate = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoRejectedclient(clientId,
|
||||
CommonConstants.RESPONSE_ERROR, undoRejectDate);
|
||||
assertEquals("error.msg.client.undorejection.on.nonrejected.account",
|
||||
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
status = this.clientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClientUndoRejectWithFutureDate() {
|
||||
|
||||
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
|
||||
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
|
||||
|
||||
// CREATE CLIENT
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
// GET CLIENT STATUS
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
|
||||
String.valueOf(clientId));
|
||||
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
status = this.clientHelper.rejectClient(clientId);
|
||||
ClientStatusChecker.verifyClientRejected(status);
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.DATE, 1);
|
||||
final String undoRejectDate = dateFormat.format(todaysDate.getTime());
|
||||
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoWithdrawclient(clientId,
|
||||
CommonConstants.RESPONSE_ERROR, undoRejectDate);
|
||||
assertEquals("validation.msg.client.reopenedDate.is.greater.than.date",
|
||||
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
status = this.clientHelper.undoReject(clientId);
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clientUndoWithDrawnIntegrationTest() {
|
||||
|
||||
// CREATE CLIENT
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
// GET CLIENT STATUS
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
|
||||
String.valueOf(clientId));
|
||||
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
status = this.clientHelper.withdrawClient(clientId);
|
||||
ClientStatusChecker.verifyClientWithdrawn(status);
|
||||
|
||||
status = this.clientHelper.undoWithdrawn(clientId);
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClientUndoWithDrawnWithDateBeforeWithdrawal() {
|
||||
|
||||
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
|
||||
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
|
||||
|
||||
// CREATE CLIENT
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
// GET CLIENT STATUS
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
|
||||
String.valueOf(clientId));
|
||||
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
status = this.clientHelper.withdrawClient(clientId);
|
||||
ClientStatusChecker.verifyClientWithdrawn(status);
|
||||
|
||||
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoWithdrawclient(clientId,
|
||||
CommonConstants.RESPONSE_ERROR, ClientHelper.CREATED_DATE);
|
||||
assertEquals("error.msg.client.reopened.date.cannot.before.client.withdrawal.date",
|
||||
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
status = this.clientHelper.undoWithdrawn(clientId);
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Test
|
||||
public void testClientUndoWithDrawnWithoutWithdrawal() {
|
||||
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
|
||||
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
|
||||
// CREATE CLIENT
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
// GET CLIENT STATUS
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
|
||||
String.valueOf(clientId));
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
final String undoWithdrawDate = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoWithdrawclient(clientId,
|
||||
CommonConstants.RESPONSE_ERROR, undoWithdrawDate);
|
||||
assertEquals("error.msg.client.undoWithdrawal.on.nonwithdrawal.account",
|
||||
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
status = this.clientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClientUndoWithDrawnWithFutureDate() {
|
||||
|
||||
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
|
||||
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
|
||||
|
||||
// CREATE CLIENT
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
// GET CLIENT STATUS
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
|
||||
String.valueOf(clientId));
|
||||
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
status = this.clientHelper.withdrawClient(clientId);
|
||||
ClientStatusChecker.verifyClientWithdrawn(status);
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.DATE, 1);
|
||||
final String undoWithdrawDate = dateFormat.format(todaysDate.getTime());
|
||||
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.undoWithdrawclient(clientId,
|
||||
CommonConstants.RESPONSE_ERROR, undoWithdrawDate);
|
||||
assertEquals("validation.msg.client.reopenedDate.is.greater.than.date",
|
||||
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
status = this.clientHelper.undoWithdrawn(clientId);
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Test
|
||||
public void testValidateReopenedDate() {
|
||||
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
|
||||
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
|
||||
|
||||
// CREATE CLIENT
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
// GET CLIENT STATUS
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
|
||||
String.valueOf(clientId));
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
status = this.clientHelper.withdrawClient(clientId);
|
||||
ClientStatusChecker.verifyClientWithdrawn(status);
|
||||
status = this.clientHelper.undoWithdrawn(clientId);
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
ArrayList<HashMap> clientErrorData = (ArrayList<HashMap>) validationErrorHelper.activateClient(clientId,
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("error.msg.clients.submittedOnDate.after.reopened.date",
|
||||
((HashMap<String, Object>) clientErrorData.get(0)).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReopenedDate() {
|
||||
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
|
||||
final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
|
||||
|
||||
// CREATE CLIENT
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
// GET CLIENT STATUS
|
||||
HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
|
||||
String.valueOf(clientId));
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
status = this.clientHelper.withdrawClient(clientId);
|
||||
ClientStatusChecker.verifyClientWithdrawn(status);
|
||||
status = this.clientHelper.undoWithdrawn(clientId);
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
status = this.clientHelper.activateClientWithDiffDateOption(clientId, ClientHelper.CREATED_DATE_PLUS_TWO);
|
||||
|
||||
}
|
||||
|
||||
private static String randomIDGenerator(final String prefix, final int lenOfRandomSuffix) {
|
||||
return Utils.randomStringGenerator(prefix, lenOfRandomSuffix, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
}
|
||||
|
||||
}
|
||||
+30
-12
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -12,14 +25,14 @@ import java.util.Locale;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -80,7 +93,7 @@ public class ConcurrencyIntegrationTest {
|
||||
|
||||
private Integer createLoanProduct(final boolean multiDisburseLoan, final String accountingRule, final Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
|
||||
final String loanProductJSON = new LoanProductTestBuilder() //
|
||||
LoanProductTestBuilder builder = new LoanProductTestBuilder() //
|
||||
.withPrincipal("12,000.00") //
|
||||
.withNumberOfRepayments("4") //
|
||||
.withRepaymentAfterEvery("1") //
|
||||
@@ -90,7 +103,12 @@ public class ConcurrencyIntegrationTest {
|
||||
.withAmortizationTypeAsEqualInstallments() //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withTranches(multiDisburseLoan) //
|
||||
.withAccounting(accountingRule, accounts).build(null);
|
||||
.withAccounting(accountingRule, accounts);
|
||||
|
||||
if (multiDisburseLoan) {
|
||||
builder = builder.withInterestCalculationPeriodTypeAsRepaymentPeriod(true);
|
||||
}
|
||||
final String loanProductJSON = builder.build(null);
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.CurrenciesHelper;
|
||||
import org.apache.fineract.integrationtests.common.CurrencyDomain;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "unused", "rawtypes" })
|
||||
public class CurrenciesTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurrencyElements() {
|
||||
|
||||
CurrencyDomain currency = CurrenciesHelper.getCurrencybyCode(requestSpec, responseSpec, "USD");
|
||||
CurrencyDomain usd = CurrencyDomain.create("USD", "US Dollar", 2, "$", "currency.USD", "US Dollar ($)").build();
|
||||
|
||||
Assert.assertTrue(currency.getDecimalPlaces() >= 0);
|
||||
Assert.assertNotNull(currency.getName());
|
||||
Assert.assertNotNull(currency.getDisplaySymbol());
|
||||
Assert.assertNotNull(currency.getDisplayLabel());
|
||||
Assert.assertNotNull(currency.getNameCode());
|
||||
|
||||
Assert.assertEquals(usd, currency);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateCurrencySelection() {
|
||||
|
||||
// Test updation
|
||||
ArrayList<String> currenciestoUpdate = new ArrayList<String>();
|
||||
currenciestoUpdate.add("KES");
|
||||
currenciestoUpdate.add("BND");
|
||||
currenciestoUpdate.add("LBP");
|
||||
currenciestoUpdate.add("GHC");
|
||||
currenciestoUpdate.add("USD");
|
||||
currenciestoUpdate.add("INR");
|
||||
|
||||
|
||||
ArrayList<String> currenciesOutput = CurrenciesHelper.updateSelectedCurrencies(this.requestSpec, this.responseSpec,
|
||||
currenciestoUpdate);
|
||||
Assert.assertNotNull(currenciesOutput);
|
||||
|
||||
Assert.assertEquals("Verifying Do Outputed Currencies Match after Updation", currenciestoUpdate, currenciesOutput);
|
||||
|
||||
// Test that output matches updation
|
||||
ArrayList<CurrencyDomain> currenciesBeforeUpdate = new ArrayList<CurrencyDomain>();
|
||||
for (String e : currenciestoUpdate) {
|
||||
currenciesBeforeUpdate.add(CurrenciesHelper.getCurrencybyCode(requestSpec, responseSpec, e));
|
||||
}
|
||||
Collections.sort(currenciesBeforeUpdate);
|
||||
|
||||
ArrayList<CurrencyDomain> currenciesAfterUpdate = CurrenciesHelper.getSelectedCurrencies(requestSpec, responseSpec);
|
||||
Assert.assertNotNull(currenciesAfterUpdate);
|
||||
|
||||
Assert.assertEquals("Verifying Do Selected Currencies Match after Updation", currenciesBeforeUpdate, currenciesAfterUpdate);
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.junit.Before;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
public class CurrencyIntegrationTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private SavingsAccountHelper savingsAccountHelper;
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
}
|
||||
+28
-15
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -14,12 +27,12 @@ import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.*;
|
||||
import org.apache.fineract.integrationtests.common.loans.*;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.*;
|
||||
import org.mifosplatform.integrationtests.common.loans.*;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -51,7 +64,7 @@ public class DisbursalAndRepaymentScheduleTest {
|
||||
private final String numberOfRepayments = "12";
|
||||
private final String interestRatePerPeriod = "18";
|
||||
|
||||
private final SimpleDateFormat dateFormatterMifosStandard = new SimpleDateFormat("dd MMMM yyyy");
|
||||
private final SimpleDateFormat dateFormatterStandard = new SimpleDateFormat("dd MMMM yyyy");
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
@@ -78,17 +91,17 @@ public class DisbursalAndRepaymentScheduleTest {
|
||||
|
||||
meetingCalendar.add(Calendar.WEEK_OF_YEAR, -3);
|
||||
|
||||
final String groupMeetingDate = this.dateFormatterMifosStandard.format(meetingCalendar.getTime());
|
||||
final String groupMeetingDate = this.dateFormatterStandard.format(meetingCalendar.getTime());
|
||||
|
||||
final String disbursalDate = groupMeetingDate; // first meeting date
|
||||
// after group creation
|
||||
|
||||
final String rescheduleSubmittedDate = this.dateFormatterMifosStandard.format(new java.util.Date());
|
||||
final String rescheduleSubmittedDate = this.dateFormatterStandard.format(new java.util.Date());
|
||||
|
||||
final String loanType = "jlg";
|
||||
final String rescheduleInterestRate = "28.0";
|
||||
groupMeetingChangeCalendar.add(Calendar.DAY_OF_YEAR, 1);
|
||||
final String groupMeetingNewStartDate = this.dateFormatterMifosStandard.format(groupMeetingChangeCalendar.getTime());
|
||||
final String groupMeetingNewStartDate = this.dateFormatterStandard.format(groupMeetingChangeCalendar.getTime());
|
||||
// The date
|
||||
// from
|
||||
// which we
|
||||
@@ -99,11 +112,11 @@ public class DisbursalAndRepaymentScheduleTest {
|
||||
// this is a
|
||||
// tuesday.
|
||||
groupMeetingChangeCalendar.add(Calendar.WEEK_OF_YEAR, 2);
|
||||
final String rescheduleDate = this.dateFormatterMifosStandard.format(groupMeetingChangeCalendar.getTime());
|
||||
final String rescheduleDate = this.dateFormatterStandard.format(groupMeetingChangeCalendar.getTime());
|
||||
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
|
||||
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.generalResponseSpec = new ResponseSpecBuilder().build();
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
@@ -218,14 +231,14 @@ public class DisbursalAndRepaymentScheduleTest {
|
||||
|
||||
meetingCalendar.add(Calendar.WEEK_OF_YEAR, -3);
|
||||
|
||||
final String groupMeetingDate = this.dateFormatterMifosStandard.format(meetingCalendar.getTime());
|
||||
final String groupMeetingDate = this.dateFormatterStandard.format(meetingCalendar.getTime());
|
||||
|
||||
final String disbursalDate = groupMeetingDate; // first meeting date
|
||||
// after group creation
|
||||
|
||||
final String loanType = "jlg";
|
||||
groupMeetingChangeCalendar.add(Calendar.DAY_OF_YEAR, 1);
|
||||
final String groupMeetingNewStartDate = this.dateFormatterMifosStandard.format(groupMeetingChangeCalendar.getTime());
|
||||
final String groupMeetingNewStartDate = this.dateFormatterStandard.format(groupMeetingChangeCalendar.getTime());
|
||||
// The date
|
||||
// from
|
||||
// which we
|
||||
@@ -238,7 +251,7 @@ public class DisbursalAndRepaymentScheduleTest {
|
||||
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
|
||||
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.generalResponseSpec = new ResponseSpecBuilder().build();
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
+19
-6
@@ -1,18 +1,31 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ExternalServicesConfigurationHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ExternalServicesConfigurationHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+25
-12
@@ -1,28 +1,41 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
|
||||
import org.apache.fineract.accounting.financialactivityaccount.exception.DuplicateFinancialActivityAccountFoundException;
|
||||
import org.apache.fineract.accounting.financialactivityaccount.exception.FinancialActivityAccountInvalidException;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
|
||||
import org.mifosplatform.accounting.financialactivityaccount.exception.DuplicateFinancialActivityAccountFoundException;
|
||||
import org.mifosplatform.accounting.financialactivityaccount.exception.FinancialActivityAccountInvalidException;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.FinancialActivityAccountHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+606
-87
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -14,12 +27,33 @@ import java.text.DecimalFormatSymbols;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||
import org.apache.fineract.integrationtests.common.TaxComponentHelper;
|
||||
import org.apache.fineract.integrationtests.common.TaxGroupHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntry;
|
||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account.AccountType;
|
||||
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.Days;
|
||||
import org.joda.time.Months;
|
||||
@@ -27,23 +61,6 @@ import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.FinancialActivityAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account.AccountType;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -94,15 +111,15 @@ public class FixedDepositTest {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
|
||||
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
|
||||
this.financialActivityAccountHelper = new FinancialActivityAccountHelper(this.requestSpec);
|
||||
}
|
||||
|
||||
/***
|
||||
* Test case for Fixed Deposit Account premature closure with
|
||||
* transaction type withdrawal and Cash Based accounting enabled
|
||||
* Test case for Fixed Deposit Account premature closure with transaction
|
||||
* type withdrawal and Cash Based accounting enabled
|
||||
*/
|
||||
@Test
|
||||
public void testFixedDepositAccountWithPrematureClosureTypeWithdrawal() {
|
||||
@@ -110,7 +127,7 @@ public class FixedDepositTest {
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
|
||||
/***
|
||||
* Create GL Accounts for product account mapping
|
||||
*/
|
||||
@@ -157,8 +174,8 @@ public class FixedDepositTest {
|
||||
/***
|
||||
* Apply for FD account with created product and verify status
|
||||
*/
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
@@ -176,11 +193,11 @@ public class FixedDepositTest {
|
||||
*/
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
|
||||
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
|
||||
|
||||
Float depositAmount = (Float) accountSummary.get("totalDeposits");
|
||||
|
||||
|
||||
/***
|
||||
* Verify journal entries posted for initial deposit transaction which
|
||||
* happened at activation time
|
||||
@@ -201,7 +218,7 @@ public class FixedDepositTest {
|
||||
*/
|
||||
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
|
||||
Assert.assertNotNull(transactionIdForPostInterest);
|
||||
|
||||
|
||||
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
|
||||
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
|
||||
|
||||
@@ -227,18 +244,456 @@ public class FixedDepositTest {
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsPrematureClosed(fixedDepositAccountStatusHashMap);
|
||||
|
||||
|
||||
/***
|
||||
* Verify journal entry transactions for preclosure transaction
|
||||
*/
|
||||
HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float maturityAmount = Float.valueOf(accountDetails.get("maturityAmount").toString());
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
|
||||
JournalEntry.TransactionType.CREDIT));
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
|
||||
JournalEntry.TransactionType.DEBIT));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithPrematureClosureTypeWithdrawal_WITH_HOLD_TAX() {
|
||||
this.fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
/***
|
||||
* Create GL Accounts for product account mapping
|
||||
*/
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
final Account liabilityAccountForTax = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
DateFormat monthDayFormat = new SimpleDateFormat("dd MMM", Locale.US);
|
||||
DateFormat currentDateFormat = new SimpleDateFormat("dd");
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -3);
|
||||
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
|
||||
todaysDate.add(Calendar.YEAR, 10);
|
||||
final String VALID_TO = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
/***
|
||||
* Create FD product with CashBased accounting enabled
|
||||
*/
|
||||
final String accountingRule = CASH_BASED;
|
||||
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
|
||||
Integer fixedDepositProductId = createFixedDepositProductWithWithHoldTax(VALID_FROM, VALID_TO, String.valueOf(taxGroupId),
|
||||
accountingRule, assetAccount, liabilityAccount, incomeAccount, expenseAccount);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
/***
|
||||
* Apply for FD account with created product and verify status
|
||||
*/
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
|
||||
SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Approve the FD account and verify whether account is approved
|
||||
*/
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Activate the FD Account and verify whether account is activated
|
||||
*/
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
|
||||
|
||||
Float depositAmount = (Float) accountSummary.get("totalDeposits");
|
||||
|
||||
/***
|
||||
* Verify journal entries posted for initial deposit transaction which
|
||||
* happened at activation time
|
||||
*/
|
||||
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, ACTIVATION_DATE, assetAccountInitialEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, ACTIVATION_DATE, liablilityAccountInitialEntry);
|
||||
|
||||
/***
|
||||
* Update interest earned of FD account
|
||||
*/
|
||||
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
/***
|
||||
* Post interest and verify the account summary
|
||||
*/
|
||||
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
|
||||
Assert.assertNotNull(transactionIdForPostInterest);
|
||||
|
||||
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
|
||||
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
|
||||
Assert.assertNull(accountSummary.get("totalWithholdTax"));
|
||||
|
||||
/***
|
||||
* Verify journal entries transactions for interest posting transaction
|
||||
*/
|
||||
final JournalEntry[] expenseAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liablilityAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(expenseAccount, INTEREST_POSTED_DATE, expenseAccountEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, INTEREST_POSTED_DATE, liablilityAccountEntry);
|
||||
|
||||
/***
|
||||
* Preclose the FD account verify whether account is preClosed
|
||||
*/
|
||||
HashMap fixedDepositPrematureData = this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
|
||||
CLOSED_ON_DATE);
|
||||
|
||||
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
|
||||
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
Assert.assertNotNull(prematureClosureTransactionId);
|
||||
|
||||
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsPrematureClosed(fixedDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Verify journal entry transactions for preclosure transaction
|
||||
*/
|
||||
HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float maturityAmount = Float.valueOf(accountDetails.get("maturityAmount").toString());
|
||||
|
||||
HashMap summary = (HashMap) accountDetails.get("summary");
|
||||
Assert.assertNotNull(summary.get("totalWithholdTax"));
|
||||
Float withHoldTax = (Float) summary.get("totalWithholdTax");
|
||||
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
|
||||
JournalEntry.TransactionType.CREDIT));
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
|
||||
JournalEntry.TransactionType.DEBIT));
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
|
||||
JournalEntry.TransactionType.CREDIT));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountClosureTypeWithdrawal_WITH_HOLD_TAX() throws InterruptedException {
|
||||
this.fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
/***
|
||||
* Create GL Accounts for product account mapping
|
||||
*/
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
final Account liabilityAccountForTax = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
DateFormat monthDayFormat = new SimpleDateFormat("dd MMM", Locale.US);
|
||||
DateFormat currentDateFormat = new SimpleDateFormat("dd");
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -20);
|
||||
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
|
||||
todaysDate.add(Calendar.YEAR, 10);
|
||||
final String VALID_TO = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -20);
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
Calendar closedOn = Calendar.getInstance();
|
||||
closedOn.add(Calendar.MONTH, -6);
|
||||
final String CLOSED_ON_DATE = dateFormat.format(closedOn.getTime());
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
/***
|
||||
* Create FD product with CashBased accounting enabled
|
||||
*/
|
||||
final String accountingRule = CASH_BASED;
|
||||
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
|
||||
Integer fixedDepositProductId = createFixedDepositProductWithWithHoldTax(VALID_FROM, VALID_TO, String.valueOf(taxGroupId),
|
||||
accountingRule, assetAccount, liabilityAccount, incomeAccount, expenseAccount);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
/***
|
||||
* Apply for FD account with created product and verify status
|
||||
*/
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
|
||||
SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Approve the FD account and verify whether account is approved
|
||||
*/
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Activate the FD Account and verify whether account is activated
|
||||
*/
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
|
||||
|
||||
Float depositAmount = (Float) accountSummary.get("totalDeposits");
|
||||
|
||||
/***
|
||||
* Verify journal entries posted for initial deposit transaction which
|
||||
* happened at activation time
|
||||
*/
|
||||
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, ACTIVATION_DATE, assetAccountInitialEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, ACTIVATION_DATE, liablilityAccountInitialEntry);
|
||||
|
||||
/***
|
||||
* Update interest earned of FD account
|
||||
*/
|
||||
fixedDepositAccountId = this.fixedDepositAccountHelper.calculateInterestForFixedDeposit(fixedDepositAccountId);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
/***
|
||||
* Post interest and verify the account summary
|
||||
*/
|
||||
Integer transactionIdForPostInterest = this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
|
||||
Assert.assertNotNull(transactionIdForPostInterest);
|
||||
|
||||
accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
|
||||
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
|
||||
Assert.assertNull(accountSummary.get("totalWithholdTax"));
|
||||
|
||||
/***
|
||||
* FD account verify whether account is matured
|
||||
*/
|
||||
|
||||
SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec, responseSpec);
|
||||
String JobName = "Update Deposit Accounts Maturity details";
|
||||
schedulerJobHelper.executeJob(JobName);
|
||||
|
||||
HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
HashMap summary = (HashMap) accountDetails.get("summary");
|
||||
Assert.assertNotNull(summary.get("totalWithholdTax"));
|
||||
Float withHoldTax = (Float) summary.get("totalWithholdTax");
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
|
||||
JournalEntry.TransactionType.CREDIT));
|
||||
|
||||
|
||||
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsMatured(fixedDepositAccountStatusHashMap);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithPeriodInterestRateChart() {
|
||||
final String chartToUse = "period";
|
||||
final String depositAmount = "10000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(6.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithPeriodInterestRateChart_AMOUNT_VARIATION() {
|
||||
final String chartToUse = "period";
|
||||
final String depositAmount = "2000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(6.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithPeriodInterestRateChart_PERIOD_VARIATION() {
|
||||
final String chartToUse = "period";
|
||||
final String depositAmount = "10000";
|
||||
final String depositPeriod = "18";
|
||||
final Float interestRate = new Float(7.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithAmountInterestRateChart() {
|
||||
final String chartToUse = "amount";
|
||||
final String depositAmount = "10000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(7.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithAmountInterestRateChart_AMOUNT_VARIATION() {
|
||||
final String chartToUse = "amount";
|
||||
final String depositAmount = "5000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(5.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithAmountInterestRateChart_PERIOD_VARIATION() {
|
||||
final String chartToUse = "amount";
|
||||
final String depositAmount = "10000";
|
||||
final String depositPeriod = "26";
|
||||
final Float interestRate = new Float(7.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithPeriodAndAmountInterestRateChart() {
|
||||
final String chartToUse = "period_amount";
|
||||
final String depositAmount = "10000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(7.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithPeriodAndAmountInterestRateChart_AMOUNT_VARIATION() {
|
||||
final String chartToUse = "period_amount";
|
||||
final String depositAmount = "5000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(6.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithPeriodAndAmountInterestRateChart_PERIOD_VARIATION() {
|
||||
final String chartToUse = "period_amount";
|
||||
final String depositAmount = "10000";
|
||||
final String depositPeriod = "20";
|
||||
final Float interestRate = new Float(9.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithAmountAndPeriodInterestRateChart() {
|
||||
final String chartToUse = "amount_period";
|
||||
final String depositAmount = "10000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(8.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithAmountAndPeriodInterestRateChart_AMOUNT_VARIATION() {
|
||||
final String chartToUse = "amount_period";
|
||||
final String depositAmount = "5000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(6.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountWithAmountAndPeriodInterestRateChart_PERIOD_VARIATION() {
|
||||
final String chartToUse = "amount_period";
|
||||
final String depositAmount = "10000";
|
||||
final String depositPeriod = "6";
|
||||
final Float interestRate = new Float(7.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
private void testFixedDepositAccountForInterestRate(final String chartToUse, final String depositAmount, final String depositPeriod,
|
||||
final Float interestRate) {
|
||||
this.fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final String VALID_FROM = "01 March 2014";
|
||||
final String VALID_TO = "01 March 2016";
|
||||
|
||||
final String SUBMITTED_ON_DATE = "01 March 2015";
|
||||
final String APPROVED_ON_DATE = "01 March 2015";
|
||||
final String ACTIVATION_DATE = "01 March 2015";
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
/***
|
||||
* Create FD product with CashBased accounting enabled
|
||||
*/
|
||||
final String accountingRule = NONE;
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule, chartToUse);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
/***
|
||||
* Apply for FD account with created product and verify status
|
||||
*/
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM, depositAmount, depositPeriod);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Approve the FD account and verify whether account is approved
|
||||
*/
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Activate the FD Account and verify whether account is activated
|
||||
*/
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositDetails(fixedDepositAccountId);
|
||||
|
||||
Assert.assertEquals(interestRate, accountSummary.get("nominalAnnualInterestRate"));
|
||||
}
|
||||
|
||||
/***
|
||||
* Test case for FD Account premature closure with transaction transfers to
|
||||
@@ -250,7 +705,7 @@ public class FixedDepositTest {
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
|
||||
/***
|
||||
* Create GL Accounts for product account mapping
|
||||
*/
|
||||
@@ -282,7 +737,7 @@ public class FixedDepositTest {
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
|
||||
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
@@ -313,8 +768,8 @@ public class FixedDepositTest {
|
||||
incomeAccount, expenseAccount);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
@@ -330,7 +785,7 @@ public class FixedDepositTest {
|
||||
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
|
||||
|
||||
Float depositAmount = (Float) accountSummary.get("totalDeposits");
|
||||
|
||||
|
||||
/***
|
||||
* Verify journal entries posted for initial deposit transaction which
|
||||
* happened at activation time
|
||||
@@ -362,10 +817,10 @@ public class FixedDepositTest {
|
||||
final JournalEntry[] liablilityAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(expenseAccount, INTEREST_POSTED_DATE, expenseAccountEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, INTEREST_POSTED_DATE, liablilityAccountEntry);
|
||||
|
||||
|
||||
HashMap savingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
Float balanceBefore = (Float) savingsSummaryBefore.get("accountBalance");
|
||||
|
||||
|
||||
/***
|
||||
* Retrieve mapped financial account for liability transfer
|
||||
*/
|
||||
@@ -399,7 +854,7 @@ public class FixedDepositTest {
|
||||
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(financialAccount, CLOSED_ON_DATE, new JournalEntry(prematurityAmount,
|
||||
JournalEntry.TransactionType.DEBIT), new JournalEntry(prematurityAmount, JournalEntry.TransactionType.CREDIT));
|
||||
|
||||
|
||||
HashMap savingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
Float balanceAfter = (Float) savingsSummaryAfter.get("accountBalance");
|
||||
Float expectedSavingsBalance = balanceBefore + prematurityAmount;
|
||||
@@ -409,8 +864,8 @@ public class FixedDepositTest {
|
||||
}
|
||||
|
||||
/***
|
||||
* Test case for Fixed Deposit Account premature closure with
|
||||
* transaction type ReInvest and Cash Based accounting enabled
|
||||
* Test case for Fixed Deposit Account premature closure with transaction
|
||||
* type ReInvest and Cash Based accounting enabled
|
||||
*/
|
||||
@Test
|
||||
public void testFixedDepositAccountWithPrematureClosureTypeReinvest() {
|
||||
@@ -446,7 +901,7 @@ public class FixedDepositTest {
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
@@ -465,8 +920,8 @@ public class FixedDepositTest {
|
||||
incomeAccount, expenseAccount);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
@@ -478,11 +933,11 @@ public class FixedDepositTest {
|
||||
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
|
||||
HashMap accountSummary = this.fixedDepositAccountHelper.getFixedDepositSummary(fixedDepositAccountId);
|
||||
|
||||
Float depositAmount = (Float) accountSummary.get("totalDeposits");
|
||||
|
||||
|
||||
/***
|
||||
* Verify journal entries posted for initial deposit transaction which
|
||||
* happened at activation time
|
||||
@@ -551,8 +1006,8 @@ public class FixedDepositTest {
|
||||
HashMap fixedDepositProductData = this.fixedDepositProductHelper.retrieveFixedDepositProductById(this.requestSpec,
|
||||
this.responseSpec, fixedDepositProductId.toString());
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
todaysDate.add(Calendar.DATE, -1);
|
||||
@@ -590,8 +1045,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
@@ -633,8 +1088,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
@@ -674,8 +1129,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
@@ -713,8 +1168,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
@@ -756,8 +1211,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
@@ -826,8 +1281,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -903,8 +1358,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
@@ -1007,8 +1462,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -1115,8 +1570,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, TILL_PREMATURE_WITHDRAWAL);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
TILL_PREMATURE_WITHDRAWAL);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
@@ -1227,8 +1682,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, TILL_PREMATURE_WITHDRAWAL);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
TILL_PREMATURE_WITHDRAWAL);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -1339,8 +1794,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -1408,7 +1863,7 @@ public class FixedDepositTest {
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
System.out.println("Submitted Date:"+SUBMITTED_ON_DATE);
|
||||
System.out.println("Submitted Date:" + SUBMITTED_ON_DATE);
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
@@ -1416,8 +1871,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -1496,8 +1951,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -1580,8 +2035,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -1665,8 +2120,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -1747,8 +2202,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -1829,8 +2284,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -1910,8 +2365,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assert.assertNotNull(fixedDepositProductId);
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
|
||||
WHOLE_TERM);
|
||||
Assert.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap modificationsHashMap = this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
|
||||
@@ -1962,16 +2417,74 @@ public class FixedDepositTest {
|
||||
} else if (accountingRule.equals(NONE)) {
|
||||
fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsNone();
|
||||
}
|
||||
final String fixedDepositProductJSON = fixedDepositProductHelper.withPeriodRangeChart() //
|
||||
.build(validFrom, validTo);
|
||||
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
|
||||
private Integer createFixedDepositProductWithWithHoldTax(final String validFrom, final String validTo, final String taxGroupId,
|
||||
final String accountingRule, Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
if (accountingRule.equals(CASH_BASED)) {
|
||||
fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsCashBased(accounts);
|
||||
} else if (accountingRule.equals(NONE)) {
|
||||
fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsNone();
|
||||
}
|
||||
final String fixedDepositProductJSON = fixedDepositProductHelper.withPeriodRangeChart() //
|
||||
.withWithHoldTax(taxGroupId)//
|
||||
.build(validFrom, validTo);
|
||||
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer createFixedDepositProduct(final String validFrom, final String validTo, final String accountingRule,
|
||||
final String chartToBePicked, Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
if (accountingRule.equals(CASH_BASED)) {
|
||||
fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsCashBased(accounts);
|
||||
} else if (accountingRule.equals(NONE)) {
|
||||
fixedDepositProductHelper = fixedDepositProductHelper.withAccountingRuleAsNone();
|
||||
}
|
||||
switch (chartToBePicked) {
|
||||
case "period":
|
||||
fixedDepositProductHelper = fixedDepositProductHelper.withPeriodRangeChart();
|
||||
break;
|
||||
case "amount":
|
||||
fixedDepositProductHelper = fixedDepositProductHelper.withAmountRangeChart();
|
||||
break;
|
||||
case "period_amount":
|
||||
fixedDepositProductHelper = fixedDepositProductHelper.withPeriodAndAmountRangeChart();
|
||||
break;
|
||||
case "amount_period":
|
||||
fixedDepositProductHelper = fixedDepositProductHelper.withAmountAndPeriodRangeChart();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
final String fixedDepositProductJSON = fixedDepositProductHelper //
|
||||
.build(validFrom, validTo);
|
||||
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String validFrom,
|
||||
final String validTo, final String submittedOnDate, final String penalInterestType) {
|
||||
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String submittedOnDate,
|
||||
final String penalInterestType) {
|
||||
System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
|
||||
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, penalInterestType);
|
||||
return this.fixedDepositAccountHelper
|
||||
.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String submittedOnDate,
|
||||
final String penalInterestType, final String depositAmount, final String depositPeriod) {
|
||||
System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
//
|
||||
.withSubmittedOnDate(submittedOnDate).withDepositPeriod(depositPeriod).withDepositAmount(depositAmount)
|
||||
.build(clientID, productID, penalInterestType);
|
||||
return this.fixedDepositAccountHelper
|
||||
.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
|
||||
}
|
||||
@@ -2048,6 +2561,12 @@ public class FixedDepositTest {
|
||||
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
|
||||
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
|
||||
}
|
||||
|
||||
private Integer createTaxGroup(final String percentage, final Account liabilityAccountForTax){
|
||||
final Integer liabilityAccountId = liabilityAccountForTax.getAccountID();
|
||||
final Integer taxComponentId = TaxComponentHelper.createTaxComponent(this.requestSpec, this.responseSpec, percentage, liabilityAccountId);
|
||||
return TaxGroupHelper.createTaxGroup(this.requestSpec, this.responseSpec, Arrays.asList(taxComponentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the Liability transfer account
|
||||
+24
-11
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -11,17 +24,17 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.GlobalConfigurationHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+21
-7
@@ -1,20 +1,34 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.funds.FundsHelper;
|
||||
import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.funds.FundsHelper;
|
||||
import org.mifosplatform.integrationtests.common.funds.FundsResourceHandler;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
|
||||
public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
|
||||
@SuppressWarnings( {"static-access", "rawtypes", "unchecked"})
|
||||
@Test
|
||||
public void testInterestChargedFromDateSameAsDisbursalDate(){
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
// Retrieving All Global Configuration details
|
||||
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper
|
||||
.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(globalConfig);
|
||||
|
||||
String configName = "interest-charged-from-date-same-as-disbursal-date";
|
||||
boolean newBooleanValue = true;
|
||||
|
||||
for (Integer configIndex = 0; configIndex < (globalConfig.size()); configIndex++) {
|
||||
if (globalConfig.get(configIndex).get("name")
|
||||
.equals(configName)) {
|
||||
String configId = (globalConfig.get(configIndex).get("id"))
|
||||
.toString();
|
||||
Integer updateConfigId = this.globalConfigurationHelper
|
||||
.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
configId.toString(), newBooleanValue);;
|
||||
Assert.assertNotNull(updateConfigId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+20
-7
@@ -1,19 +1,32 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.GlobalConfigurationHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+23
-10
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -11,14 +24,14 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.GroupHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.GroupHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+33
-16
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -16,18 +29,18 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.GroupHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.GroupHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -426,7 +439,7 @@ public class GroupSavingsIntegrationTest {
|
||||
ChargesHelper.getSavingsWithdrawalFeeJSON());
|
||||
Assert.assertNotNull(withdrawalChargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId);
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, withdrawalChargeId, false);
|
||||
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
|
||||
@@ -452,7 +465,7 @@ public class GroupSavingsIntegrationTest {
|
||||
ArrayList<HashMap> charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertTrue(charges == null || charges.size() == 0);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, chargeId);
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, chargeId, true);
|
||||
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(1, charges.size());
|
||||
|
||||
@@ -473,7 +486,7 @@ public class GroupSavingsIntegrationTest {
|
||||
ChargesHelper.getSavingsMonthlyFeeJSON());
|
||||
Assert.assertNotNull(monthlyFeechargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId);
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, monthlyFeechargeId, true);
|
||||
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(2, charges.size());
|
||||
|
||||
@@ -491,7 +504,7 @@ public class GroupSavingsIntegrationTest {
|
||||
final Integer weeklyFeeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, ChargesHelper.getSavingsWeeklyFeeJSON());
|
||||
Assert.assertNotNull(weeklyFeeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, weeklyFeeId);
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, weeklyFeeId, true);
|
||||
charges = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(3, charges.size());
|
||||
|
||||
@@ -516,6 +529,10 @@ public class GroupSavingsIntegrationTest {
|
||||
LocalDate expectedNextDueDate = new LocalDate((Integer) dates.get(0), (Integer) dates.get(1), (Integer) dates.get(2))
|
||||
.plusWeeks((Integer) paidCharge.get("feeInterval"));
|
||||
assertEquals(expectedNextDueDate, nextDueDate);
|
||||
cal = Calendar.getInstance();
|
||||
|
||||
this.savingsAccountHelper.closeSavingsAccountAndGetBackRequiredField(savingsId, "true", null, sdf.format(cal.getTime()));
|
||||
|
||||
}
|
||||
|
||||
public static Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
+24
-11
@@ -1,25 +1,38 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.GroupHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.GroupHelper;
|
||||
import org.mifosplatform.integrationtests.common.organisation.StaffHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+20
-7
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
@@ -11,12 +24,12 @@ import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.HookHelper;
|
||||
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.http.conn.HttpHostConnectException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.HookHelper;
|
||||
import org.mifosplatform.integrationtests.common.OfficeHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.jayway.restassured.RestAssured;
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
+28
-14
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -11,15 +24,15 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -101,7 +114,7 @@ public class LoanApplicationApprovalTest {
|
||||
|
||||
}
|
||||
|
||||
private HashMap createTrancheDetail(final String date, final String amount) {
|
||||
public HashMap createTrancheDetail(final String date, final String amount) {
|
||||
HashMap<String, Object> detail = new HashMap<>();
|
||||
detail.put("expectedDisbursementDate", date);
|
||||
detail.put("principal", amount);
|
||||
@@ -121,7 +134,8 @@ public class LoanApplicationApprovalTest {
|
||||
+ clientID);
|
||||
|
||||
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
|
||||
.withInterestTypeAsDecliningBalance().withTranches(true).build(null));
|
||||
.withInterestTypeAsDecliningBalance().withTranches(true).withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
|
||||
.build(null));
|
||||
System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------"
|
||||
+ loanProductID);
|
||||
|
||||
@@ -242,7 +256,7 @@ public class LoanApplicationApprovalTest {
|
||||
return this.loanTransactionHelper.getLoanId(loanApplication);
|
||||
}
|
||||
|
||||
private Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal,
|
||||
public Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal,
|
||||
List<HashMap> tranches) {
|
||||
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
|
||||
final String loanApplicationJSON = new LoanApplicationTestBuilder()
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.integrationtests.LoanApplicationApprovalTest;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class LoanApplicationUndoLastTrancheTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
private LoanApplicationApprovalTest loanApplicationApprovalTest;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanApplicationApprovalTest = new LoanApplicationApprovalTest();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void LoanApplicationUndoLastTranche() {
|
||||
|
||||
final String proposedAmount = "5000";
|
||||
final String approvalAmount = "2000";
|
||||
final String approveDate = "1 March 2014";
|
||||
final String expectedDisbursementDate = "1 March 2014";
|
||||
final String disbursalDate = "1 March 2014";
|
||||
|
||||
// CREATE CLIENT
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
|
||||
System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------"
|
||||
+ clientID);
|
||||
|
||||
// CREATE LOAN MULTIDISBURSAL PRODUCT
|
||||
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
|
||||
.withInterestTypeAsDecliningBalance().withTranches(true).withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
|
||||
.build(null));
|
||||
System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------"
|
||||
+ loanProductID);
|
||||
|
||||
// CREATE TRANCHES
|
||||
List<HashMap> createTranches = new ArrayList<>();
|
||||
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("1 March 2014", "1000"));
|
||||
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("23 June 2014", "4000"));
|
||||
|
||||
// APPROVE TRANCHES
|
||||
List<HashMap> approveTranches = new ArrayList<>();
|
||||
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("1 March 2014", "1000"));
|
||||
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("23 June 2014", "1000"));
|
||||
|
||||
// APPLY FOR LOAN WITH TRANCHES
|
||||
final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, proposedAmount, createTranches);
|
||||
System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------"
|
||||
+ loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
// VALIDATE THE LOAN STATUS
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount,
|
||||
loanID, approveTranches);
|
||||
|
||||
// VALIDATE THE LOAN IS APPROVED
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
|
||||
|
||||
// DISBURSE A LOAN
|
||||
this.loanTransactionHelper.disburseLoan(disbursalDate, loanID);
|
||||
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
// VALIDATE THE LOAN IS ACTIVE STATUS
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
System.out.println("-------------Make repayment 1-----------");
|
||||
this.loanTransactionHelper.makeRepayment("01 April 2014", Float.valueOf("420"), loanID);
|
||||
System.out.println("-------------Make repayment 2-----------");
|
||||
this.loanTransactionHelper.makeRepayment("01 May 2014", Float.valueOf("412"), loanID);
|
||||
System.out.println("-------------Make repayment 3-----------");
|
||||
this.loanTransactionHelper.makeRepayment("01 June 2014", Float.valueOf("204"), loanID);
|
||||
// DISBURSE A SECOND TRANCHE
|
||||
this.loanTransactionHelper.disburseLoan("23 June 2014", loanID);
|
||||
// UNDO LAST TRANCHE
|
||||
Float disbursedAmount = this.loanTransactionHelper.undoLastDisbursal(loanID);
|
||||
validateDisbursedAmount(disbursedAmount);
|
||||
}
|
||||
|
||||
private void validateDisbursedAmount(Float disbursedAmount) {
|
||||
Assert.assertEquals(Float.valueOf("1000.0"), disbursedAmount);
|
||||
|
||||
}
|
||||
|
||||
public Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal,
|
||||
List<HashMap> tranches) {
|
||||
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
|
||||
final String loanApplicationJSON = new LoanApplicationTestBuilder()
|
||||
//
|
||||
.withPrincipal(principal)
|
||||
//
|
||||
.withLoanTermFrequency("5")
|
||||
//
|
||||
.withLoanTermFrequencyAsMonths()
|
||||
//
|
||||
.withNumberOfRepayments("5").withRepaymentEveryAfter("1").withRepaymentFrequencyTypeAsMonths() //
|
||||
.withInterestRatePerPeriod("2") //
|
||||
.withExpectedDisbursementDate("1 March 2014") //
|
||||
.withTranches(tranches) //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withSubmittedOnDate("1 March 2014") //
|
||||
.build(clientID.toString(), loanProductID.toString(), null);
|
||||
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
}
|
||||
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class LoanDisbursalDateValidationTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
private ResponseSpecification responseForbiddenError;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.responseForbiddenError = new ResponseSpecBuilder().expectStatusCode(403).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void LoanApplicationValidateDisbursalDate() {
|
||||
|
||||
final String proposedAmount = "5000";
|
||||
final String approveDate = "1 March 2014";
|
||||
final String disbursalDate = "02 March 2014";
|
||||
|
||||
// CREATE CLIENT
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
|
||||
System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------"
|
||||
+ clientID);
|
||||
|
||||
// CREATE LOAN PRODUCT
|
||||
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
|
||||
.withSyncExpectedWithDisbursementDate(true).build(null));
|
||||
System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------"
|
||||
+ loanProductID);
|
||||
|
||||
// APPLY FOR LOAN
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID, proposedAmount);
|
||||
System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------"
|
||||
+ loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
// VALIDATE THE LOAN STATUS
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(approveDate, loanID);
|
||||
|
||||
// VALIDATE THE LOAN IS APPROVED
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
|
||||
|
||||
// DISBURSE A LOAN
|
||||
@SuppressWarnings("unchecked")
|
||||
List<HashMap> disbursalError = (List<HashMap>) this.loanTransactionHelper.disburseLoan(disbursalDate, loanID, this.responseForbiddenError);
|
||||
|
||||
Assert.assertEquals("error.msg.actual.disbursement.date.does.not.match.with.expected.disbursal.date",
|
||||
disbursalError.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
}
|
||||
|
||||
private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID, final String proposedAmount) {
|
||||
final String loanApplication = new LoanApplicationTestBuilder()
|
||||
.withPrincipal(proposedAmount).withLoanTermFrequency("5")
|
||||
.withLoanTermFrequencyAsMonths().withNumberOfRepayments("5")
|
||||
.withRepaymentEveryAfter("1")
|
||||
.withRepaymentFrequencyTypeAsMonths()
|
||||
.withInterestRatePerPeriod("2")
|
||||
.withExpectedDisbursementDate("1 March 2014")
|
||||
.withSubmittedOnDate("26 February 2014").
|
||||
build(clientID.toString(), loanProductID.toString(), null);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplication);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+501
@@ -0,0 +1,501 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanDisbursementTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public class LoanDisbursementDetailsIntegrationTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
private Integer loanID;
|
||||
private Integer disbursementId;
|
||||
final String approveDate = "01 March 2014";
|
||||
final String expectedDisbursementDate = "01 March 2014";
|
||||
final String proposedAmount = "5000";
|
||||
final String approvalAmount = "5000";
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createAndValidateMultiDisburseLoansBasedOnEmi() {
|
||||
List<HashMap> createTranches = new ArrayList<>();
|
||||
String id = null;
|
||||
String installmentAmount = "800";
|
||||
String withoutInstallmentAmount = "";
|
||||
String proposedAmount = "10000";
|
||||
createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 June 2015", "5000"));
|
||||
createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 Sep 2015", "5000"));
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
|
||||
System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------"
|
||||
+ clientID);
|
||||
|
||||
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
|
||||
.withInterestTypeAsDecliningBalance().withMoratorium("", "").withAmortizationTypeAsEqualInstallments().withTranches(true)
|
||||
.withInterestCalculationPeriodTypeAsRepaymentPeriod(true).build(null));
|
||||
System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------"
|
||||
+ loanProductID);
|
||||
|
||||
final Integer loanIDWithEmi = applyForLoanApplicationWithEmiAmount(clientID, loanProductID, proposedAmount, createTranches,
|
||||
installmentAmount);
|
||||
|
||||
System.out
|
||||
.println("-----------------------------------LOAN CREATED WITH EMI LOANID-------------------------------------------------"
|
||||
+ loanIDWithEmi);
|
||||
|
||||
HashMap repaymentScheduleWithEmi = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec,
|
||||
loanIDWithEmi, "repaymentSchedule");
|
||||
|
||||
ArrayList<HashMap> periods = (ArrayList<HashMap>) repaymentScheduleWithEmi.get("periods");
|
||||
assertEquals(periods.size(), 15);
|
||||
|
||||
this.validateRepaymentScheduleWithEMI(periods);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanIDWithEmi);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount("01 June 2015", "01 June 2015", "10000", loanIDWithEmi,
|
||||
createTranches);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
|
||||
System.out
|
||||
.println("-----------------------------------MULTI DISBURSAL LOAN WITH EMI APPROVED SUCCESSFULLY---------------------------------------");
|
||||
|
||||
final Integer loanIDWithoutEmi = applyForLoanApplicationWithEmiAmount(clientID, loanProductID, proposedAmount, createTranches,
|
||||
withoutInstallmentAmount);
|
||||
|
||||
HashMap repaymentScheduleWithoutEmi = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec,
|
||||
loanIDWithoutEmi, "repaymentSchedule");
|
||||
|
||||
ArrayList<HashMap> periods1 = (ArrayList<HashMap>) repaymentScheduleWithEmi.get("periods");
|
||||
assertEquals(periods1.size(), 15);
|
||||
|
||||
System.out
|
||||
.println("-----------------------------------LOAN CREATED WITHOUT EMI LOANID-------------------------------------------------"
|
||||
+ loanIDWithoutEmi);
|
||||
|
||||
/* To be uncommented once issue MIFOSX-2006 is closed. */
|
||||
// this.validateRepaymentScheduleWithoutEMI(periods1);
|
||||
|
||||
HashMap loanStatusMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanIDWithoutEmi);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusMap);
|
||||
|
||||
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount("01 June 2015", "01 June 2015", "10000",
|
||||
loanIDWithoutEmi, createTranches);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
|
||||
System.out
|
||||
.println("-----------------------------------MULTI DISBURSAL LOAN WITHOUT EMI APPROVED SUCCESSFULLY---------------------------------------");
|
||||
|
||||
}
|
||||
|
||||
private void validateRepaymentScheduleWithEMI(ArrayList<HashMap> periods) {
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule0 = new LoanDisbursementTestBuilder("[2015, 6, 1]", 0.0f, 0.0f, null, null,
|
||||
5000.0f, null, null, null);
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule1 = new LoanDisbursementTestBuilder("[2015, 7, 1]", 800f, 800.0f, 50.0f,
|
||||
750.0f, 4250.0f, 750.0f, 750.0f, "[2015, 6, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule2 = new LoanDisbursementTestBuilder("[2015, 8, 1]", 800.0f, 800.0f, 42.5f,
|
||||
757.5f, 3492.5f, 757.5f, 757.5f, "[2015, 7, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule3 = new LoanDisbursementTestBuilder("[2015, 9, 1]", 0.0f, 0.0f, null, null,
|
||||
5000.0f, null, null, null);
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule4 = new LoanDisbursementTestBuilder("[2015, 9, 1]", 800.0f, 800.0f, 34.92f,
|
||||
765.08f, 7727.42f, 765.08f, 765.08f, "[2015, 8, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule5 = new LoanDisbursementTestBuilder("[2015, 10, 1]", 800.0f, 800.0f, 77.27f,
|
||||
722.73f, 7004.69f, 722.73f, 722.73f, "[2015, 9, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule6 = new LoanDisbursementTestBuilder("[2015, 11, 1]", 800.0f, 800.0f, 70.05f,
|
||||
729.95f, 6274.74f, 729.95f, 729.95f, "[2015, 10, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule7 = new LoanDisbursementTestBuilder("[2015, 12, 1]", 800.0f, 800.0f, 62.75f,
|
||||
737.25f, 5537.49f, 737.25f, 737.25f, "[2015, 11, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule8 = new LoanDisbursementTestBuilder("[2016, 1, 1]", 800.0f, 800.0f, 55.37f,
|
||||
744.63f, 4792.86f, 744.63f, 744.63f, "[2015, 12, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule9 = new LoanDisbursementTestBuilder("[2016, 2, 1]", 800.0f, 800.0f, 47.93f,
|
||||
752.07f, 4040.79f, 752.07f, 752.07f, "[2016, 1, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule10 = new LoanDisbursementTestBuilder("[2016, 3, 1]", 800.0f, 800.0f, 40.41f,
|
||||
759.59f, 3281.2f, 759.59f, 759.59f, "[2016, 2, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule11 = new LoanDisbursementTestBuilder("[2016, 4, 1]", 800.0f, 800.0f, 32.81f,
|
||||
767.19f, 2514.01f, 767.19f, 767.19f, "[2016, 3, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule12 = new LoanDisbursementTestBuilder("[2016, 5, 1]", 800.0f, 800.0f, 25.14f,
|
||||
774.86f, 1739.15f, 774.86f, 774.86f, "[2016, 4, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule13 = new LoanDisbursementTestBuilder("[2016, 6, 1]", 800.0f, 800.0f, 17.39f,
|
||||
782.61f, 956.54f, 782.61f, 782.61f, "[2016, 5, 1]");
|
||||
|
||||
LoanDisbursementTestBuilder expectedRepaymentSchedule14 = new LoanDisbursementTestBuilder("[2016, 7, 1]", 966.11f, 966.11f, 9.57f,
|
||||
956.54f, 0.0f, 956.54f, 956.54f, "[2016, 6, 1]");
|
||||
|
||||
ArrayList<LoanDisbursementTestBuilder> list = new ArrayList<LoanDisbursementTestBuilder>();
|
||||
list.add(expectedRepaymentSchedule0);
|
||||
list.add(expectedRepaymentSchedule1);
|
||||
list.add(expectedRepaymentSchedule2);
|
||||
list.add(expectedRepaymentSchedule3);
|
||||
list.add(expectedRepaymentSchedule4);
|
||||
list.add(expectedRepaymentSchedule5);
|
||||
list.add(expectedRepaymentSchedule6);
|
||||
list.add(expectedRepaymentSchedule7);
|
||||
list.add(expectedRepaymentSchedule8);
|
||||
list.add(expectedRepaymentSchedule9);
|
||||
list.add(expectedRepaymentSchedule10);
|
||||
list.add(expectedRepaymentSchedule11);
|
||||
list.add(expectedRepaymentSchedule12);
|
||||
list.add(expectedRepaymentSchedule13);
|
||||
list.add(expectedRepaymentSchedule14);
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
this.assertRepaymentScheduleValuesWithEMI(periods.get(i), list.get(i), i);
|
||||
}
|
||||
}
|
||||
|
||||
private void assertRepaymentScheduleValuesWithEMI(HashMap period, LoanDisbursementTestBuilder expectedRepaymentSchedule, int position) {
|
||||
|
||||
assertEquals(period.get("dueDate").toString(), expectedRepaymentSchedule.getDueDate());
|
||||
assertEquals(period.get("principalLoanBalanceOutstanding"), expectedRepaymentSchedule.getPrincipalLoanBalanceOutstanding());
|
||||
System.out.println(period.get("totalOriginalDueForPeriod").toString());
|
||||
assertEquals(new Float(period.get("totalOriginalDueForPeriod").toString()), expectedRepaymentSchedule
|
||||
.getTotalOriginalDueForPeriod().floatValue(), 0.0f);
|
||||
|
||||
assertEquals(new Float(period.get("totalOutstandingForPeriod").toString()).floatValue(),
|
||||
expectedRepaymentSchedule.getTotalOutstandingForPeriod(), 0.0f);
|
||||
|
||||
if (position != 0 && position != 3) {
|
||||
|
||||
assertEquals(new Float(period.get("interestOutstanding").toString()).floatValue(),
|
||||
expectedRepaymentSchedule.getInterestOutstanding(), 0.0f);
|
||||
assertEquals(new Float(period.get("principalOutstanding").toString()).floatValue(),
|
||||
expectedRepaymentSchedule.getPrincipalOutstanding(), 0.0f);
|
||||
assertEquals(new Float(period.get("principalDue").toString()).floatValue(), expectedRepaymentSchedule.getPrincipalDue(), 0.0f);
|
||||
assertEquals(new Float(period.get("principalOriginalDue").toString()).floatValue(),
|
||||
expectedRepaymentSchedule.getPrincipalOriginalDue(), 0.0f);
|
||||
assertEquals(period.get("fromDate").toString(), expectedRepaymentSchedule.getFromDate());
|
||||
}
|
||||
}
|
||||
|
||||
/* Uncomment and modify test builder values once MIFOSX-2006 is closed. */
|
||||
/*
|
||||
* private void validateRepaymentScheduleWithoutEMI(ArrayList<HashMap>
|
||||
* periods){ LoanDisbursementTestBuilder expectedRepaymentSchedule0 = new
|
||||
* LoanDisbursementTestBuilder( "[2015, 6, 1]", 0.0f, 0.0f, null, null,
|
||||
* 5000.0f, null, null, null);
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule1 = new
|
||||
* LoanDisbursementTestBuilder( "[2015, 7, 1]", 800.0f, 800.0f, 50.0f,
|
||||
* 750.0f, 4250.0f, 750.0f, 750.0f, "[2015, 6, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule2 = new
|
||||
* LoanDisbursementTestBuilder( "[2015, 8, 1]", 800.0f, 800.0f, 42.5f,
|
||||
* 757.5f, 3492.5f, 757.5f, 757.5f, "[2015, 7, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule3 = new
|
||||
* LoanDisbursementTestBuilder( "[2015, 9, 1]", 0.0f, 0.0f, null, null,
|
||||
* 5000.0f, null, null, null);
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule4 = new
|
||||
* LoanDisbursementTestBuilder( "[2015, 9, 1]", 800.0f, 800.0f, 34.92f,
|
||||
* 765.08f, 7727.42f, 765.08f, 765.08f, "[2015, 8, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule5 = new
|
||||
* LoanDisbursementTestBuilder( "[2015, 10, 1]", 800.0f, 800.0f, 77.27f,
|
||||
* 722.73f, 7004.69f, 722.73f, 722.73f, "[2015, 9, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule6 = new
|
||||
* LoanDisbursementTestBuilder( "[2015, 11, 1]", 800.0f, 800.0f, 70.05f,
|
||||
* 729.95f, 6274.74f, 729.95f, 729.95f, "[2015, 10, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule7 = new
|
||||
* LoanDisbursementTestBuilder( "[2015, 12, 1]", 800.0f, 800.0f, 62.75f,
|
||||
* 737.25f, 5537.49f, 737.25f, 737.25f, "[2015, 11, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule8 = new
|
||||
* LoanDisbursementTestBuilder( "[2016, 1, 1]", 800.0f, 800.0f, 55.37f,
|
||||
* 744.63f, 4792.86f, 744.63f, 744.63f, "[2015, 12, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule9 = new
|
||||
* LoanDisbursementTestBuilder( "[2016, 2, 1]", 800.0f, 800.0f, 47.93f,
|
||||
* 752.07f, 4040.79f, 752.07f, 752.07f, "[2016, 1, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule10 = new
|
||||
* LoanDisbursementTestBuilder( "[2016, 3, 1]", 800.0f, 800.0f, 40.41f,
|
||||
* 759.59f, 3281.2f, 759.59f, 759.59f, "[2016, 2, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule11 = new
|
||||
* LoanDisbursementTestBuilder( "[2016, 4, 1]", 800.0f, 800.0f, 32.81f,
|
||||
* 767.19f, 2514.01f, 767.19f, 767.19f, "[2016, 3, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule12 = new
|
||||
* LoanDisbursementTestBuilder( "[2016, 5, 1]", 800.0f, 800.0f, 25.14f,
|
||||
* 774.86f, 1739.15f, 774.86f, 774.86f, "[2016, 4, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule13 = new
|
||||
* LoanDisbursementTestBuilder( "[2016, 6, 1]", 800.0f, 800.0f, 17.39f,
|
||||
* 782.61f, 956.54f, 782.61f, 782.61f, "[2016, 5, 1]");
|
||||
*
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule14 = new
|
||||
* LoanDisbursementTestBuilder( "[2016, 7, 1]", 966.11f, 966.11f, 9.57f,
|
||||
* 956.54f, 0.0f, 956.54f, 956.54f, "[2016, 6, 1]");
|
||||
*
|
||||
* ArrayList<LoanDisbursementTestBuilder> list = new
|
||||
* ArrayList<LoanDisbursementTestBuilder>();
|
||||
* list.add(expectedRepaymentSchedule0);
|
||||
* list.add(expectedRepaymentSchedule1);
|
||||
* list.add(expectedRepaymentSchedule2);
|
||||
* list.add(expectedRepaymentSchedule3);
|
||||
* list.add(expectedRepaymentSchedule4);
|
||||
* list.add(expectedRepaymentSchedule5);
|
||||
* list.add(expectedRepaymentSchedule6);
|
||||
* list.add(expectedRepaymentSchedule7);
|
||||
* list.add(expectedRepaymentSchedule8);
|
||||
* list.add(expectedRepaymentSchedule9);
|
||||
* list.add(expectedRepaymentSchedule10);
|
||||
* list.add(expectedRepaymentSchedule11);
|
||||
* list.add(expectedRepaymentSchedule12);
|
||||
* list.add(expectedRepaymentSchedule13);
|
||||
* list.add(expectedRepaymentSchedule14);
|
||||
*
|
||||
* for (int i = 0; i < list.size(); i++) {
|
||||
* this.assertRepaymentScheduleValuesWithoutEMI(periods.get(i), list.get(i),
|
||||
* i); } }
|
||||
*
|
||||
* private void assertRepaymentScheduleValuesWithoutEMI(HashMap period,
|
||||
* LoanDisbursementTestBuilder expectedRepaymentSchedule, int position) {
|
||||
*
|
||||
* assertEquals(period.get("dueDate").toString(),
|
||||
* expectedRepaymentSchedule.getDueDate());
|
||||
* assertEquals(period.get("principalLoanBalanceOutstanding"),
|
||||
* expectedRepaymentSchedule.getPrincipalLoanBalanceOutstanding());
|
||||
* assertEquals(period.get("totalOriginalDueForPeriod"),
|
||||
* expectedRepaymentSchedule.getTotalOriginalDueForPeriod());
|
||||
* assertEquals(period.get("totalOutstandingForPeriod"),
|
||||
* expectedRepaymentSchedule.getTotalOutstandingForPeriod());
|
||||
*
|
||||
* if (position != 0 && position != 3) {
|
||||
*
|
||||
* assertEquals(period.get("interestOutstanding"),
|
||||
* expectedRepaymentSchedule.getInterestOutstanding());
|
||||
* assertEquals(period.get("principalOutstanding"),
|
||||
* expectedRepaymentSchedule.getPrincipalOutstanding());
|
||||
* assertEquals(period.get("principalDue"),
|
||||
* expectedRepaymentSchedule.getPrincipalDue());
|
||||
* assertEquals(period.get("principalOriginalDue"),
|
||||
* expectedRepaymentSchedule.getPrincipalOriginalDue());
|
||||
* assertEquals(period.get("fromDate").toString(),
|
||||
* expectedRepaymentSchedule.getFromDate()); } }
|
||||
*/
|
||||
private Integer applyForLoanApplicationWithEmiAmount(final Integer clientID, final Integer loanProductID, final String proposedAmount,
|
||||
List<HashMap> tranches, final String installmentAmount) {
|
||||
|
||||
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
|
||||
final String loanApplicationJSON = new LoanApplicationTestBuilder()
|
||||
//
|
||||
.withPrincipal(proposedAmount)
|
||||
//
|
||||
.withLoanTermFrequency("12")
|
||||
//
|
||||
.withLoanTermFrequencyAsMonths()
|
||||
//
|
||||
.withNumberOfRepayments("12").withRepaymentEveryAfter("1").withRepaymentFrequencyTypeAsMonths() //
|
||||
.withInterestRatePerPeriod("1") //
|
||||
.withExpectedDisbursementDate("01 June 2015") //
|
||||
.withTranches(tranches) //
|
||||
.withFixedEmiAmount(installmentAmount) //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withSubmittedOnDate("01 June 2015") //
|
||||
.withAmortizationTypeAsEqualInstallments() //
|
||||
.build(clientID.toString(), loanProductID.toString(), null);
|
||||
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createApproveAndValidateMultiDisburseLoan() {
|
||||
|
||||
List<HashMap> createTranches = new ArrayList<>();
|
||||
String id = null;
|
||||
createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 March 2014", "1000"));
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
|
||||
System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------"
|
||||
+ clientID);
|
||||
|
||||
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
|
||||
.withInterestTypeAsDecliningBalance().withTranches(true).withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
|
||||
.build(null));
|
||||
System.out.println("----------------------------------LOAN PRODUCT CREATED WITH ID-------------------------------------------"
|
||||
+ loanProductID);
|
||||
|
||||
this.loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, proposedAmount, createTranches);
|
||||
System.out.println("-----------------------------------LOAN CREATED WITH LOANID-------------------------------------------------"
|
||||
+ loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount,
|
||||
loanID, createTranches);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
|
||||
System.out
|
||||
.println("-----------------------------------MULTI DISBURSAL LOAN APPROVED SUCCESSFULLY---------------------------------------");
|
||||
ArrayList<HashMap> disbursementDetails = (ArrayList<HashMap>) this.loanTransactionHelper.getLoanDetail(this.requestSpec,
|
||||
this.responseSpec, this.loanID, "disbursementDetails");
|
||||
this.disbursementId = (Integer) disbursementDetails.get(0).get("id");
|
||||
this.editLoanDisbursementDetails();
|
||||
}
|
||||
|
||||
private void editLoanDisbursementDetails() {
|
||||
this.editDateAndPrincipalOfExistingTranche();
|
||||
this.addNewDisbursementDetails();
|
||||
this.deleteDisbursmentDetails();
|
||||
}
|
||||
|
||||
private void addNewDisbursementDetails() {
|
||||
List<HashMap> addTranches = new ArrayList<>();
|
||||
ArrayList<HashMap> disbursementDetails = (ArrayList<HashMap>) this.loanTransactionHelper.getLoanDetail(this.requestSpec,
|
||||
this.responseSpec, this.loanID, "disbursementDetails");
|
||||
ArrayList expectedDisbursementDate = (ArrayList) disbursementDetails.get(0).get("expectedDisbursementDate");
|
||||
String date = formatExpectedDisbursementDate(expectedDisbursementDate.toString());
|
||||
|
||||
String id = null;
|
||||
addTranches.add(this.loanTransactionHelper.createTrancheDetail(disbursementDetails.get(0).get("id").toString(), date,
|
||||
disbursementDetails.get(0).get("principal").toString()));
|
||||
addTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "3 March 2014", "2000"));
|
||||
addTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "4 March 2014", "500"));
|
||||
|
||||
/* Add disbursement detail */
|
||||
this.loanTransactionHelper.addAndDeleteDisbursementDetail(this.loanID, this.approvalAmount, this.expectedDisbursementDate,
|
||||
addTranches, "");
|
||||
}
|
||||
|
||||
private void deleteDisbursmentDetails() {
|
||||
List<HashMap> deleteTranches = new ArrayList<>();
|
||||
ArrayList<HashMap> disbursementDetails = (ArrayList<HashMap>) this.loanTransactionHelper.getLoanDetail(this.requestSpec,
|
||||
this.responseSpec, this.loanID, "disbursementDetails");
|
||||
/* Delete the last tranche */
|
||||
for (int i = 0; i < disbursementDetails.size() - 1; i++) {
|
||||
ArrayList expectedDisbursementDate = (ArrayList) disbursementDetails.get(i).get("expectedDisbursementDate");
|
||||
String disbursementDate = formatExpectedDisbursementDate(expectedDisbursementDate.toString());
|
||||
deleteTranches.add(this.loanTransactionHelper.createTrancheDetail(disbursementDetails.get(i).get("id").toString(),
|
||||
disbursementDate, disbursementDetails.get(i).get("principal").toString()));
|
||||
}
|
||||
|
||||
/* Add disbursement detail */
|
||||
this.loanTransactionHelper.addAndDeleteDisbursementDetail(this.loanID, this.approvalAmount, this.expectedDisbursementDate,
|
||||
deleteTranches, "");
|
||||
}
|
||||
|
||||
private void editDateAndPrincipalOfExistingTranche() {
|
||||
String updatedExpectedDisbursementDate = "01 March 2014";
|
||||
String updatedPrincipal = "900";
|
||||
/* Update */
|
||||
this.loanTransactionHelper.editDisbursementDetail(this.loanID, this.disbursementId, this.approvalAmount,
|
||||
this.expectedDisbursementDate, updatedExpectedDisbursementDate, updatedPrincipal, "");
|
||||
/* Validate Edit */
|
||||
ArrayList<HashMap> disbursementDetails = (ArrayList<HashMap>) this.loanTransactionHelper.getLoanDetail(this.requestSpec,
|
||||
this.responseSpec, this.loanID, "disbursementDetails");
|
||||
assertEquals(Float.valueOf(updatedPrincipal), disbursementDetails.get(0).get("principal"));
|
||||
ArrayList expectedDisbursementDate = (ArrayList) disbursementDetails.get(0).get("expectedDisbursementDate");
|
||||
String date = formatExpectedDisbursementDate(expectedDisbursementDate.toString());
|
||||
assertEquals(updatedExpectedDisbursementDate, date);
|
||||
|
||||
}
|
||||
|
||||
private String formatExpectedDisbursementDate(String expectedDisbursementDate) {
|
||||
|
||||
SimpleDateFormat source = new SimpleDateFormat("[yyyy, MM, dd]");
|
||||
SimpleDateFormat target = new SimpleDateFormat("dd MMMM yyyy");
|
||||
String date = null;
|
||||
try {
|
||||
date = target.format(source.parse(expectedDisbursementDate));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
private Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, String principal,
|
||||
List<HashMap> tranches) {
|
||||
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
|
||||
final String loanApplicationJSON = new LoanApplicationTestBuilder()
|
||||
//
|
||||
.withPrincipal(principal)
|
||||
//
|
||||
.withLoanTermFrequency("5")
|
||||
//
|
||||
.withLoanTermFrequencyAsMonths()
|
||||
//
|
||||
.withNumberOfRepayments("5").withRepaymentEveryAfter("1").withRepaymentFrequencyTypeAsMonths() //
|
||||
.withInterestRatePerPeriod("2") //
|
||||
.withExpectedDisbursementDate("01 March 2014") //
|
||||
.withTranches(tranches) //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withSubmittedOnDate("01 March 2014") //
|
||||
.build(clientID.toString(), loanProductID.toString(), null);
|
||||
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
}
|
||||
|
||||
}
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class LoanRepaymentRescheduleAtDisbursementTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
private LoanApplicationApprovalTest loanApplicationApprovalTest;
|
||||
private ResponseSpecification generalResponseSpec;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanApplicationApprovalTest = new LoanApplicationApprovalTest();
|
||||
this.generalResponseSpec = new ResponseSpecBuilder().build();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testLoanRepaymentRescheduleAtDisbursement(){
|
||||
|
||||
final String approvalAmount = "10000";
|
||||
final String approveDate = "01 March 2015";
|
||||
final String expectedDisbursementDate = "01 March 2015";
|
||||
final String disbursementDate = "01 March 2015";
|
||||
final String adjustRepaymentDate = "16 March 2015";
|
||||
|
||||
// CREATE CLIENT
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
|
||||
System.out.println("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------"
|
||||
+ clientID);
|
||||
|
||||
// CREATE LOAN MULTIDISBURSAL PRODUCT WITH INTEREST RECALCULATION
|
||||
final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.RBI_INDIA_STRATEGY,
|
||||
LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
|
||||
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_NUMBER_OF_INSTALLMENTS,
|
||||
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "0",
|
||||
LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null);
|
||||
|
||||
// CREATE TRANCHES
|
||||
List<HashMap> createTranches = new ArrayList<>();
|
||||
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("01 March 2015", "5000"));
|
||||
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("01 May 2015", "5000"));
|
||||
|
||||
// APPROVE TRANCHES
|
||||
List<HashMap> approveTranches = new ArrayList<>();
|
||||
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("01 March 2015", "5000"));
|
||||
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail("01 May 2015", "5000"));
|
||||
|
||||
// APPLY FOR TRANCHE LOAN WITH INTEREST RECALCULATION
|
||||
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, disbursementDate,
|
||||
LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0), createTranches);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
// VALIDATE THE LOAN STATUS
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount,
|
||||
loanID, approveTranches);
|
||||
|
||||
// VALIDATE THE LOAN IS APPROVED
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
|
||||
|
||||
// DISBURSE A FIRST TRANCHE
|
||||
this.loanTransactionHelper.disburseLoanWithRepaymentReschedule(disbursementDate, loanID, adjustRepaymentDate);
|
||||
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
ArrayList<HashMap> loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, generalResponseSpec, loanID);
|
||||
HashMap firstInstallement = loanRepaymnetSchedule.get(1);
|
||||
Map<String, Object> expectedvalues = new HashMap<>(3);
|
||||
Calendar date = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||
date.set(2015, Calendar.MARCH, 16);
|
||||
expectedvalues.put("dueDate", getDateAsArray(date, 0));
|
||||
expectedvalues.put("principalDue", "834.71");
|
||||
expectedvalues.put("interestDue", "49.32");
|
||||
expectedvalues.put("feeChargesDue", "0");
|
||||
expectedvalues.put("penaltyChargesDue", "0");
|
||||
expectedvalues.put("totalDueForPeriod", "884.03");
|
||||
|
||||
// VALIDATE REPAYMENT SCHEDULE
|
||||
verifyLoanRepaymentSchedule(firstInstallement, expectedvalues);
|
||||
|
||||
}
|
||||
|
||||
private void verifyLoanRepaymentSchedule(final HashMap firstInstallement, final Map<String, Object> expectedvalues) {
|
||||
|
||||
assertEquals(expectedvalues.get("dueDate"), firstInstallement.get("dueDate"));
|
||||
assertEquals(String.valueOf(expectedvalues.get("principalDue")), String.valueOf(firstInstallement.get("principalDue")));
|
||||
assertEquals(String.valueOf(expectedvalues.get("interestDue")), String.valueOf(firstInstallement.get("interestDue")));
|
||||
assertEquals(String.valueOf(expectedvalues.get("feeChargesDue")), String.valueOf(firstInstallement.get("feeChargesDue")));
|
||||
assertEquals(String.valueOf(expectedvalues.get("penaltyChargesDue")), String.valueOf(firstInstallement.get("penaltyChargesDue")));
|
||||
assertEquals(String.valueOf(expectedvalues.get("totalDueForPeriod")), String.valueOf(firstInstallement.get("totalDueForPeriod")));
|
||||
|
||||
}
|
||||
|
||||
private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
|
||||
final String interestRecalculationCompoundingMethod, final String rescheduleStrategyMethod,
|
||||
final String recalculationRestFrequencyType, final String recalculationRestFrequencyInterval,
|
||||
final String preCloseInterestCalculationStrategy, final Account[] accounts) {
|
||||
final String recalculationCompoundingFrequencyType = null;
|
||||
final String recalculationCompoundingFrequencyInterval = null;
|
||||
final Integer recalculationCompoundingFrequencyOnDayType = null;
|
||||
final Integer recalculationCompoundingFrequencyDayOfWeekType = null;
|
||||
final Integer recalculationRestFrequencyOnDayType = null;
|
||||
final Integer recalculationRestFrequencyDayOfWeekType = null;
|
||||
return createLoanProductWithInterestRecalculation(repaymentStrategy, interestRecalculationCompoundingMethod,
|
||||
rescheduleStrategyMethod, recalculationRestFrequencyType, recalculationRestFrequencyInterval,
|
||||
recalculationCompoundingFrequencyType, recalculationCompoundingFrequencyInterval, preCloseInterestCalculationStrategy,
|
||||
accounts, null, false, recalculationCompoundingFrequencyOnDayType, recalculationCompoundingFrequencyDayOfWeekType,
|
||||
recalculationRestFrequencyOnDayType, recalculationRestFrequencyDayOfWeekType);
|
||||
}
|
||||
|
||||
private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
|
||||
final String interestRecalculationCompoundingMethod, final String rescheduleStrategyMethod,
|
||||
final String recalculationRestFrequencyType, final String recalculationRestFrequencyInterval,
|
||||
final String recalculationCompoundingFrequencyType, final String recalculationCompoundingFrequencyInterval,
|
||||
final String preCloseInterestCalculationStrategy, final Account[] accounts, final String chargeId,
|
||||
boolean isArrearsBasedOnOriginalSchedule, final Integer recalculationCompoundingFrequencyOnDayType,
|
||||
final Integer recalculationCompoundingFrequencyDayOfWeekType, final Integer recalculationRestFrequencyOnDayType,
|
||||
final Integer recalculationRestFrequencyDayOfWeekType) {
|
||||
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
|
||||
LoanProductTestBuilder builder = new LoanProductTestBuilder()
|
||||
.withPrincipal("10000.00")
|
||||
.withNumberOfRepayments("12")
|
||||
.withRepaymentAfterEvery("2")
|
||||
.withRepaymentTypeAsWeek()
|
||||
.withinterestRatePerPeriod("2")
|
||||
.withInterestRateFrequencyTypeAsMonths()
|
||||
.withTranches(true)
|
||||
.withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
|
||||
.withRepaymentStrategy(repaymentStrategy)
|
||||
.withInterestTypeAsDecliningBalance()
|
||||
.withInterestRecalculationDetails(interestRecalculationCompoundingMethod, rescheduleStrategyMethod,
|
||||
preCloseInterestCalculationStrategy)
|
||||
.withInterestRecalculationRestFrequencyDetails(recalculationRestFrequencyType, recalculationRestFrequencyInterval,
|
||||
recalculationRestFrequencyOnDayType, recalculationRestFrequencyDayOfWeekType)
|
||||
.withInterestRecalculationCompoundingFrequencyDetails(recalculationCompoundingFrequencyType,
|
||||
recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyOnDayType,
|
||||
recalculationCompoundingFrequencyDayOfWeekType);
|
||||
if (accounts != null) {
|
||||
builder = builder.withAccountingRulePeriodicAccrual(accounts);
|
||||
}
|
||||
|
||||
if (isArrearsBasedOnOriginalSchedule) builder = builder.withArrearsConfiguration();
|
||||
|
||||
final String loanProductJSON = builder.build(chargeId);
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
|
||||
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, final Integer loanProductID,
|
||||
final String disbursementDate, final String repaymentStrategy, final List<HashMap> charges, List<HashMap> tranches) {
|
||||
final String graceOnInterestPayment = null;
|
||||
final String graceOnPrincipalPayment = null;
|
||||
return applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, disbursementDate, repaymentStrategy, charges,
|
||||
graceOnInterestPayment, graceOnPrincipalPayment, tranches);
|
||||
}
|
||||
|
||||
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, final Integer loanProductID,
|
||||
final String disbursementDate, final String repaymentStrategy, final List<HashMap> charges, final String graceOnInterestPayment,
|
||||
final String graceOnPrincipalPayment, List<HashMap> tranches) {
|
||||
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
|
||||
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
|
||||
.withPrincipal("10000.00") //
|
||||
.withLoanTermFrequency("24") //
|
||||
.withLoanTermFrequencyAsWeeks() //
|
||||
.withNumberOfRepayments("12") //
|
||||
.withRepaymentEveryAfter("2") //
|
||||
.withRepaymentFrequencyTypeAsWeeks() //
|
||||
.withInterestRatePerPeriod("2") //
|
||||
.withAmortizationTypeAsEqualInstallments() //
|
||||
.withTranches(tranches)
|
||||
.withFixedEmiAmount("") //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withInterestCalculationPeriodTypeAsDays() //
|
||||
.withInterestCalculationPeriodTypeAsDays() //
|
||||
.withExpectedDisbursementDate(disbursementDate) //
|
||||
.withSubmittedOnDate(disbursementDate) //
|
||||
.withwithRepaymentStrategy(repaymentStrategy) //
|
||||
.withCharges(charges)//
|
||||
.build(clientID.toString(), loanProductID.toString(), null);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
}
|
||||
|
||||
private List getDateAsArray(Calendar date, int addPeriod) {
|
||||
return getDateAsArray(date, addPeriod, Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
private List getDateAsArray(Calendar date, int addvalue, int type) {
|
||||
date.add(type, addvalue);
|
||||
return new ArrayList<>(Arrays.asList(date.get(Calendar.YEAR), date.get(Calendar.MONTH) + 1,
|
||||
date.get(Calendar.DAY_OF_MONTH)));
|
||||
}
|
||||
}
|
||||
+25
-12
@@ -1,24 +1,37 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.LoanRescheduleRequestHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -198,7 +211,7 @@ public class LoanRescheduleRequestTest {
|
||||
final HashMap loanSummary = this.loanTransactionHelper.getLoanSummary(requestSpec, generalResponseSpec, loanId);
|
||||
final Float totalExpectedRepayment = (Float) loanSummary.get("totalExpectedRepayment");
|
||||
|
||||
assertEquals("NUMBER OF REPAYMENTS SHOULD BE 16, NOT 12", "16", numberOfRepayments.toString());
|
||||
assertEquals("NUMBER OF REPAYMENTS SHOULD BE 16, NOT 12", "12", numberOfRepayments.toString());
|
||||
assertEquals("TOTAL EXPECTED REPAYMENT MUST BE EQUAL TO 118000.0", "118000.0", totalExpectedRepayment.toString());
|
||||
|
||||
System.out.println("Successfully approved loan reschedule request (ID: " + this.loanRescheduleRequestId + ")");
|
||||
+406
@@ -0,0 +1,406 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.apache.fineract.integrationtests.common.CalendarHelper;
|
||||
import org.apache.fineract.integrationtests.common.CenterDomain;
|
||||
import org.apache.fineract.integrationtests.common.CenterHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.GroupHelper;
|
||||
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
public class LoanReschedulingWithinCenterTest {
|
||||
|
||||
private RequestSpecification requestSpec;
|
||||
private ResponseSpecification responseSpec;
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
private ResponseSpecification generalResponseSpec;
|
||||
private LoanApplicationApprovalTest loanApplicationApprovalTest;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanApplicationApprovalTest = new LoanApplicationApprovalTest();
|
||||
this.generalResponseSpec = new ResponseSpecBuilder().build();
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Test
|
||||
public void testCenterReschedulingLoansWithInterestRecalculationEnabled() {
|
||||
|
||||
Integer officeId = new OfficeHelper(requestSpec, responseSpec).createOffice("01 July 2007");
|
||||
String name = "TestFullCreation" + new Timestamp(new java.util.Date().getTime());
|
||||
String externalId = Utils.randomStringGenerator("ID_", 7, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
int staffId = StaffHelper.createStaff(requestSpec, responseSpec);
|
||||
int[] groupMembers = generateGroupMembers(1, officeId);
|
||||
final String centerActivationDate = "01 July 2007";
|
||||
Integer centerId = CenterHelper.createCenter(name, officeId, externalId, staffId, groupMembers, centerActivationDate, requestSpec,
|
||||
responseSpec);
|
||||
CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec);
|
||||
Integer groupId = groupMembers[0];
|
||||
Assert.assertNotNull(center);
|
||||
Assert.assertTrue(center.getStaffId() == staffId);
|
||||
Assert.assertTrue(center.isActive() == true);
|
||||
|
||||
Integer calendarId = createCalendarMeeting(centerId);
|
||||
|
||||
Integer clientId = createClient(officeId);
|
||||
|
||||
associateClientsToGroup(groupId, clientId);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
|
||||
Calendar today = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||
today.add(Calendar.DAY_OF_MONTH, -14);
|
||||
// CREATE A LOAN PRODUCT
|
||||
final String disbursalDate = dateFormat.format(today.getTime());
|
||||
final String recalculationRestFrequencyDate = "01 January 2012";
|
||||
final boolean isMultiTrancheLoan = false;
|
||||
|
||||
// CREATE LOAN MULTIDISBURSAL PRODUCT WITH INTEREST RECALCULATION
|
||||
final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.RBI_INDIA_STRATEGY,
|
||||
LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
|
||||
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_NUMBER_OF_INSTALLMENTS,
|
||||
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "0", recalculationRestFrequencyDate,
|
||||
LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, isMultiTrancheLoan,
|
||||
null, null);
|
||||
|
||||
// APPLY FOR TRANCHE LOAN WITH INTEREST RECALCULATION
|
||||
final Integer loanId = applyForLoanApplicationForInterestRecalculation(clientId, groupId, calendarId, loanProductID, disbursalDate,
|
||||
recalculationRestFrequencyDate, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0), null);
|
||||
|
||||
// Test for loan account is created
|
||||
Assert.assertNotNull(loanId);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanId);
|
||||
|
||||
// Test for loan account is created, can be approved
|
||||
this.loanTransactionHelper.approveLoan(disbursalDate, loanId);
|
||||
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanId);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
|
||||
// Test for loan account approved can be disbursed
|
||||
this.loanTransactionHelper.disburseLoan(disbursalDate, loanId);
|
||||
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanId);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
System.out.println("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------");
|
||||
Calendar todaysdate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||
todaysdate.add(Calendar.DAY_OF_MONTH, 14);
|
||||
String oldMeetingDate = dateFormat.format(todaysdate.getTime());
|
||||
todaysdate.add(Calendar.DAY_OF_MONTH, 1);
|
||||
final String centerMeetingNewStartDate = dateFormat.format(todaysdate.getTime());
|
||||
CalendarHelper.updateMeetingCalendarForCenter(this.requestSpec, this.responseSpec, centerId, calendarId.toString(), oldMeetingDate,
|
||||
centerMeetingNewStartDate);
|
||||
|
||||
ArrayList loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, generalResponseSpec, loanId);
|
||||
// VERIFY RESCHEDULED DATE
|
||||
ArrayList dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
|
||||
assertEquals(getDateAsArray(todaysdate, 0), dueDateLoanSchedule);
|
||||
|
||||
// VERIFY THE INTEREST
|
||||
Float interestDue = (Float) ((HashMap) loanRepaymnetSchedule.get(2)).get("interestDue");
|
||||
assertEquals(String.valueOf(interestDue), "90.82");
|
||||
|
||||
}
|
||||
|
||||
private void associateClientsToGroup(Integer groupId, Integer clientId) {
|
||||
// Associate client to the group
|
||||
GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupId.toString(), clientId.toString());
|
||||
GroupHelper.verifyGroupMembers(this.requestSpec, this.responseSpec, groupId, clientId);
|
||||
}
|
||||
|
||||
private Integer createClient(Integer officeId) {
|
||||
// CREATE CLIENT
|
||||
final String clientActivationDate = "01 July 2014";
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec, clientActivationDate, officeId.toString());
|
||||
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientId);
|
||||
return clientId;
|
||||
}
|
||||
|
||||
private Integer createCalendarMeeting(Integer centerId) {
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
|
||||
Calendar today = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||
final String startDate = dateFormat.format(today.getTime());
|
||||
final String frequency = "2"; // 2:Weekly
|
||||
final String interval = "2"; // Every one week
|
||||
final Integer repeatsOnDay = today.get(Calendar.DAY_OF_WEEK) - 1;
|
||||
|
||||
Integer calendarId = CalendarHelper.createMeetingForGroup(this.requestSpec, this.responseSpec, centerId, startDate, frequency,
|
||||
interval, repeatsOnDay.toString());
|
||||
System.out.println("calendarId " + calendarId);
|
||||
return calendarId;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Test
|
||||
public void testCenterReschedulingMultiTrancheLoansWithInterestRecalculationEnabled() {
|
||||
|
||||
Integer officeId = new OfficeHelper(requestSpec, responseSpec).createOffice("01 July 2007");
|
||||
String name = "TestFullCreation" + new Timestamp(new java.util.Date().getTime());
|
||||
String externalId = Utils.randomStringGenerator("ID_", 7, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
int staffId = StaffHelper.createStaff(requestSpec, responseSpec);
|
||||
int[] groupMembers = generateGroupMembers(1, officeId);
|
||||
final String centerActivationDate = "01 July 2007";
|
||||
Integer centerId = CenterHelper.createCenter(name, officeId, externalId, staffId, groupMembers, centerActivationDate, requestSpec,
|
||||
responseSpec);
|
||||
CenterDomain center = CenterHelper.retrieveByID(centerId, requestSpec, responseSpec);
|
||||
Integer groupId = groupMembers[0];
|
||||
Assert.assertNotNull(center);
|
||||
Assert.assertTrue(center.getStaffId() == staffId);
|
||||
Assert.assertTrue(center.isActive() == true);
|
||||
|
||||
Integer calendarId = createCalendarMeeting(centerId);
|
||||
|
||||
Integer clientId = createClient(officeId);
|
||||
|
||||
associateClientsToGroup(groupId, clientId);
|
||||
|
||||
// CREATE A LOAN PRODUCT
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
|
||||
Calendar today = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||
today.add(Calendar.DAY_OF_MONTH, -14);
|
||||
// CREATE A LOAN PRODUCT
|
||||
final String approveDate = dateFormat.format(today.getTime());
|
||||
final String expectedDisbursementDate = dateFormat.format(today.getTime());
|
||||
final String disbursementDate = dateFormat.format(today.getTime());
|
||||
final String approvalAmount = "10000";
|
||||
final String recalculationRestFrequencyDate = "01 January 2012";
|
||||
final boolean isMultiTrancheLoan = true;
|
||||
|
||||
// CREATE LOAN MULTIDISBURSAL PRODUCT WITH INTEREST RECALCULATION
|
||||
final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.RBI_INDIA_STRATEGY,
|
||||
LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
|
||||
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_NUMBER_OF_INSTALLMENTS,
|
||||
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "0", recalculationRestFrequencyDate,
|
||||
LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, isMultiTrancheLoan,
|
||||
null, null);
|
||||
|
||||
Calendar seondTrancheDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||
seondTrancheDate.add(Calendar.MONTH, 1);
|
||||
String secondDisbursement = dateFormat.format(seondTrancheDate.getTime()) ;
|
||||
|
||||
// CREATE TRANCHES
|
||||
List<HashMap> createTranches = new ArrayList<>();
|
||||
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail(disbursementDate, "5000"));
|
||||
createTranches.add(this.loanApplicationApprovalTest.createTrancheDetail(secondDisbursement, "5000"));
|
||||
|
||||
// APPROVE TRANCHES
|
||||
List<HashMap> approveTranches = new ArrayList<>();
|
||||
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail(disbursementDate, "5000"));
|
||||
approveTranches.add(this.loanApplicationApprovalTest.createTrancheDetail(secondDisbursement, "5000"));
|
||||
|
||||
// APPLY FOR TRANCHE LOAN WITH INTEREST RECALCULATION
|
||||
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientId, groupId, calendarId, loanProductID,
|
||||
disbursementDate, recalculationRestFrequencyDate, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0),
|
||||
createTranches);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
// VALIDATE THE LOAN STATUS
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
System.out.println("-----------------------------------APPROVE LOAN-----------------------------------------------------------");
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoanWithApproveAmount(approveDate, expectedDisbursementDate, approvalAmount,
|
||||
loanID, approveTranches);
|
||||
|
||||
// VALIDATE THE LOAN IS APPROVED
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
|
||||
|
||||
// DISBURSE A FIRST TRANCHE
|
||||
this.loanTransactionHelper.disburseLoan(disbursementDate, loanID);
|
||||
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
|
||||
System.out.println("---------------------------------CHANGING GROUP MEETING DATE ------------------------------------------");
|
||||
Calendar todaysdate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||
todaysdate.add(Calendar.DAY_OF_MONTH, 14);
|
||||
String oldMeetingDate = dateFormat.format(todaysdate.getTime());
|
||||
todaysdate.add(Calendar.DAY_OF_MONTH, 1);
|
||||
final String centerMeetingNewStartDate = dateFormat.format(todaysdate.getTime());
|
||||
CalendarHelper.updateMeetingCalendarForCenter(this.requestSpec, this.responseSpec, centerId, calendarId.toString(), oldMeetingDate,
|
||||
centerMeetingNewStartDate);
|
||||
|
||||
ArrayList loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, generalResponseSpec, loanID);
|
||||
// VERIFY RESCHEDULED DATE
|
||||
ArrayList dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
|
||||
assertEquals(getDateAsArray(todaysdate, 0), dueDateLoanSchedule);
|
||||
|
||||
// VERIFY THE INTEREST
|
||||
Float interestDue = (Float) ((HashMap) loanRepaymnetSchedule.get(2)).get("interestDue");
|
||||
assertEquals(String.valueOf(interestDue), "41.05");
|
||||
|
||||
}
|
||||
|
||||
private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
|
||||
final String interestRecalculationCompoundingMethod, final String rescheduleStrategyMethod,
|
||||
final String recalculationRestFrequencyType, final String recalculationRestFrequencyInterval,
|
||||
final String recalculationRestFrequencyDate, final String preCloseInterestCalculationStrategy, final Account[] accounts,
|
||||
final boolean isMultiTrancheLoan, final Integer recalculationRestFrequencyOnDayType, final Integer recalculationRestFrequencyDayOfWeekType) {
|
||||
final String recalculationCompoundingFrequencyType = null;
|
||||
final String recalculationCompoundingFrequencyInterval = null;
|
||||
final String recalculationCompoundingFrequencyDate = null;
|
||||
final Integer recalculationCompoundingFrequencyOnDayType = null;
|
||||
final Integer recalculationCompoundingFrequencyDayOfWeekType = null;
|
||||
return createLoanProductWithInterestRecalculation(repaymentStrategy, interestRecalculationCompoundingMethod,
|
||||
rescheduleStrategyMethod, recalculationRestFrequencyType, recalculationRestFrequencyInterval,
|
||||
recalculationRestFrequencyDate, recalculationCompoundingFrequencyType, recalculationCompoundingFrequencyInterval,
|
||||
recalculationCompoundingFrequencyDate, preCloseInterestCalculationStrategy, accounts, null, false, isMultiTrancheLoan,
|
||||
recalculationCompoundingFrequencyOnDayType, recalculationCompoundingFrequencyDayOfWeekType, recalculationRestFrequencyOnDayType,
|
||||
recalculationRestFrequencyDayOfWeekType);
|
||||
}
|
||||
|
||||
private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
|
||||
final String interestRecalculationCompoundingMethod, final String rescheduleStrategyMethod,
|
||||
final String recalculationRestFrequencyType, final String recalculationRestFrequencyInterval,
|
||||
final String recalculationRestFrequencyDate, final String recalculationCompoundingFrequencyType,
|
||||
final String recalculationCompoundingFrequencyInterval, final String recalculationCompoundingFrequencyDate,
|
||||
final String preCloseInterestCalculationStrategy, final Account[] accounts, final String chargeId,
|
||||
boolean isArrearsBasedOnOriginalSchedule, final boolean isMultiTrancheLoan,
|
||||
final Integer recalculationCompoundingFrequencyOnDayType,
|
||||
final Integer recalculationCompoundingFrequencyDayOfWeekType, final Integer recalculationRestFrequencyOnDayType,
|
||||
final Integer recalculationRestFrequencyDayOfWeekType) {
|
||||
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
|
||||
LoanProductTestBuilder builder = new LoanProductTestBuilder()
|
||||
.withPrincipal("10000.00")
|
||||
.withNumberOfRepayments("12")
|
||||
.withRepaymentAfterEvery("2")
|
||||
.withRepaymentTypeAsWeek()
|
||||
.withinterestRatePerPeriod("2")
|
||||
.withInterestRateFrequencyTypeAsMonths()
|
||||
.withTranches(isMultiTrancheLoan)
|
||||
.withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
|
||||
.withRepaymentStrategy(repaymentStrategy)
|
||||
.withInterestTypeAsDecliningBalance()
|
||||
.withInterestRecalculationDetails(interestRecalculationCompoundingMethod, rescheduleStrategyMethod,
|
||||
preCloseInterestCalculationStrategy)
|
||||
.withInterestRecalculationRestFrequencyDetails(recalculationRestFrequencyType, recalculationRestFrequencyInterval,
|
||||
recalculationRestFrequencyOnDayType, recalculationRestFrequencyDayOfWeekType)
|
||||
.withInterestRecalculationCompoundingFrequencyDetails(recalculationCompoundingFrequencyType,
|
||||
recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyOnDayType,
|
||||
recalculationCompoundingFrequencyDayOfWeekType);
|
||||
if (accounts != null) {
|
||||
builder = builder.withAccountingRulePeriodicAccrual(accounts);
|
||||
}
|
||||
|
||||
if (isArrearsBasedOnOriginalSchedule) builder = builder.withArrearsConfiguration();
|
||||
|
||||
final String loanProductJSON = builder.build(chargeId);
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, Integer groupId, Integer calendarId,
|
||||
final Integer loanProductID, final String disbursementDate, final String restStartDate, final String repaymentStrategy,
|
||||
final List<HashMap> charges, List<HashMap> tranches) {
|
||||
final String graceOnInterestPayment = null;
|
||||
final String compoundingStartDate = null;
|
||||
final String graceOnPrincipalPayment = null;
|
||||
return applyForLoanApplicationForInterestRecalculation(clientID, groupId, calendarId, loanProductID, disbursementDate,
|
||||
restStartDate, compoundingStartDate, repaymentStrategy, charges, graceOnInterestPayment, graceOnPrincipalPayment, tranches);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unused" })
|
||||
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, Integer groupId, Integer calendarId,
|
||||
final Integer loanProductID, final String disbursementDate, final String restStartDate, final String compoundingStartDate,
|
||||
final String repaymentStrategy, final List<HashMap> charges, final String graceOnInterestPayment,
|
||||
final String graceOnPrincipalPayment, List<HashMap> tranches) {
|
||||
System.out.println("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
|
||||
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
|
||||
.withPrincipal("10000.00") //
|
||||
.withLoanTermFrequency("24") //
|
||||
.withLoanTermFrequencyAsWeeks() //
|
||||
.withNumberOfRepayments("12") //
|
||||
.withRepaymentEveryAfter("2") //
|
||||
.withRepaymentFrequencyTypeAsWeeks() //
|
||||
.withInterestRatePerPeriod("2").withLoanType("jlg") //
|
||||
.withCalendarID(calendarId.toString()).withAmortizationTypeAsEqualInstallments() //
|
||||
.withFixedEmiAmount("") //
|
||||
.withTranches(tranches).withInterestTypeAsDecliningBalance() //
|
||||
.withInterestCalculationPeriodTypeAsDays() //
|
||||
.withInterestCalculationPeriodTypeAsDays() //
|
||||
.withExpectedDisbursementDate(disbursementDate) //
|
||||
.withSubmittedOnDate(disbursementDate) //
|
||||
.withwithRepaymentStrategy(repaymentStrategy) //
|
||||
.withCharges(charges)//
|
||||
.build(clientID.toString(), groupId.toString(), loanProductID.toString(), null);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
}
|
||||
|
||||
private int[] generateGroupMembers(int size, int officeId) {
|
||||
int[] groupMembers = new int[size];
|
||||
for (int i = 0; i < groupMembers.length; i++) {
|
||||
final HashMap<String, String> map = new HashMap<>();
|
||||
map.put("officeId", "" + officeId);
|
||||
map.put("name", Utils.randomStringGenerator("Group_Name_", 5));
|
||||
map.put("externalId", Utils.randomStringGenerator("ID_", 7, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("locale", "en");
|
||||
map.put("active", "true");
|
||||
map.put("activationDate", "04 March 2011");
|
||||
|
||||
groupMembers[i] = Utils.performServerPost(requestSpec, responseSpec, "/fineract-provider/api/v1/groups?"
|
||||
+ Utils.TENANT_IDENTIFIER, new Gson().toJson(map), "groupId");
|
||||
}
|
||||
return groupMembers;
|
||||
}
|
||||
|
||||
private List getDateAsArray(Calendar date, int addPeriod) {
|
||||
return getDateAsArray(date, addPeriod, Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
private List getDateAsArray(Calendar date, int addvalue, int type) {
|
||||
date.add(type, addvalue);
|
||||
return new ArrayList<>(Arrays.asList(date.get(Calendar.YEAR), date.get(Calendar.MONTH) + 1, date.get(Calendar.DAY_OF_MONTH)));
|
||||
}
|
||||
|
||||
}
|
||||
+23
-10
@@ -1,21 +1,34 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class LoanWithdrawnByApplicantIntegrationTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void loanWithdrawnByApplicant() {
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2012");
|
||||
final Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder().build(null));
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
this.loanTransactionHelper.withdrawLoanApplicationByClient("03 April 2012", loanID);
|
||||
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanAccountIsNotActive(loanStatusHashMap);
|
||||
|
||||
}
|
||||
|
||||
private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID) {
|
||||
final String loanApplication = new LoanApplicationTestBuilder().withPrincipal("5000").withLoanTermFrequency("5")
|
||||
.withLoanTermFrequencyAsMonths().withNumberOfRepayments("5").withRepaymentEveryAfter("1")
|
||||
.withRepaymentFrequencyTypeAsMonths().withInterestRatePerPeriod("2").withExpectedDisbursementDate("04 April 2012")
|
||||
.withSubmittedOnDate("02 April 2012").build(clientID.toString(), loanProductID.toString(), null);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplication);
|
||||
}
|
||||
}
|
||||
+26
-13
@@ -1,27 +1,40 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.CalendarHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.GroupHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.CalendarHelper;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.GroupHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.OfficeDomain;
|
||||
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
public class OfficeIntegrationTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(
|
||||
ContentType.JSON).build();
|
||||
this.requestSpec
|
||||
.header("Authorization",
|
||||
"Basic "
|
||||
+ Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOfficeModification() {
|
||||
OfficeHelper oh = new OfficeHelper(requestSpec, responseSpec);
|
||||
int officeId = oh.createOffice("01 July 2007");
|
||||
String name = Utils.randomNameGenerator("New_Office_", 4);
|
||||
String date = "02 July 2007";
|
||||
String[] dateArr = { "2007", "7", "2" };
|
||||
|
||||
oh.updateOffice(officeId, name, date);
|
||||
OfficeDomain newOffice = oh.retrieveOfficeByID(officeId);
|
||||
|
||||
Assert.assertTrue(name.equals(newOffice.getName()));
|
||||
Assert.assertArrayEquals(dateArr, newOffice.getOpeningDate());
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.PasswordPreferencesHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public class PasswordPreferencesIntegrationTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private ResponseSpecification generalResponseSpec;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.generalResponseSpec = new ResponseSpecBuilder().build();
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updatePasswordPreferences() {
|
||||
String validationPolicyId = "2";
|
||||
PasswordPreferencesHelper.updatePasswordPreferences(requestSpec, responseSpec, validationPolicyId);
|
||||
this.validateIfThePasswordIsUpdated(validationPolicyId);
|
||||
}
|
||||
|
||||
private void validateIfThePasswordIsUpdated(String validationPolicyId){
|
||||
Integer id = PasswordPreferencesHelper.getActivePasswordPreference(requestSpec, responseSpec);
|
||||
assertEquals(validationPolicyId, id.toString());
|
||||
System.out.println("---------------------------------PASSWORD PREFERENCE VALIDATED SUCCESSFULLY-----------------------------------------");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateWithInvalidPolicyId() {
|
||||
String invalidValidationPolicyId = "2000";
|
||||
final List<HashMap> error = (List) PasswordPreferencesHelper.updateWithInvalidValidationPolicyId(requestSpec, generalResponseSpec, invalidValidationPolicyId,
|
||||
CommonConstants.RESPONSE_ERROR);
|
||||
assertEquals("Password Validation Policy with identifier 2000 does not exist", "error.msg.password.validation.policy.id.invalid",
|
||||
error.get(0).get("userMessageGlobalisationCode"));
|
||||
}
|
||||
|
||||
}
|
||||
+20
-7
@@ -1,18 +1,31 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.PaymentTypeDomain;
|
||||
import org.apache.fineract.integrationtests.common.PaymentTypeHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.PaymentTypeDomain;
|
||||
import org.mifosplatform.integrationtests.common.PaymentTypeHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+644
-27
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -12,38 +25,38 @@ import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.sf.ehcache.transaction.xa.EhcacheXAException;
|
||||
|
||||
import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||
import org.apache.fineract.integrationtests.common.TaxComponentHelper;
|
||||
import org.apache.fineract.integrationtests.common.TaxGroupHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.FinancialActivityAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntry;
|
||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account.AccountType;
|
||||
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositAccountStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.recurringdeposit.RecurringDepositProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.Months;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.CommonConstants;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account.AccountType;
|
||||
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.FinancialActivityAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositAccountStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.recurringdeposit.RecurringDepositProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -95,7 +108,7 @@ public class RecurringDepositTest {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
|
||||
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
|
||||
this.financialActivityAccountHelper = new FinancialActivityAccountHelper(this.requestSpec);
|
||||
@@ -459,6 +472,384 @@ public class RecurringDepositTest {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithPrematureClosureTypeTransferToSavings_WITH_HOLD_TAX() {
|
||||
this.recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
|
||||
/***
|
||||
* Create GL Accounts for product account mapping
|
||||
*/
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
final Account liabilityAccountForTax = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
DateFormat monthDayFormat = new SimpleDateFormat("dd MMM", Locale.US);
|
||||
DateFormat currentDateFormat = new SimpleDateFormat("dd");
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -3);
|
||||
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
|
||||
todaysDate.add(Calendar.YEAR, 10);
|
||||
final String VALID_TO = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
|
||||
|
||||
/***
|
||||
* Create client for applying Deposit and Savings accounts
|
||||
*/
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
/***
|
||||
* Create Savings product with CashBased accounting enabled
|
||||
*/
|
||||
final String accountingRule = CASH_BASED;
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, accountingRule,
|
||||
assetAccount, liabilityAccount, incomeAccount, expenseAccount);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
/***
|
||||
* Create Savings account and verify status is pending
|
||||
*/
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientId, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
/***
|
||||
* Approve the savings account and verify account is approved
|
||||
*/
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
/***
|
||||
* Activate the savings account and verify account is activated
|
||||
*/
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
/***
|
||||
* Create RD product with CashBased accounting enabled
|
||||
*/
|
||||
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
|
||||
Integer recurringDepositProductId = createRecurringDepositProductWithWithHoldTax(VALID_FROM, VALID_TO,String.valueOf(taxGroupId), accountingRule, assetAccount,
|
||||
liabilityAccount, incomeAccount, expenseAccount);
|
||||
Assert.assertNotNull(recurringDepositProductId);
|
||||
|
||||
/***
|
||||
* Apply for RD account with created product and verify status
|
||||
*/
|
||||
Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(),
|
||||
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, EXPECTED_FIRST_DEPOSIT_ON_DATE);
|
||||
Assert.assertNotNull(recurringDepositAccountId);
|
||||
|
||||
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
|
||||
this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsPending(recurringDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Approve the RD account and verify whether account is approved
|
||||
*/
|
||||
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.approveRecurringDeposit(recurringDepositAccountId,
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Activate the RD Account and verify whether account is activated
|
||||
*/
|
||||
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.activateRecurringDeposit(recurringDepositAccountId,
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
|
||||
/***
|
||||
* Perform Deposit transaction and verify journal entries are posted for
|
||||
* the transaction
|
||||
*/
|
||||
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
|
||||
depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE);
|
||||
Assert.assertNotNull(depositTransactionId);
|
||||
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, EXPECTED_FIRST_DEPOSIT_ON_DATE, new JournalEntry(
|
||||
depositAmount, JournalEntry.TransactionType.DEBIT));
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, EXPECTED_FIRST_DEPOSIT_ON_DATE, new JournalEntry(
|
||||
depositAmount, JournalEntry.TransactionType.CREDIT));
|
||||
|
||||
/***
|
||||
* Update interest earned field for RD account
|
||||
*/
|
||||
recurringDepositAccountId = this.recurringDepositAccountHelper.calculateInterestForRecurringDeposit(recurringDepositAccountId);
|
||||
Assert.assertNotNull(recurringDepositAccountId);
|
||||
|
||||
/***
|
||||
* Post interest and verify journal entries
|
||||
*/
|
||||
Integer transactionIdForPostInterest = this.recurringDepositAccountHelper
|
||||
.postInterestForRecurringDeposit(recurringDepositAccountId);
|
||||
Assert.assertNotNull(transactionIdForPostInterest);
|
||||
|
||||
|
||||
HashMap accountSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float totalInterestPosted = (Float) accountSummary.get("totalInterestPosted");
|
||||
Assert.assertNull(accountSummary.get("totalWithholdTax"));
|
||||
|
||||
|
||||
final JournalEntry[] expenseAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.DEBIT) };
|
||||
final JournalEntry[] liablilityAccountEntry = { new JournalEntry(totalInterestPosted, JournalEntry.TransactionType.CREDIT) };
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(expenseAccount, INTEREST_POSTED_DATE, expenseAccountEntry);
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, INTEREST_POSTED_DATE, liablilityAccountEntry);
|
||||
|
||||
/***
|
||||
* Get saving account balance before preClosing RD account
|
||||
*/
|
||||
HashMap savingsSummaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
Float balanceBefore = (Float) savingsSummaryBefore.get("accountBalance");
|
||||
|
||||
HashMap recurringDepositPrematureData = this.recurringDepositAccountHelper.calculatePrematureAmountForRecurringDeposit(
|
||||
recurringDepositAccountId, CLOSED_ON_DATE);
|
||||
|
||||
/***
|
||||
* Retrieve mapped financial account for liability transfer
|
||||
*/
|
||||
Account financialAccount = getMappedLiabilityFinancialAccount();
|
||||
|
||||
/***
|
||||
* Preclose the RD account verify whether account is preClosed
|
||||
*/
|
||||
Integer prematureClosureTransactionId = (Integer) this.recurringDepositAccountHelper.prematureCloseForRecurringDeposit(
|
||||
recurringDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_TRANSFER_TO_SAVINGS, savingsId,
|
||||
CommonConstants.RESPONSE_RESOURCE_ID);
|
||||
Assert.assertNotNull(prematureClosureTransactionId);
|
||||
|
||||
recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositAccountIsPrematureClosed(recurringDepositAccountStatusHashMap);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float maturityAmount = Float.valueOf(recurringDepositAccountData.get("maturityAmount").toString());
|
||||
/***
|
||||
* Verify journal entry transactions for preclosure transaction As this
|
||||
* transaction is an account transfer you should get financial account
|
||||
* mapping details and verify amounts
|
||||
*/
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
|
||||
JournalEntry.TransactionType.CREDIT), new JournalEntry(maturityAmount, JournalEntry.TransactionType.DEBIT));
|
||||
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(financialAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
|
||||
JournalEntry.TransactionType.DEBIT), new JournalEntry(maturityAmount, JournalEntry.TransactionType.CREDIT));
|
||||
/***
|
||||
* Verify rd account maturity amount and savings account balance
|
||||
*/
|
||||
HashMap recurringDepositData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float prematurityAmount = (Float) recurringDepositData.get("maturityAmount");
|
||||
HashMap summary = (HashMap) recurringDepositData.get("summary");
|
||||
Assert.assertNotNull(summary.get("totalWithholdTax"));
|
||||
Float withHoldTax = (Float) summary.get("totalWithholdTax");
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
|
||||
JournalEntry.TransactionType.CREDIT));
|
||||
|
||||
HashMap savingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
Float balanceAfter = (Float) savingsSummaryAfter.get("accountBalance");
|
||||
Float expectedSavingsBalance = balanceBefore + prematurityAmount;
|
||||
|
||||
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
|
||||
decimalFormat.applyPattern(".");
|
||||
|
||||
Assert.assertEquals("Verifying Savings Account Balance after Premature Closure", decimalFormat.format(expectedSavingsBalance),
|
||||
decimalFormat.format(balanceAfter));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithClosureTypeTransferToSavings_WITH_HOLD_TAX() throws InterruptedException {
|
||||
this.recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
|
||||
/***
|
||||
* Create GL Accounts for product account mapping
|
||||
*/
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
final Account liabilityAccountForTax = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
DateFormat monthDayFormat = new SimpleDateFormat("dd MMM", Locale.US);
|
||||
DateFormat currentDateFormat = new SimpleDateFormat("dd");
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -20);
|
||||
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
|
||||
todaysDate.add(Calendar.YEAR, 10);
|
||||
final String VALID_TO = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -20);
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
|
||||
Calendar closedOn = Calendar.getInstance();
|
||||
closedOn.add(Calendar.MONTH, -6);
|
||||
final String CLOSED_ON_DATE = dateFormat.format(closedOn.getTime());
|
||||
|
||||
/***
|
||||
* Create client for applying Deposit and Savings accounts
|
||||
*/
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
/***
|
||||
* Create Savings product with CashBased accounting enabled
|
||||
*/
|
||||
final String accountingRule = CASH_BASED;
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE, accountingRule,
|
||||
assetAccount, liabilityAccount, incomeAccount, expenseAccount);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
/***
|
||||
* Create Savings account and verify status is pending
|
||||
*/
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientId, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assert.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
/***
|
||||
* Approve the savings account and verify account is approved
|
||||
*/
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
|
||||
|
||||
/***
|
||||
* Activate the savings account and verify account is activated
|
||||
*/
|
||||
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
|
||||
|
||||
/***
|
||||
* Create RD product with CashBased accounting enabled
|
||||
*/
|
||||
final Integer taxGroupId = createTaxGroup("10", liabilityAccountForTax);
|
||||
Integer recurringDepositProductId = createRecurringDepositProductWithWithHoldTax(VALID_FROM, VALID_TO,String.valueOf(taxGroupId), accountingRule, assetAccount,
|
||||
liabilityAccount, incomeAccount, expenseAccount);
|
||||
Assert.assertNotNull(recurringDepositProductId);
|
||||
|
||||
/***
|
||||
* Apply for RD account with created product and verify status
|
||||
*/
|
||||
Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(),
|
||||
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, EXPECTED_FIRST_DEPOSIT_ON_DATE);
|
||||
Assert.assertNotNull(recurringDepositAccountId);
|
||||
|
||||
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
|
||||
this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsPending(recurringDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Approve the RD account and verify whether account is approved
|
||||
*/
|
||||
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.approveRecurringDeposit(recurringDepositAccountId,
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Activate the RD Account and verify whether account is activated
|
||||
*/
|
||||
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.activateRecurringDeposit(recurringDepositAccountId,
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
|
||||
/***
|
||||
* Perform Deposit transaction and verify journal entries are posted for
|
||||
* the transaction
|
||||
*/
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -20);
|
||||
|
||||
for (int i = 0; i < 14; i++) {
|
||||
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
|
||||
depositAmount, dateFormat.format(todaysDate.getTime()));
|
||||
Assert.assertNotNull(depositTransactionId);
|
||||
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, dateFormat.format(todaysDate.getTime()), new JournalEntry(
|
||||
depositAmount, JournalEntry.TransactionType.DEBIT));
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, dateFormat.format(todaysDate.getTime()),
|
||||
new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT));
|
||||
todaysDate.add(Calendar.MONTH, 1);
|
||||
}
|
||||
|
||||
/***
|
||||
* FD account verify whether account is matured
|
||||
*/
|
||||
|
||||
SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec, responseSpec);
|
||||
String JobName = "Update Deposit Accounts Maturity details";
|
||||
schedulerJobHelper.executeJob(JobName);
|
||||
|
||||
HashMap accountDetails = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
HashMap summary = (HashMap) accountDetails.get("summary");
|
||||
Assert.assertNotNull(summary.get("totalWithholdTax"));
|
||||
Float withHoldTax = (Float) summary.get("totalWithholdTax");
|
||||
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
|
||||
JournalEntry.TransactionType.CREDIT));
|
||||
|
||||
|
||||
recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositAccountIsMatured(recurringDepositAccountStatusHashMap);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* Test case for Recurring Deposit Account premature closure with
|
||||
* transaction type ReInvest and Cash Based accounting enabled
|
||||
@@ -2483,6 +2874,169 @@ public class RecurringDepositTest {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithPeriodInterestRateChart() {
|
||||
final String chartToUse = "period";
|
||||
final String depositAmount = "1000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(6.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithPeriodInterestRateChart_AMOUNT_VARIATION() {
|
||||
final String chartToUse = "period";
|
||||
final String depositAmount = "10000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(6.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithPeriodInterestRateChart_PERIOD_VARIATION() {
|
||||
final String chartToUse = "period";
|
||||
final String depositAmount = "1000";
|
||||
final String depositPeriod = "18";
|
||||
final Float interestRate = new Float(7.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithAmountInterestRateChart() {
|
||||
final String chartToUse = "amount";
|
||||
final String depositAmount = "1000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(8.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithAmountInterestRateChart_AMOUNT_VARIATION() {
|
||||
final String chartToUse = "amount";
|
||||
final String depositAmount = "500";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(7.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithAmountInterestRateChart_PERIOD_VARIATION() {
|
||||
final String chartToUse = "amount";
|
||||
final String depositAmount = "500";
|
||||
final String depositPeriod = "10";
|
||||
final Float interestRate = new Float(5.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithPeriodAndAmountInterestRateChart() {
|
||||
final String chartToUse = "period_amount";
|
||||
final String depositAmount = "1000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(7.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithPeriodAndAmountInterestRateChart_AMOUNT_VARIATION() {
|
||||
final String chartToUse = "period_amount";
|
||||
final String depositAmount = "400";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(6.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithPeriodAndAmountInterestRateChart_PERIOD_VARIATION() {
|
||||
final String chartToUse = "period_amount";
|
||||
final String depositAmount = "1000";
|
||||
final String depositPeriod = "14";
|
||||
final Float interestRate = new Float(8.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithAmountAndPeriodInterestRateChart() {
|
||||
final String chartToUse = "amount_period";
|
||||
final String depositAmount = "1000";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(8.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithAmountAndPeriodInterestRateChart_AMOUNT_VARIATION() {
|
||||
final String chartToUse = "amount_period";
|
||||
final String depositAmount = "100";
|
||||
final String depositPeriod = "12";
|
||||
final Float interestRate = new Float(6.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountWithAmountAndPeriodInterestRateChart_PERIOD_VARIATION() {
|
||||
final String chartToUse = "amount_period";
|
||||
final String depositAmount = "1000";
|
||||
final String depositPeriod = "6";
|
||||
final Float interestRate = new Float(7.0);
|
||||
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
|
||||
}
|
||||
|
||||
private void testFixedDepositAccountForInterestRate(final String chartToUse, final String depositAmount, final String depositPeriod,
|
||||
final Float interestRate) {
|
||||
this.recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final String VALID_FROM = "01 March 2014";
|
||||
final String VALID_TO = "01 March 2016";
|
||||
|
||||
final String SUBMITTED_ON_DATE = "01 March 2015";
|
||||
final String APPROVED_ON_DATE = "01 March 2015";
|
||||
final String ACTIVATION_DATE = "01 March 2015";
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(clientId);
|
||||
|
||||
/***
|
||||
* Create FD product with CashBased accounting enabled
|
||||
*/
|
||||
final String accountingRule = NONE;
|
||||
Integer recurringDepositProductId = createRecurringDepositProduct(VALID_FROM, VALID_TO, accountingRule, chartToUse);
|
||||
Assert.assertNotNull(recurringDepositProductId);
|
||||
|
||||
/***
|
||||
* Apply for FD account with created product and verify status
|
||||
*/
|
||||
Integer recurringDepositAccountId = applyForRecurringDepositApplication(clientId.toString(), recurringDepositProductId.toString(),
|
||||
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, SUBMITTED_ON_DATE, depositAmount, depositPeriod);
|
||||
Assert.assertNotNull(recurringDepositAccountId);
|
||||
|
||||
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
|
||||
this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsPending(recurringDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Approve the RD account and verify whether account is approved
|
||||
*/
|
||||
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.approveRecurringDeposit(recurringDepositAccountId,
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
/***
|
||||
* Activate the RD Account and verify whether account is activated
|
||||
*/
|
||||
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.activateRecurringDeposit(recurringDepositAccountId,
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
|
||||
Assert.assertEquals(interestRate, recurringDepositAccountData.get("nominalAnnualInterestRate"));
|
||||
}
|
||||
|
||||
private Integer createRecurringDepositProduct(final String validFrom, final String validTo, final String accountingRule,
|
||||
Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
|
||||
@@ -2492,6 +3046,51 @@ public class RecurringDepositTest {
|
||||
} else if (accountingRule.equals(NONE)) {
|
||||
recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsNone();
|
||||
}
|
||||
final String recurringDepositProductJSON = recurringDepositProductHelper.withPeriodRangeChart().build(validFrom, validTo);
|
||||
return RecurringDepositProductHelper.createRecurringDepositProduct(recurringDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer createRecurringDepositProductWithWithHoldTax(final String validFrom, final String validTo,final String taxGroupId, final String accountingRule,
|
||||
Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
|
||||
RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
if (accountingRule.equals(CASH_BASED)) {
|
||||
recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsCashBased(accounts);
|
||||
} else if (accountingRule.equals(NONE)) {
|
||||
recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsNone();
|
||||
}
|
||||
final String recurringDepositProductJSON = recurringDepositProductHelper.withPeriodRangeChart()
|
||||
.withWithHoldTax(taxGroupId)//
|
||||
.build(validFrom, validTo);
|
||||
return RecurringDepositProductHelper.createRecurringDepositProduct(recurringDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer createRecurringDepositProduct(final String validFrom, final String validTo, final String accountingRule,
|
||||
final String chartToBePicked, Account... accounts) {
|
||||
System.out.println("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
|
||||
RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
if (accountingRule.equals(CASH_BASED)) {
|
||||
recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsCashBased(accounts);
|
||||
} else if (accountingRule.equals(NONE)) {
|
||||
recurringDepositProductHelper = recurringDepositProductHelper.withAccountingRuleAsNone();
|
||||
}
|
||||
|
||||
switch (chartToBePicked) {
|
||||
case "period":
|
||||
recurringDepositProductHelper = recurringDepositProductHelper.withPeriodRangeChart();
|
||||
break;
|
||||
case "amount":
|
||||
recurringDepositProductHelper = recurringDepositProductHelper.withAmountRangeChart();
|
||||
break;
|
||||
case "period_amount":
|
||||
recurringDepositProductHelper = recurringDepositProductHelper.withPeriodAndAmountRangeChart();
|
||||
break;
|
||||
case "amount_period":
|
||||
recurringDepositProductHelper = recurringDepositProductHelper.withAmountAndPeriodRangeChart();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
final String recurringDepositProductJSON = recurringDepositProductHelper.build(validFrom, validTo);
|
||||
return RecurringDepositProductHelper.createRecurringDepositProduct(recurringDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
@@ -2501,7 +3100,18 @@ public class RecurringDepositTest {
|
||||
System.out.println("--------------------------------APPLYING FOR RECURRING DEPOSIT ACCOUNT --------------------------------");
|
||||
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
.withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate)
|
||||
.build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
.build(clientID, productID, penalInterestType);
|
||||
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
}
|
||||
|
||||
private Integer applyForRecurringDepositApplication(final String clientID, final String productID, final String validFrom,
|
||||
final String validTo, final String submittedOnDate, final String penalInterestType, final String expectedFirstDepositOnDate,
|
||||
final String depositAmount, final String depositPeriod) {
|
||||
System.out.println("--------------------------------APPLYING FOR RECURRING DEPOSIT ACCOUNT --------------------------------");
|
||||
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
.withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate)
|
||||
.withDepositPeriod(depositPeriod).withMandatoryDepositAmount(depositAmount).build(clientID, productID, penalInterestType);
|
||||
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
}
|
||||
@@ -2576,6 +3186,13 @@ public class RecurringDepositTest {
|
||||
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
|
||||
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
|
||||
}
|
||||
|
||||
private Integer createTaxGroup(final String percentage, final Account liabilityAccountForTax){
|
||||
final Integer liabilityAccountId = liabilityAccountForTax.getAccountID();
|
||||
final Integer taxComponentId = TaxComponentHelper.createTaxComponent(this.requestSpec, this.responseSpec, percentage, liabilityAccountId);
|
||||
return TaxGroupHelper.createTaxGroup(this.requestSpec, this.responseSpec, Arrays.asList(taxComponentId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete the Liability transfer account
|
||||
+21
-8
@@ -1,22 +1,35 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
|
||||
import org.apache.fineract.integrationtests.useradministration.roles.RolesHelper;
|
||||
import org.apache.fineract.integrationtests.useradministration.users.UserHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.organisation.StaffHelper;
|
||||
import org.mifosplatform.integrationtests.useradministration.roles.RolesHelper;
|
||||
import org.mifosplatform.integrationtests.useradministration.users.UserHelper;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
+20
-7
@@ -1,18 +1,31 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.SchedulerJobHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -33,7 +46,7 @@ public class SchedulerJobsTest {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
|
||||
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.responseSpecForSchedulerJob = new ResponseSpecBuilder().expectStatusCode(202).build();
|
||||
}
|
||||
+50
-32
@@ -1,9 +1,22 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.mifosplatform.integrationtests;
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -17,32 +30,33 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||
import org.apache.fineract.integrationtests.common.HolidayHelper;
|
||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||
import org.apache.fineract.integrationtests.common.StandingInstructionsHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntry;
|
||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
|
||||
import org.apache.fineract.portfolio.account.PortfolioAccountType;
|
||||
import org.apache.fineract.portfolio.account.domain.AccountTransferType;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mifosplatform.integrationtests.common.ClientHelper;
|
||||
import org.mifosplatform.integrationtests.common.GlobalConfigurationHelper;
|
||||
import org.mifosplatform.integrationtests.common.HolidayHelper;
|
||||
import org.mifosplatform.integrationtests.common.SchedulerJobHelper;
|
||||
import org.mifosplatform.integrationtests.common.StandingInstructionsHelper;
|
||||
import org.mifosplatform.integrationtests.common.Utils;
|
||||
import org.mifosplatform.integrationtests.common.accounting.Account;
|
||||
import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
|
||||
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
|
||||
import org.mifosplatform.integrationtests.common.charges.ChargesHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositAccountStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
|
||||
import org.mifosplatform.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsProductHelper;
|
||||
import org.mifosplatform.integrationtests.common.savings.SavingsStatusChecker;
|
||||
import org.mifosplatform.portfolio.account.PortfolioAccountType;
|
||||
import org.mifosplatform.portfolio.account.domain.AccountTransferType;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
@@ -82,7 +96,7 @@ public class SchedulerJobsTestResults {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
|
||||
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.responseSpecForSchedulerJob = new ResponseSpecBuilder().expectStatusCode(202).build();
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
@@ -112,7 +126,7 @@ public class SchedulerJobsTestResults {
|
||||
ChargesHelper.getSavingsAnnualFeeJSON());
|
||||
Assert.assertNotNull(annualFeeChargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, annualFeeChargeId);
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, annualFeeChargeId, true);
|
||||
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
|
||||
@@ -333,7 +347,7 @@ public class SchedulerJobsTestResults {
|
||||
ChargesHelper.getSavingsSpecifiedDueDateJSON());
|
||||
Assert.assertNotNull(specifiedDueDateChargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, specifiedDueDateChargeId);
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, specifiedDueDateChargeId, true);
|
||||
ArrayList<HashMap> chargesPendingState = this.savingsAccountHelper.getSavingsCharges(savingsId);
|
||||
Assert.assertEquals(1, chargesPendingState.size());
|
||||
|
||||
@@ -503,6 +517,9 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
}
|
||||
|
||||
// Invalid test case as it won't affect summary (Loan summary is properly
|
||||
// updated before running this job)
|
||||
@Ignore
|
||||
@Test
|
||||
public void testUpdateLoanSummaryJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec, this.responseSpec);
|
||||
@@ -552,7 +569,7 @@ public class SchedulerJobsTestResults {
|
||||
String JobName = "Update loan Summary";
|
||||
this.schedulerJobHelper.executeJob(JobName);
|
||||
Float expectedSummaryAfterJob = (Float) loanSummaryBefore.get("totalExpectedRepayment")
|
||||
- (Float) loanSummaryBefore.get("feeChargesPaid");
|
||||
/* - (Float) loanSummaryBefore.get("feeChargesPaid")*/;
|
||||
HashMap loanSummaryAfter = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
Assert.assertEquals("Verifying Loan Summary after Running Update Loan Summary Scheduler Job", expectedSummaryAfterJob,
|
||||
(Float) loanSummaryAfter.get("totalExpectedRepayment"));
|
||||
@@ -875,6 +892,7 @@ public class SchedulerJobsTestResults {
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
final String fixedDepositProductJSON = fixedDepositProductHelper //
|
||||
// .withAccountingRuleAsCashBased(accounts)
|
||||
.withPeriodRangeChart()//
|
||||
.build(validFrom, validTo);
|
||||
return FixedDepositProductHelper.createFixedDepositProduct(fixedDepositProductJSON, requestSpec, responseSpec);
|
||||
}
|
||||
@@ -887,7 +905,7 @@ public class SchedulerJobsTestResults {
|
||||
//
|
||||
.withSubmittedOnDate(submittedOnDate).withSavings(savingsId).transferInterest(true)
|
||||
.withLockinPeriodFrequency("1", FixedDepositAccountHelper.DAYS)
|
||||
.build(clientID, productID, validFrom, validTo, penalInterestType);
|
||||
.build(clientID, productID, penalInterestType);
|
||||
return fixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
+169
@@ -0,0 +1,169 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.fineract.integrationtests.common.CalendarHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||
import org.apache.fineract.integrationtests.common.GroupHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
import com.jayway.restassured.specification.ResponseSpecification;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
@SuppressWarnings({ "static-access", "rawtypes", "unchecked", "deprecation" })
|
||||
public class SkipRepaymentOnMonthFirstTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||
private LoanTransactionHelper loanTransactionHelper;
|
||||
private CalendarHelper calendarHelper;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization",
|
||||
"Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSkippingRepaymentOnFirstDayOfMonth() {
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
// Retrieving All Global Configuration details
|
||||
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper
|
||||
.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
||||
Assert.assertNotNull(globalConfig);
|
||||
|
||||
String configName = "skip-repayment-on-first-day-of-month";
|
||||
boolean newBooleanValue = true;
|
||||
|
||||
for (Integer configIndex = 0; configIndex < (globalConfig.size()); configIndex++) {
|
||||
if (globalConfig.get(configIndex).get("name").equals(configName)) {
|
||||
String configId = (globalConfig.get(configIndex).get("id")).toString();
|
||||
Integer updateConfigId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(
|
||||
this.requestSpec, this.responseSpec, configId.toString(), newBooleanValue);
|
||||
Assert.assertNotNull(updateConfigId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkRepaymentSkipOnFirstDayOfMonth() {
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Integer groupID = GroupHelper.createGroup(this.requestSpec, this.responseSpec, true);
|
||||
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(),
|
||||
clientID.toString());
|
||||
final String startDate = "15 September 2011";
|
||||
final String frequency = "3"; // Monthly
|
||||
final String interval = "1"; //Every One Moth
|
||||
Integer calendarID = calendarHelper.createMeetingForGroup(requestSpec, responseSpec, groupID, startDate, frequency,
|
||||
interval, null);
|
||||
System.out.println("caladerId --------------------" + calendarID);
|
||||
final Integer loanProductID = createLoanProduct();
|
||||
final Integer loanID = applyForLoanApplication(groupID, loanProductID, calendarID, clientID);
|
||||
System.out.println("loanID----" + loanID);
|
||||
final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
verifyLoanRepaymentSchedule(loanSchedule);
|
||||
|
||||
}
|
||||
|
||||
private Integer createLoanProduct() {
|
||||
System.out.println(
|
||||
"------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
|
||||
final String loanProductJSON = new LoanProductTestBuilder() //
|
||||
.withPrincipal("12,000.00") //
|
||||
.withNumberOfRepayments("4") //
|
||||
.withRepaymentAfterEvery("1") //
|
||||
.withRepaymentTypeAsMonth() //
|
||||
.withinterestRatePerPeriod("1") //
|
||||
.withInterestRateFrequencyTypeAsMonths() //
|
||||
.withAmortizationTypeAsEqualInstallments() //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.build(null);
|
||||
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
|
||||
}
|
||||
|
||||
private Integer applyForLoanApplication(final Integer groupID, final Integer loanProductID, Integer calendarID,
|
||||
Integer clientID) {
|
||||
System.out.println(
|
||||
"--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
|
||||
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
|
||||
.withPrincipal("12,000.00") //
|
||||
.withLoanTermFrequency("4") //
|
||||
.withLoanTermFrequencyAsMonths() //
|
||||
.withNumberOfRepayments("4") //
|
||||
.withRepaymentEveryAfter("1") //
|
||||
.withRepaymentFrequencyTypeAsMonths() //
|
||||
.withInterestRatePerPeriod("2") //
|
||||
.withAmortizationTypeAsEqualInstallments() //
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withInterestCalculationPeriodTypeSameAsRepaymentPeriod() //
|
||||
.withExpectedDisbursementDate("01 October 2011") //
|
||||
.withCalendarID(calendarID.toString()) //
|
||||
.withSubmittedOnDate("01 October 2011") //
|
||||
.withLoanType("jlg").build(clientID.toString(), groupID.toString(), loanProductID.toString(), null);
|
||||
System.out.println(loanApplicationJSON);
|
||||
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
|
||||
}
|
||||
|
||||
private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
|
||||
System.out.println("--------------------VERIFYING THE REPAYMENT DATE--------------------------");
|
||||
assertEquals("Checking for Repayment Date for 1st Month", new ArrayList<>(Arrays.asList(2011, 10, 15)),
|
||||
loanSchedule.get(1).get("dueDate"));
|
||||
System.out.println("Repayment Date for 1st Month--" + loanSchedule.get(1).get("dueDate"));
|
||||
|
||||
assertEquals("Checking for Repayment Date for 2nd Month", new ArrayList<>(Arrays.asList(2011, 11, 15)),
|
||||
loanSchedule.get(2).get("dueDate"));
|
||||
System.out.println("Repayment Date for 2nd Month--" + loanSchedule.get(2).get("dueDate"));
|
||||
|
||||
assertEquals("Checking for Repayment Date for 3rd Month", new ArrayList<>(Arrays.asList(2011, 12, 15)),
|
||||
loanSchedule.get(3).get("dueDate"));
|
||||
System.out.println("Repayment Date for 3rd Month--" + loanSchedule.get(3).get("dueDate"));
|
||||
|
||||
assertEquals("Checking for Repayment Date for 4th Month", new ArrayList<>(Arrays.asList(2012, 1, 15)),
|
||||
loanSchedule.get(4).get("dueDate"));
|
||||
System.out.println("Repayment Date for 4th Month--" + loanSchedule.get(4).get("dueDate"));
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user