Return 400 for invalid instance registration payloads#5125
Return 400 for invalid instance registration payloads#5125amacharla15 wants to merge 2 commits intocodecentric:masterfrom
Conversation
|
Hi @amacharla15, thanks for your PR! I very much like that you have provided backend tests. I have got some questions, though:
|
|
Hi @SteKoe — Apologies and thanks for the review and the questions. Purpose of the frontend test Purpose of mappings.json Why I didn’t use spring-boot-starter-validation + @Valid/@notblank Additionally, I will rebase the branch onto the current codecentric:master so the PR is no longer out-of-date and CI can run cleanly. |
Summary:
Map invalid /instances registration payloads to 400 BAD_REQUEST instead of surfacing as 500.
Add integration tests covering invalid JSON, missing name, and missing healthUrl.
How to run:
./mvnw -pl spring-boot-admin-server -Dtest=InstancesControllerIntegrationTest test
Evidence:
Before: invalid registration could surface as 500.
Now: tests fail if invalid payloads don’t return 400.