Skip to content

Commit 49fd0a5

Browse files
[PHEE-588] Fix AMS failing test cases from AMS connector (#62)
* Added logger for the balance API issue * fixed checkstyle errors * Updated the loggers * Reverted the unnscessary changes * Reverted the unnscessary changes * Checking the new log for body * Checking the new log for body * Checking the new log for body * Updated the tenant in bb property * Updated the loggers and tenants
1 parent 4d09ac3 commit 49fd0a5

File tree

6 files changed

+29
-3
lines changed

6 files changed

+29
-3
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
name: Build Docker image
5656
command: |
5757
#Check for PR title Validity
58-
58+
5959
IMAGE_TAG=$CIRCLE_TAG
6060
./gradlew checkstyleMain
6161
./gradlew clean bootJar

src/main/java/org/mifos/connector/ams/interop/AmsCommonService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public void getExternalAccount(Exchange e) {
7676
Map<String, Object> headers = new HashMap<>();
7777
headers.put(CXF_TRACE_HEADER, true);
7878
headers.put(HTTP_METHOD, "GET");
79+
logger.debug(":{}", e.getProperty(PARTY_ID_TYPE, String.class));
80+
logger.debug(":{}", e.getProperty(PARTY_ID, String.class));
7981
headers.put(HTTP_PATH, amsInteropPartiesPath.replace("{idType}", e.getProperty(PARTY_ID_TYPE, String.class)).replace("{idValue}",
8082
e.getProperty(PARTY_ID, String.class)));
8183
headers.putAll(tenantService.getHeaders(e.getProperty(TENANT_ID, String.class)));

src/main/java/org/mifos/connector/ams/interop/AmsFinXService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import org.apache.camel.Exchange;
1414
import org.mifos.connector.ams.camel.cxfrs.CxfrsUtil;
1515
import org.mifos.connector.ams.tenant.TenantService;
16+
import org.slf4j.Logger;
17+
import org.slf4j.LoggerFactory;
1618
import org.springframework.beans.factory.annotation.Autowired;
1719
import org.springframework.beans.factory.annotation.Value;
1820
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
@@ -40,10 +42,14 @@ public class AmsFinXService extends AmsCommonService implements AmsService {
4042
@Autowired
4143
private CxfrsUtil cxfrsUtil;
4244

45+
private Logger logger = LoggerFactory.getLogger(this.getClass());
46+
4347
public void getSavingsAccount(Exchange e) {
4448
Map<String, Object> headers = new HashMap<>();
4549
headers.put(CXF_TRACE_HEADER, true);
4650
headers.put(HTTP_METHOD, "GET");
51+
logger.debug(":{}", amsInteropAccountsPath);
52+
logger.debug(":{}", e.getProperty(EXTERNAL_ACCOUNT_ID, String.class));
4753
headers.put(HTTP_PATH, amsInteropAccountsPath.replace("{externalAccountId}", e.getProperty(EXTERNAL_ACCOUNT_ID, String.class)));
4854
headers.putAll(tenantService.getHeaders(e.getProperty(TENANT_ID, String.class)));
4955
cxfrsUtil.sendInOut("cxfrs:bean:ams.local.interop", e, headers, null);

src/main/java/org/mifos/connector/ams/interop/InteroperationRouteBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public void configure() {
144144
exchange.setProperty(IS_ERROR_SET_MANUALLY, true);
145145
}
146146
}).log("Response body from get-external-account").choice()
147+
147148
// check if http status code is <= 202
148149
.when(e -> e.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE, Integer.class) <= 202).unmarshal()
149150
.json(JsonLibrary.Jackson, PartyFspResponseDTO.class)

src/main/resources/application-bb.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,22 @@ ams:
1414
password: password
1515
authtype: basic
1616
fspId: payerfsp
17-
- name: "lion"
17+
- name: "wakanda"
18+
user: mifos
19+
password: password
20+
authtype: basic
21+
fspId: payerfsp
22+
- name: "venus"
23+
user: mifos
24+
password: password
25+
authtype: basic
26+
fspId: payeefsp
27+
- name: "jupiter"
28+
user: mifos
29+
password: password
30+
authtype: basic
31+
fspId: payeefsp
32+
- name: "pluto"
1833
user: mifos
1934
password: password
2035
authtype: basic

src/main/resources/application.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ server:
5050
contextPath: /fineract
5151
port: 7070
5252

53+
54+
5355
management:
5456
endpoint:
5557
health:
@@ -58,4 +60,4 @@ management:
5860
liveness:
5961
enabled: true
6062
readiness:
61-
enabled: true
63+
enabled: true

0 commit comments

Comments
 (0)