test(geschichte): GeschichteControllerTest — list_passesStatusDraftFilterToService #809
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Identified during review of #794 (annotate GET /api/geschichten OpenAPI params). The three parameter-routing tests added in #794 cover
documentId,limit, andPUBLISHEDstatus, but the DRAFT routing path at the controller layer has no pin.What needs to be done
Add a
@WebMvcTesttest toGeschichteControllerTestmirroring the pattern oflist_passesStatusFilterToServiceadded in #794, usingDRAFTinstead ofPUBLISHED:Note: the controller is neutral — it passes whatever
statusthe caller sends straight through to the service. The access-control override lives in the service layer (covered by #795). This test pins only the controller routing behaviour.Acceptance Criteria
GeschichteControllerTestcontainslist_passesStatusDraftFilterToService@WithMockUser(authorities = "READ_ALL")(noBLOG_WRITEneeded for the list endpoint)eq(GeschichteStatus.DRAFT)to pin the DRAFT path,any()/anyInt()for the restWhy this matters
Pins the DRAFT routing path at the controller layer. Without this, the DRAFT branch of the
statusparameter has no controller-level coverage — any accidental param rename or mapping change would go undetected.