feat(search): reject invalid dir parameter with 400

Previously any value other than ASC/DESC silently defaulted to
DESC with no feedback. Now returns 400 Bad Request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-06 16:34:38 +02:00
parent 6ac3f6b176
commit 1c1ab0c72a
2 changed files with 12 additions and 0 deletions

View File

@@ -84,6 +84,13 @@ class DocumentControllerTest {
.andExpect(status().isBadRequest());
}
@Test
@WithMockUser
void search_withInvalidDir_returns400() throws Exception {
mockMvc.perform(get("/api/documents/search").param("dir", "INVALID"))
.andExpect(status().isBadRequest());
}
@Test
@WithMockUser
void search_withInvalidSort_returns400() throws Exception {