Skip to content

feature(COG-1143): W0 smoke suite for deposit, withdraw, between-accounts and recipient transfer - #106

Open
patrickbradley-cog wants to merge 3 commits into
devin/cog-1141-w0-testcontainers-mysql-harness-for-springboottest-boot-154from
devin/cog-1143-w0-smoke-suite-deposit-withdraw-between-accounts-and
Open

patrickbradley-cog wants to merge 3 commits into
devin/cog-1141-w0-testcontainers-mysql-harness-for-springboottest-boot-154from
devin/cog-1143-w0-smoke-suite-deposit-withdraw-between-accounts-and

Conversation

@patrickbradley-cog

@patrickbradley-cog patrickbradley-cog commented Sep 24, 2026 •

Copy link
Copy Markdown

Summary

Regression contract for the Boot 1.5.4 → 4.1 migration (COG-1143): MoneyMovementSmokeTest — MockMvc tests that assert persisted rows, not just HTTP status, for deposit, withdraw, between-accounts, the recipient lifecycle and recipient transfer. They capture today's behaviour rather than improving it. No production code changes.

Stacked on #335 (COG-1141, canonical Testcontainers harness). Base is devin/cog-1141-w0-testcontainers-mysql-harness-for-springboottest-boot-154, so the diff is only this ticket's test file; this PR will be retargeted to master once #335 merges. This PR's earlier private copy of AbstractIntegrationTest and its pom test deps were dropped in the rebase — the test now extends AbstractIntegrationTest and uses its protected mockMvc.

Test data isolation (so it can share a JVM with #108 / #109):

  • users are txsmoke-<nanoTime>-<seq> (email …@[REDACTED SECRET].com), recipients txsmoke-payee-<nanoTime>; recipientDao.findByName and balances are therefore never shared with other suites.
  • users are created via UserService.createUser, so account numbers come from the app's own per-JVM counter; no rows are inserted with explicit account numbers (avoids the COG-1179 NonUniqueResultException).

Recipient delete is isolated in one helper so COG-1155 (#339) flips a single line:

/** Delete is a GET today; COG-1155 converts it to a POST. */
private ResultActions deleteRecipient(String recipientName) throws Exception {
    return mockMvc.perform(get("/transfer/recipient/delete")...);   // -> post(...).with(csrf()) after #339
}

Behaviour captured as-is, worth flagging for reviewers:

  • transaction amount is always stored positive; direction is only visible in availableBalance and the description.
  • betweenAccounts writes a ledger row only for the sending account; totals are conserved and the test asserts exactly this asymmetry.
  • recipient save is POST /transfer/recipient/save (the ticket calls it /transfer/addRecipient).

Verification (Temurin 1.8.0_504, Docker 29.7, mvn -B -f UserFront/pom.xml clean verify)

Tests run: 9, Failures: 0, Errors: 0 - in com.userFront.MoneyMovementSmokeTest
Tests run: 1, Failures: 0, Errors: 0 - in com.userFront.UserFrontApplicationTests
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

Cross-suite check with the sibling smoke tests copied in locally (uncommitted):

Link to Devin session: https://app.devin.ai/sessions/dea8a88ff1554e81866df8e43e299765
Open in Devin Desktop: https://app.devin.ai/desktop/session/dea8a88ff1554e81866df8e43e299765?variant=devin
Requested by: @patrickbradley-cog


Devin Review

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration

Copy link
Copy Markdown

Heads-up from COG-1155 (#339): recipient delete is now POST /transfer/recipient/delete. Whichever of #106 / #339 merges second must change recipientLifecycleSavesListsAndDeletes (around line 219–220) as follows:

-		// Delete is a GET today; COG-1155 converts it to a POST and updates this test.
-		mockMvc.perform(get("/transfer/recipient/delete").with(user(username)).param("recipientName", recipientName))
+		// Delete is a POST (COG-1155).
+		mockMvc.perform(post("/transfer/recipient/delete").with(user(username)).param("recipientName", recipientName))

I checked this locally: #106 + #339 + this diff gives MoneyMovementSmokeTest: Tests run: 9, Failures: 0, Errors: 0.

Written by Devin

devin-ai-integration Bot and others added 3 commits September 30, 2026 16:26
…unts and recipient transfer

Adds a Testcontainers-backed AbstractIntegrationTest harness and MockMvc
regression tests asserting persisted balances and ledger rows on Boot 1.5.4.

Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
…ecipient transfer

Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
… isolate recipient delete request

Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/cog-1143-w0-smoke-suite-deposit-withdraw-between-accounts-and branch from 00de947 to 3c92928 Compare September 30, 2026 16:28
@devin-ai-integration
devin-ai-integration Bot changed the base branch from master to devin/cog-1141-w0-testcontainers-mysql-harness-for-springboottest-boot-154 September 30, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant