Repository navigation
Description
The suite is strong where the library has rules (paging, JSON shapes, failures, configuration) and thin where it has promises. Four paths a regression would reach a caller through have no test, and for the first one the fixtures already hold the data.
1. The Czech text is in the fixtures and asserted nowhere
live/pending-incoming.json carries "unstructured": "Okamžitá platba" and live/booked.json carries "OKAMŽITÁ ÚHRADA", and no test compares either. MonetaClientTest.aPendingMovementHasOnlyTheDateItWasEntered reads that fixture and checks status, amount and dates only.
get() decodes with BodyHandlers.ofString(), which takes the charset from Content-Type and falls back to UTF-8. A charset added in the test server's respond(), or sent by MONETA, would mojibake every name and message and the suite would stay green. This is the one I would close first: it needs no new fixture.
-
assertEquals("Okamžitá platba", pending.message())in that test - the same for a booked movement,
OKAMŽITÁ ÚHRADAinmessage()or inraw()
2. AccountHolder's delegates
Only transactions(), tokenExpiry() and the new account() (#72) are called by a test. transactions(String), balance(), balance(String) and accounts() have no caller at all, so a copy-paste slip such as balance(String accountId) calling onlyAccountId() would pass, and the three exceptions balance() documents are never exercised.
-
me.balance("acc-2")asks for/acc-2/balance -
me.balance()on a two-account token isIllegalStateException -
me.accounts()andme.transactions("acc-2")reach the paths they name
3. Kotlin nullability of account(iban)
testing/kotlin/src/test/kotlin/example/kotlin/KotlinCallerTest.kt exists to pin JSpecify for Kotlin callers, and usage.md shows me.account(storedIban) ?: return refuse(). The new @Nullable return is unpinned, so a dropped annotation would compile for Java and only bite a Kotlin caller.
-
me.account("…") ?: …compiles -
me.account("…").iddoes not
4. Method.OTHER and reversed()
llms.txt tells callers that Transaction.Method gains constants and to keep a default branch. Nothing tests that the library itself keeps that promise: an unknown clearingSystemReference mapping to OTHER in TransactionJson.method() is untested. reversalIndicator: true is never exercised either; reversed() is only ever asserted false.
- a movement with an unknown
clearingSystemReferenceisOTHERand the code stays inraw() -
reversalIndicator: truegivesreversed()
When the edges matter
- The IBAN lookup (be: find a token's account by its iban, so a caller with several accounts needs no moneta id #72):
nullthrows, and a dash does not match whileusage.mdsays it does not. If a mod-97 check lands, a typo is refused rather than read as revoked. Money:negate()is public and untested, andCurrency.getInstance("XXX")hasgetDefaultFractionDigits() == -1, which is theMath.max(…, 0)branch in the compact constructor.balance()on a two-account token throwsIllegalStateException, mirroringaQueryWithoutAnAccountRefusesATokenWithTwo.
Not doing
- A concurrency stress test for the "thread-safe" promise. There is no shared mutable state beyond one volatile field, so it would guard a future regression rather than find a bug now.
- Coverage chasing. The build has no JaCoCo or Kover, so this list came from reading the code. If the question should be answered mechanically next time, adding Kover to
build.gradle.ktsis cheaper than more tests.
Done when
- the four above are in, each failing on the code before it
- the edge list is either written or dropped with a line saying why
Activity