diff --git a/.circleci/config.yml b/.circleci/config.yml index 855d79ef..dbf05a77 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,7 +55,7 @@ jobs: name: Build Docker image command: | #Check for PR title Validity - + IMAGE_TAG=$CIRCLE_TAG ./gradlew checkstyleMain ./gradlew clean bootJar diff --git a/src/main/java/org/mifos/connector/ams/interop/AmsCommonService.java b/src/main/java/org/mifos/connector/ams/interop/AmsCommonService.java index 9361ee22..bd2848fa 100644 --- a/src/main/java/org/mifos/connector/ams/interop/AmsCommonService.java +++ b/src/main/java/org/mifos/connector/ams/interop/AmsCommonService.java @@ -76,6 +76,8 @@ public void getExternalAccount(Exchange e) { Map 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))); diff --git a/src/main/java/org/mifos/connector/ams/interop/AmsFinXService.java b/src/main/java/org/mifos/connector/ams/interop/AmsFinXService.java index ad5f6a40..57e22819 100644 --- a/src/main/java/org/mifos/connector/ams/interop/AmsFinXService.java +++ b/src/main/java/org/mifos/connector/ams/interop/AmsFinXService.java @@ -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; @@ -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 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); diff --git a/src/main/java/org/mifos/connector/ams/interop/InteroperationRouteBuilder.java b/src/main/java/org/mifos/connector/ams/interop/InteroperationRouteBuilder.java index 457c6766..572a68e7 100644 --- a/src/main/java/org/mifos/connector/ams/interop/InteroperationRouteBuilder.java +++ b/src/main/java/org/mifos/connector/ams/interop/InteroperationRouteBuilder.java @@ -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) diff --git a/src/main/resources/application-bb.yml b/src/main/resources/application-bb.yml index fb4c06b4..1592baad 100644 --- a/src/main/resources/application-bb.yml +++ b/src/main/resources/application-bb.yml @@ -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 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 49512284..90b1f643 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -50,6 +50,8 @@ server: contextPath: /fineract port: 7070 + + management: endpoint: health: @@ -58,4 +60,4 @@ management: liveness: enabled: true readiness: - enabled: true \ No newline at end of file + enabled: true