Skip to content

Commit

Permalink
[PHEE-588] Fix AMS failing test cases from AMS connector (#62)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dhruvsonagara authored Feb 16, 2024
1 parent 4d09ac3 commit 49fd0a5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
name: Build Docker image
command: |
#Check for PR title Validity
IMAGE_TAG=$CIRCLE_TAG
./gradlew checkstyleMain
./gradlew clean bootJar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ public void getExternalAccount(Exchange e) {
Map<String, Object> headers = new HashMap<>();
headers.put(CXF_TRACE_HEADER, true);
headers.put(HTTP_METHOD, "GET");
logger.debug(":{}", e.getProperty(PARTY_ID_TYPE, String.class));
logger.debug(":{}", e.getProperty(PARTY_ID, String.class));
headers.put(HTTP_PATH, amsInteropPartiesPath.replace("{idType}", e.getProperty(PARTY_ID_TYPE, String.class)).replace("{idValue}",
e.getProperty(PARTY_ID, String.class)));
headers.putAll(tenantService.getHeaders(e.getProperty(TENANT_ID, String.class)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import org.apache.camel.Exchange;
import org.mifos.connector.ams.camel.cxfrs.CxfrsUtil;
import org.mifos.connector.ams.tenant.TenantService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
Expand Down Expand Up @@ -40,10 +42,14 @@ public class AmsFinXService extends AmsCommonService implements AmsService {
@Autowired
private CxfrsUtil cxfrsUtil;

private Logger logger = LoggerFactory.getLogger(this.getClass());

public void getSavingsAccount(Exchange e) {
Map<String, Object> headers = new HashMap<>();
headers.put(CXF_TRACE_HEADER, true);
headers.put(HTTP_METHOD, "GET");
logger.debug(":{}", amsInteropAccountsPath);
logger.debug(":{}", e.getProperty(EXTERNAL_ACCOUNT_ID, String.class));
headers.put(HTTP_PATH, amsInteropAccountsPath.replace("{externalAccountId}", e.getProperty(EXTERNAL_ACCOUNT_ID, String.class)));
headers.putAll(tenantService.getHeaders(e.getProperty(TENANT_ID, String.class)));
cxfrsUtil.sendInOut("cxfrs:bean:ams.local.interop", e, headers, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public void configure() {
exchange.setProperty(IS_ERROR_SET_MANUALLY, true);
}
}).log("Response body from get-external-account").choice()

// check if http status code is <= 202
.when(e -> e.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE, Integer.class) <= 202).unmarshal()
.json(JsonLibrary.Jackson, PartyFspResponseDTO.class)
Expand Down
17 changes: 16 additions & 1 deletion src/main/resources/application-bb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,22 @@ ams:
password: password
authtype: basic
fspId: payerfsp
- name: "lion"
- name: "wakanda"
user: mifos
password: password
authtype: basic
fspId: payerfsp
- name: "venus"
user: mifos
password: password
authtype: basic
fspId: payeefsp
- name: "jupiter"
user: mifos
password: password
authtype: basic
fspId: payeefsp
- name: "pluto"
user: mifos
password: password
authtype: basic
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ server:
contextPath: /fineract
port: 7070



management:
endpoint:
health:
Expand All @@ -58,4 +60,4 @@ management:
liveness:
enabled: true
readiness:
enabled: true
enabled: true

0 comments on commit 49fd0a5

Please sign in to comment.