infinity money bug :D

This is here to show a small miss with big problems.

- add missing test to
  - TransactionEndpoints
  - TransactionControllerTest
- update Transfer with validation for sender receiver
- add SenderReceiverValidator
- add SenderReceiver
This commit is contained in:
2025-09-13 19:56:25 +02:00
parent e9bbac8296
commit 4f95265872
5 changed files with 68 additions and 0 deletions

View File

@@ -215,6 +215,24 @@ class TransactionControllerTest {
result.expectStatus().isCreated
}
@Test
fun `transfer fail same accounts`() {
// given
val request = Transfer.Request(uuid, uuid, amount)
every { transactionService.transfer(any(), any(), any()) } returns Mono.empty()
// when
val result = webTestClient.post()
.uri("/transfer")
.contentType(APPLICATION_JSON)
.bodyValue(request)
.exchange()
// then
result.expectStatus().isBadRequest
}
@Test
fun `transfer fail amount to small`() {
// given