Software Testing Engineering / API & CONTRACT TESTING / TST-022

Provider Fault Matrix

Explore concept graph

Latihan soal

Run real HTTP fault fixture

Dengan Node 24 dari repository root:

node generation/fixtures/TST-022/provider-fault-matrix.mjs

Expected output:

wire-cases=11
success=1;rejected=1;retryable=3;unknown=6
timeout-and-reset=remote-may-have-applied
blind-debit-retries=0
target=local-node-fault-stub-not-wiremock

Node HTTP server menjalankan sebelas fault di 127.0.0.1 dengan port ephemeral. Pada timeout dan reset, stub mencatat efek debit sebelum respons hilang, sedangkan caller tetap UNKNOWN. Semua skenario memiliki satu request; tidak ada retry otomatis.

Batas bukti: simulasi memakai Node native, bukan WireMock process. Tidak ada API bank eksternal, database, Spring MVC, JWT, ledger atau pembayaran sungguhan.

Konsep 1 / 3

Differentiate accepted and explicitly rejected debits from malformed provider success and rejection bodies.

Coba prediksi atau perbaiki

Would 200 without providerReference be a successful settlement?

Kalau jawabanmu berbeda

Kesalahan yang mungkin: Treating all 200 results as settled payments.

Mengapa tidak bekerja: Acceptance status and ledger settlement are distinct business events.

Coba perbaiki: Validate the provider response and preserve explicit acceptance-only wording.

Periksa hasil sendiri

Hasil yang diharapkan: Valid 200 maps SUCCESS, valid 400 maps REJECTED, inconsistent body maps UNKNOWN.

Kalau berbeda: Recheck exact JSON properties and value types.

Konsep 2 / 3

Treat 429 and 503 as temporary provider conditions without automatically resending debit.

Coba prediksi atau perbaiki

May a client repeat the same debit automatically after a 503 Retry-After timer?

Kalau jawabanmu berbeda

Kesalahan yang mungkin: Treating a RETRYABLE label as an automatic retry instruction.

Mengapa tidak bekerja: Duplicate financial writes may occur absent a proved idempotency contract.

Coba perbaiki: Separate transport classification from an explicitly gated replay operation.

Periksa hasil sendiri

Hasil yang diharapkan: 429/503 classified as transient, with one POST per scenario.

Kalau berbeda: Inspect the client for hidden fetch loops.

Konsep 3 / 3

Classify timeout, socket reset and malformed JSON as UNKNOWN while guarding against duplicate debit.

Coba prediksi atau perbaiki

Does a timeout prove the bank rejected a debit?

Kalau jawabanmu berbeda

Kesalahan yang mungkin: Assuming network failure means rejected payment.

Mengapa tidak bekerja: Work may have been committed on the remote side before the connection failed.

Coba perbaiki: Record UNKNOWN and reconcile with provider status before any future action.

Periksa hasil sendiri

Hasil yang diharapkan: Both simulated applied timeout and reset remain UNKNOWN at the caller.

Kalau berbeda: Inspect whether the stub applied before losing the response.

Lima soal Provider Fault Matrix

Jawab tanpa melihat pembahasan dulu. Kamu bisa memperbaiki jawaban dan mencoba lagi. Kuis ini latihan mandiri dan tidak menyimpan skor atau progres.

HTTP 200 dengan amount JSON number padahal kontrak mensyaratkan decimal string menghasilkan?
HTTP 400 dengan result REJECTED dan code INVALID_ACCOUNT dikenal menghasilkan?
HTTP 429 Retry-After: 3 artinya untuk debit?
Remote stub menerapkan debit lalu reset socket sebelum balasan. Caller seharusnya?
Apa batas bukti sebelas skenario local HTTP?