diff options
author | rtkay123 <dev@kanjala.com> | 2025-08-11 17:18:26 +0200 |
---|---|---|
committer | rtkay123 <dev@kanjala.com> | 2025-08-11 17:18:26 +0200 |
commit | 577cb84226b832118677b5338a4e91897117f53a (patch) | |
tree | f497f3a52dac31640ce17888425ca76dd14eeb15 | |
parent | 968f8e837f8e383758d4388a00625982093dd29b (diff) | |
download | warden-577cb84226b832118677b5338a4e91897117f53a.tar.bz2 warden-577cb84226b832118677b5338a4e91897117f53a.zip |
test(integration): http post
-rw-r--r-- | contrib/bruno/environments/warden.bru | 1 | ||||
-rw-r--r-- | contrib/bruno/transaction-monitoring/01 - initiate.bru | 257 | ||||
-rw-r--r-- | contrib/bruno/transaction-monitoring/02 - clear.bru | 164 | ||||
-rw-r--r-- | contrib/bruno/transaction-monitoring/folder.bru | 8 | ||||
-rw-r--r-- | contrib/bruno/transaction-monitoring/health-check.bru (renamed from contrib/bruno/health-check.bru) | 0 |
5 files changed, 430 insertions, 0 deletions
diff --git a/contrib/bruno/environments/warden.bru b/contrib/bruno/environments/warden.bru index d4a366c..a552a15 100644 --- a/contrib/bruno/environments/warden.bru +++ b/contrib/bruno/environments/warden.bru @@ -1,3 +1,4 @@ vars { WARDEN_API_HOST: http://localhost:2210 + WARDEN_VERSION: v0 } diff --git a/contrib/bruno/transaction-monitoring/01 - initiate.bru b/contrib/bruno/transaction-monitoring/01 - initiate.bru new file mode 100644 index 0000000..4dee7a8 --- /dev/null +++ b/contrib/bruno/transaction-monitoring/01 - initiate.bru @@ -0,0 +1,257 @@ +meta { + name: 01 - initiate + type: http + seq: 2 +} + +post { + url: {{WARDEN_API_HOST}}/api/{{WARDEN_VERSION}}/pacs008 + body: json + auth: inherit +} + +body:json { + { + "f_i_to_f_i_cstmr_cdt_trf": { + "grp_hdr": { + "msg_id": "{{PACS008_MSG_ID}}", + "cre_dt_tm": "{{PACS008_CRE_DT_TM}}", + "nb_of_txs": "CLRG", + "sttlm_inf": { + "sttlm_mtd": 1 + } + }, + "splmtry_data": [], + "cdt_trf_tx_inf": [ + { + "pmt_id": { + "instr_id": "{{PACS008_INSTR_ID}}", + "end_to_end_id": "{{END_TO_END_ID}}" + }, + "intr_bk_sttlm_amt": { + "value": 294.3, + "ccy": "{{CCY}}" + }, + "instd_amt": { + "value": 294.3, + "ccy": "{{CCY}}" + }, + "xchg_rate": 1, + "chrg_br": 1, + "chrgs_inf": [ + { + "amt": { + "value": 0, + "ccy": "{{CCY}}" + }, + "agt": { + "fin_instn_id": { + "clr_sys_mmb_id": { + "mmb_id": "{{DEBTOR_FSP}}" + } + } + } + } + ], + "initg_pty": { + "nm": "April Blake Grant", + "id": { + "org_id": { + "othr": [] + }, + "prvt_id": { + "dt_and_plc_of_birth": { + "birth_dt": "1968-02-01", + "city_of_birth": "Unknown", + "ctry_of_birth": "ZZ" + }, + "othr": [ + { + "id": "+27730975224", + "schme_nm": { + "prtry": "MSISDN", + "cd": "cd-value" + } + } + ] + } + }, + "ctct_dtls": { + "mob_nb": "+27-730975224", + "othr": [] + } + }, + "dbtr": { + "nm": "April Blake Grant", + "id": { + "org_id": { + "othr": [] + }, + "prvt_id": { + "dt_and_plc_of_birth": { + "birth_dt": "2000-07-23", + "city_of_birth": "Unknown", + "ctry_of_birth": "ZZ" + }, + "othr": [ + { + "id": "{{DEBTOR_ID}}", + "schme_nm": { + "prtry": "EID", + "cd": "cd-value" + } + } + ] + } + }, + "ctct_dtls": { + "mob_nb": "+27-730975224", + "othr": [] + } + }, + "dbtr_acct": { + "id": { + "i_b_a_n": "value", + "othr": { + "id": "{{DEBTOR_ACCT_ID}}", + "schme_nm": { + "prtry": "MSISDN", + "cd": "value" + } + } + }, + "nm": "April Grant" + }, + "dbtr_agt": { + "fin_instn_id": { + "clr_sys_mmb_id": { + "mmb_id": "{{DEBTOR_FSP}}" + } + } + }, + "cdtr_agt": { + "fin_instn_id": { + "clr_sys_mmb_id": { + "mmb_id": "{{CREDITOR_FSP}}" + } + } + }, + "cdtr": { + "nm": "Felicia Easton Quill", + "id": { + "org_id": { + "othr": [] + }, + "prvt_id": { + "dt_and_plc_of_birth": { + "birth_dt": "1935-05-08", + "city_of_birth": "Unknown", + "ctry_of_birth": "ZZ" + }, + "othr": [ + { + "id": "{{CREDITOR_ID}}", + "schme_nm": { + "prtry": "EID", + "cd": "" + } + } + ] + } + }, + "ctct_dtls": { + "mob_nb": "+27-707650428", + "othr": [] + } + }, + "cdtr_acct": { + "id": { + "i_b_a_n": "", + "othr": { + "id": "{{CREDITOR_ACCT_ID}}", + "schme_nm": { + "prtry": "MSISDN", + "cd": "acc" + } + } + }, + "nm": "Felicia Quill" + }, + "purp": { + "cd": "MP2P", + "prtry": "" + }, + "rgltry_rptg": [ + { + "dtls": [ + { + "tp": "BALANCE OF PAYMENTS", + "cd": "100", + "inf": [] + } + ] + } + ], + "rmt_inf": { + "ustrd": [], + "strd": [] + }, + "splmtry_data": [ + { + "envlp": { + "doc": { + "xprtn": "2021-11-30T10:38:56.000Z", + "initg_pty": { + "glctn": { + "lat": "-3.1609", + "long": "38.3588" + } + } + } + } + } + ], + "instr_for_cdtr_agt": [], + "instr_for_nxt_agt": [], + "rltd_rmt_inf": [] + } + ] + } + } +} + +assert { + res.status: eq 201 +} + +script:pre-request { + const { nanoid } = require('nanoid'); + + bru.setVar("PACS008_MSG_ID", nanoid()) + bru.setVar("PACS008_CRE_DT_TM", new Date().toISOString()) + + bru.setVar("CREDITOR_FSP", "fsp001") + bru.setVar("DEBTOR_FSP", "fsp002") + + bru.setVar("PACS008_INSTR_ID", nanoid()) + + bru.setVar("END_TO_END_ID", nanoid()) + bru.setVar("CCY", "XTS") + + bru.setVar("DEBTOR_ID", nanoid()) + + bru.setVar("DEBTOR_ACCT_ID", nanoid()) + + bru.setVar("CREDITOR_ID", nanoid()) + + bru.setVar("CREDITOR_ACCT_ID", nanoid()) + +} + +script:post-response { + bru.deleteVar("PACS008_CRE_DT_TM") +} + +settings { + encodeUrl: true +} diff --git a/contrib/bruno/transaction-monitoring/02 - clear.bru b/contrib/bruno/transaction-monitoring/02 - clear.bru new file mode 100644 index 0000000..d850f27 --- /dev/null +++ b/contrib/bruno/transaction-monitoring/02 - clear.bru @@ -0,0 +1,164 @@ +meta { + name: 02 - clear + type: http + seq: 3 +} + +post { + url: {{WARDEN_API_HOST}}/api/{{WARDEN_VERSION}}/pacs002 + body: json + auth: inherit +} + +body:json { + { + "f_i_to_f_i_pmt_sts_rpt": { + "grp_hdr": { + "msg_id": "{{PACS002_MSG_ID}}", + "cre_dt_tm": "{{PACS002_CRE_DT_TM}}" + }, + "orgnl_grp_inf_and_sts": [ + { + "grp_sts": "ACCC", + "nb_of_txs_per_sts": [ + { + "dtld_ctrl_sum": 1, + "dtld_nb_of_txs": "1", + "dtld_sts": "ACCC" + } + ], + "orgnl_cre_dt_tm": null, + "orgnl_ctrl_sum": 2, + "orgnl_msg_id": "ce569868c865-4986-94ac-906e46022617", + "orgnl_msg_nm_id": "pacs.008.001.10", + "orgnl_nb_of_txs": "1", + "sts_rsn_inf": [ + { + "addtl_inf": [ + "Transaction accepted and settled" + ], + "orgtr": null, + "rsn": null + } + ] + } + ], + "splmtry_data": [], + "tx_inf_and_sts": [ + { + "orgnl_instr_id": "{{PACS008_INSTR_ID}}", + "orgnl_end_to_end_id": "{{END_TO_END_ID}}", + "tx_sts": "ACCC", + "sts_rsn_inf": [ + { + "addtl_inf": [ + "Transaction processed successfully" + ], + "orgtr": null, + "rsn": null + } + ], + "splmtry_data": [], + "chrgs_inf": [ + { + "amt": { + "value": 0, + "ccy": "{{CCY}}" + }, + "agt": { + "fin_instn_id": { + "clr_sys_mmb_id": { + "mmb_id": "{{DEBTOR_FSP}}" + }, + "b_i_c_f_i": "BANKXXX", + "l_e_i": "1234567890", + "nm": "Bank" + } + } + }, + { + "amt": { + "value": 0, + "ccy": "{{CCY}}" + }, + "agt": { + "fin_instn_id": { + "clr_sys_mmb_id": { + "mmb_id": "{{DEBTOR_FSP}}" + } + } + } + }, + { + "amt": { + "value": 0, + "ccy": "{{CCY}}" + }, + "agt": { + "fin_instn_id": { + "clr_sys_mmb_id": { + "mmb_id": "{{CREDITOR_FSP}}" + } + } + } + } + ], + "accptnc_dt_tm": "2023-06-02T07:52:31.000Z", + "instg_agt": { + "fin_instn_id": { + "clr_sys_mmb_id": { + "mmb_id": "{{DEBTOR_FSP}}" + } + } + }, + "instd_agt": { + "fin_instn_id": { + "clr_sys_mmb_id": { + "mmb_id": "{{CREDITOR_FSP}}" + } + } + } + } + ] + } + } +} + +assert { + res.status: eq 201 +} + +script:pre-request { + const { nanoid } = require('nanoid'); + + bru.setVar("PACS002_MSG_ID", nanoid()) + bru.setVar("PACS002_CRE_DT_TM", new Date().toISOString()) +} + +script:post-response { + bru.deleteVar("PACS008_MSG_ID") + + bru.deleteVar("CREDITOR_FSP") + bru.deleteVar("DEBTOR_FSP") + bru.deleteVar("PACS008_INSTR_ID") + + bru.deleteVar("END_TO_END_ID") + bru.deleteVar("CCY") + + bru.deleteVar("DEBTOR_ID") + + bru.deleteVar("DEBTOR_ACCT_ID") + + bru.deleteVar("CREDITOR_ID") + + bru.deleteVar("CREDITOR_ACCT_ID") + bru.deleteVar("PACS002_MSG_ID") + bru.deleteVar("PACS002_CRE_DT_TM") + + + +} + +settings { + encodeUrl: true +} diff --git a/contrib/bruno/transaction-monitoring/folder.bru b/contrib/bruno/transaction-monitoring/folder.bru new file mode 100644 index 0000000..ca6f740 --- /dev/null +++ b/contrib/bruno/transaction-monitoring/folder.bru @@ -0,0 +1,8 @@ +meta { + name: transaction-monitoring + seq: 2 +} + +auth { + mode: inherit +} diff --git a/contrib/bruno/health-check.bru b/contrib/bruno/transaction-monitoring/health-check.bru index 0ef5178..0ef5178 100644 --- a/contrib/bruno/health-check.bru +++ b/contrib/bruno/transaction-monitoring/health-check.bru |