diff --git a/tests/jmeter/digifi-BankToProductCore.jmx b/tests/jmeter/digifi-BankToProductCore.jmx new file mode 100644 index 0000000..6722498 --- /dev/null +++ b/tests/jmeter/digifi-BankToProductCore.jmx @@ -0,0 +1,651 @@ + + + + + true + + + + baseUrl + http://localhost:4500 + = + + + username + user + = + + + password + password + = + + + + false + false + + + + 1 + 1 + true + stopthread + + 1 + false + + + + + localhost + 4500 + http + /Authorize + true + POST + true + true + + + + false + { + "username":"${username}", + "password":"${password}" +} + = + + + + + + + + + Content-Type + application/json + + + Accept + application/json + + + + + + access_token + $.data.access_token + 1 + NOT_FOUND + variable + + all + + + + refresh_token + $.data.refresh_token + 1 + NOT_FOUND + variable + + all + + + + true + + + props.put("GLOBAL_ACCESS_TOKEN", vars.get("access_token")); +props.put("GLOBAL_REFRESH_TOKEN", vars.get("refresh_token")); + groovy + + + + + + 200 + + Assertion.response_code + false + 16 + + + + + + false + true + false + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + 1 + 1 + true + continue + + 1 + false + + + + + localhost + 4500 + http + /AuthorizeRefresh + true + POST + true + true + + + + false + { + +} + + = + + + + + + + + + Content-Type + application/json + + + Accept + application/json + + + Authorization + Bearer ${__P(GLOBAL_REFRESH_TOKEN)} + + + + + + + + 200 + + Assertion.response_code + false + 16 + + + + + groovy + + + true + // Generate random IDs and store them in JMeter variables +def transactionId = "TR" + org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric(12) +def customerId = "CN" + org.apache.commons.lang3.RandomUtils.nextInt(1000000, 9999999) +def accountId = "ACN" + org.apache.commons.lang3.RandomUtils.nextInt(1000000, 9999999) +def msisdn = "809" + org.apache.commons.lang3.RandomUtils.nextInt(1000000, 9999999) + +// Generate requestId: current timestamp + 6-digit random number +def timestamp = new Date().format("yyyyMMddHHmmssSSS") // e.g., 20250414161243123 +def randomSuffix = org.apache.commons.lang3.RandomStringUtils.randomNumeric(6) +def requestId = timestamp + randomSuffix + +vars.put("transactionId", transactionId) +vars.put("customerId", customerId.toString()) +vars.put("accountId", accountId.toString()) +vars.put("msisdn", msisdn.toString()) +vars.put("requestId", requestId) + + + + + + localhost + 4500 + http + /EligibilityCheck + true + POST + true + true + + + + false + { + "transactionId":"${transactionId}", + "countryCode":"NGR", + "customerId":"${customerId}", + "msisdn":"${msisdn}", + "channel":"100", + "accountId":"${accountId}" +} + = + + + + + + + + + Content-Type + application/json + + + Accept + application/json + + + Authorization + Bearer ${__P(GLOBAL_ACCESS_TOKEN)} + + + + + + productId + $.eligibleOffers[0].productId + 0 + NOT_FOUND + variable + + + + + + 200 + + Assertion.response_code + false + 16 + + + + + + localhost + 4500 + http + /SelectOffer + true + POST + true + true + + + + false + { + "requestId": "${requestId}", + "transactionId": "${transactionId}", + "customerId":"${customerId}", + "msisdn": "${msisdn}", + "requestedAmount": ${__Random(500000,1000000,)}.00, + "accountId":"${accountId}", + "productId": "${productId}", + "channel": "100" +} + = + + + + + + + + + Content-Type + application/json + + + Accept + application/json + + + Authorization + Bearer ${__P(GLOBAL_ACCESS_TOKEN)} + + + + + + offerId + $.loan[0].offerId + 0 + variable + NOT_FOUND + all + + + + amount + $.loan[0].amount + 0 + 800 + variable + all + + + + + + 200 + + Assertion.response_code + false + 16 + + + + + + localhost + 4500 + http + /ProvideLoan + true + POST + true + true + + + + false + { + "requestId":"${requestId}", + "transactionId":"${transactionId}", + "customerId":"${customerId}", + "accountId":"${accountId}", + "msisdn":"${msisdn}", + "requestedAmount":${amount}, + "collectionType":1, + "offerId":"${offerId}", + "channel":"100" +} + = + + + + + + + + + Content-Type + application/json + + + Accept + application/json + + + Authorization + Bearer ${__P(GLOBAL_ACCESS_TOKEN)} + + + + + + + + 200 + + Assertion.response_code + false + 16 + + + + + + localhost + 4500 + http + /LoanStatus + true + POST + true + true + + + + false + { + "transactionId":"${transactionId}", + "customerId":"${customerId}", + "msisdn":"${msisdn}", + "channel":"100", + "accountId":"${accountId}" +} + = + + + + + + + + + Content-Type + application/json + + + Accept + application/json + + + Authorization + Bearer ${__P(GLOBAL_ACCESS_TOKEN)} + + + + + + debtId + $.loans[0].debtId + 0 + 800 + variable + all + + + + + + 200 + + Assertion.response_code + false + 16 + + + + + + localhost + 4500 + http + /Repayment + true + POST + true + true + + + + false + { + "debtId":"${debtId}", + "transactionId":"${transactionId}", + "customerId":"${customerId}", + "msisdn":"${msisdn}", + "channel":"100", + "accountId":"${accountId}", + "productId": "${productId}" +} + = + + + + + + + + + Content-Type + application/json + + + Accept + application/json + + + Authorization + Bearer ${__P(GLOBAL_ACCESS_TOKEN)} + + + + + + + + 200 + + Assertion.response_code + false + 16 + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + false + true + false + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + +