Arya Bank payments API — test results

Fictional bank, synthetic data. Java (RestAssured + JUnit 5) suite run against a FastAPI + SQLite payments API, once clean and once per planted bug. Updated 14 Oct 2026, 01:17 UTC.

Clean build
77/77
all tests pass
Planted bugs caught
7/7
none escaped
Release candidate (all bugs on)
35
of 77 tests fail
Load test (k6)
1221 requests, p95 5 ms, 0.00% errors, money conserved

Planted bugs

Each run starts a fresh API with exactly one bug switched on. A bug counts as caught when at least one test fails.

BugDefectResult / layerTests that caught it
BUG-01Idempotency key ignored
A retried payment (same Idempotency-Key) debits the customer twice.
caught
BDD, API, DB, Concurrency
6 failing
  • API Retry with the same key returns the original transfer and debits once
  • BDD A key can't be reused for a different payment
  • BDD A retried payment is charged once
  • DB A retried request leaves exactly one transfer row in the database
  • Concurrency 10 parallel retries with one key create exactly one transfer
  • API Same key with a different amount is rejected with 409 and nothing moves
BUG-02Funds check compares whole rupees only
Balance 500.50 can send 500.90; the account goes negative.
caught
BDD, API, DB
7 failing
  • BDD A transfer the payer can't afford is rejected and nothing moves [500.50, 500.51]
  • API Insufficient funds is rejected at the paisa boundary and no money moves balance 500.50, send 500.90 → 422 INSUFFICIENT_FUNDS
  • BDD A transfer the payer can't afford is rejected and nothing moves [0.00, 0.01]
  • DB No customer account is negative
  • API Insufficient funds is rejected at the paisa boundary and no money moves balance 0.00, send 0.01 → 422 INSUFFICIENT_FUNDS
  • API Insufficient funds is rejected at the paisa boundary and no money moves balance 500.50, send 500.51 → 422 INSUFFICIENT_FUNDS
  • … and 1 more
BUG-03Negative amounts accepted
A transfer of -100.00 pulls money from the receiver.
caught
BDD, API, DB
6 failing
  • API Invalid opening balances are rejected with 422 INVALID_AMOUNT opening_balance "-5.00" is rejected
  • DB No customer account is negative
  • DB No ledger entry has a zero or negative amount
  • BDD Invalid amounts are rejected [-100.00]
  • API Invalid amounts are rejected and no money moves amount "-100.00" → 422 INVALID_AMOUNT, no money moves
  • API Invalid amounts are rejected and no money moves amount "-0.01" → 422 INVALID_AMOUNT, no money moves
BUG-04Transfer can be refunded twice
Sender gets the money back twice.
caught
BDD, API
2 failing
  • API A transfer cannot be refunded twice
  • BDD A transfer can't be refunded twice
BUG-05Refund never debits the receiver
Refund creates money; the double-entry ledger no longer balances.
caught
BDD, API, DB
9 failing
  • DB Money is conserved: all balances (incl. the funding account) sum to 0.00
  • BDD A day of payments and a refund leaves the books balanced
  • DB Refund does not create money: payer + payee total is unchanged
  • DB Every transaction's debits equal its credits
  • BDD A refund returns the money to the payer
  • DB Refund writes a balanced DEBIT (receiver) and CREDIT (payer) in the ledger
  • … and 3 more
BUG-06Contract drift on account balance
balance returned as a JSON number (1000.5) instead of a string ("1000.50").
caught
API, Contract
4 failing
  • Contract verify(PactVerificationContext) arya-mobile-app - a request for an existing account
  • API Opening an account returns 201 with id, balance, INR and ACTIVE
  • API Balance is always a string with exactly two decimals
  • API GET /accounts/{id} returns what was opened
BUG-07Lost update under concurrent transfers
Balance is read outside the transaction and written back; parallel payments overwrite each other.
caught
BDD, DB, Concurrency
5 failing
  • DB Every account's stored balance equals credits minus debits in the ledger
  • BDD A day of payments and a refund leaves the books balanced
  • Concurrency 25 parallel transfers of 10.00: every rupee is accounted for
  • Concurrency After parallel transfers the stored balances still match the ledger
  • Concurrency 20 parallel transfers of 10.00 from 100.00: exactly 10 succeed, never negative

Detailed reports

Allure report — clean build · Allure report — release candidate with every bug on

Source on GitHub