From 76b4e3166d0c09a6dce4bae8fc354be9dff625fc Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Sun, 30 Jun 2024 09:30:01 +0200 Subject: [PATCH] docs: known bugs --- spec/Bugs.md | 46 +++++++++++++++++++ spec/Requirements.md | 2 +- .../AccountsResourceTest.java} | 4 +- 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 spec/Bugs.md rename src/test/java/ch/postfinance/swiss/hacks/{service/CustomerApiTest.java => resource/AccountsResourceTest.java} (97%) diff --git a/spec/Bugs.md b/spec/Bugs.md new file mode 100644 index 0000000..00c18e7 --- /dev/null +++ b/spec/Bugs.md @@ -0,0 +1,46 @@ +# List of Bugs + +## Known Bugs + +These bugs have already been in the application/code since the beginning of the challenge. They should probably be well +known by now. + +- [Wrong Response Code](#wrong-response-code) +- [Accounts cannot be deleted](#accounts-cannot-be-deleted) +- [Invalid Registration Validation](#invalid-registration-validation) + +### Wrong Response Code + +This bug is related to any endpoint specifying a success response code other than HTTP 200 ( +see [`openapi.yml`](../src/main/resources/openapi/openapi.yml)). + +**Current (falsy) behavior**: The endpoint does always return an HTTP 200 response code. + +**Expected (true) behavior**: The endpoint returns the specified success response code. + +This bug has also been depicted in +the [`AccountsResourceTest`](../src/test/java/ch/postfinance/swiss/hacks/resource/AccountsResourceTest.java). + +### Accounts cannot be deleted + +This bug is related to "User Story 5: Delete account" and the `DELETE /accounts/{iban}` endpoint. + +**Current (falsy) behavior**: When I delete an account and transfer the remaining money to another one, the deleted +account vanishes. + +**Expected (true) behavior**: The remaining money will be added to the transfer account, but the original account will +_not_ be deleted. + +Basically, with this bug, you can stack your money endlessly. + +### Invalid Registration Validation + +This bug is related to "User Story 1: Customer Registration" and the `POST /customers/register` endpoint. + +**Current (falsy) behavior**: The backend does not validate the inputs from the API, it just suspects that all +parameters are present. That results in an internal server error and an HTTP 500 response code, if one is not present. + +**Expected (true) behavior**: Invalid input results in an HTTP 400 response code. + +There has been a `TODO` in the [`LoginService`](../src/main/java/ch/postfinance/swiss/hacks/service/LoginService.java) +that stated out the missing implementation. diff --git a/spec/Requirements.md b/spec/Requirements.md index ec6c045..360c5b3 100644 --- a/spec/Requirements.md +++ b/spec/Requirements.md @@ -36,7 +36,7 @@ As a customer, I want to be able to add a new account, so I can have accounts fo - **And** open a new account - **Then** A new account with 0 balance will be related to my login -## TODO: User Story 5: Delete account +## User Story 5: Delete account As a customer, I want to be able to delete any of my accounts, so I can keep a purposeful portfolio. ### Scenario: diff --git a/src/test/java/ch/postfinance/swiss/hacks/service/CustomerApiTest.java b/src/test/java/ch/postfinance/swiss/hacks/resource/AccountsResourceTest.java similarity index 97% rename from src/test/java/ch/postfinance/swiss/hacks/service/CustomerApiTest.java rename to src/test/java/ch/postfinance/swiss/hacks/resource/AccountsResourceTest.java index 48b5627..7bbe6a4 100644 --- a/src/test/java/ch/postfinance/swiss/hacks/service/CustomerApiTest.java +++ b/src/test/java/ch/postfinance/swiss/hacks/resource/AccountsResourceTest.java @@ -1,4 +1,4 @@ -package ch.postfinance.swiss.hacks.service; +package ch.postfinance.swiss.hacks.resource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; @@ -11,7 +11,7 @@ import static org.hamcrest.Matchers.notNullValue; @QuarkusTest -public class CustomerApiTest { +public class AccountsResourceTest { @Test public void testSuccessfulRegistration() {