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

@@ -195,6 +195,25 @@ class TransactionEndpoints {
result.expectStatus().isEqualTo(CREATED)
}
@Test
fun `deposit - fail same account`() {
// given
val request = Transfer.Request(
account = UUID.fromString("00000000-0000-7000-0000-000000000001"),
receiver = UUID.fromString("00000000-0000-7000-0000-000000000001"),
amount = BigDecimal.valueOf(1.00),
)
// when
val result = webClient.post()
.uri("/transfer")
.bodyValue(request)
.exchange()
// then
result.expectStatus().isEqualTo(BAD_REQUEST)
}
@Test
fun `deposit - fail amount to small`() {
// given