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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user