diff --git a/backend/src/test/java/org/raddatz/familienarchiv/relationship/RelationshipControllerTest.java b/backend/src/test/java/org/raddatz/familienarchiv/relationship/RelationshipControllerTest.java index 0036c415..d530c83f 100644 --- a/backend/src/test/java/org/raddatz/familienarchiv/relationship/RelationshipControllerTest.java +++ b/backend/src/test/java/org/raddatz/familienarchiv/relationship/RelationshipControllerTest.java @@ -46,6 +46,18 @@ class RelationshipControllerTest { .andExpect(jsonPath("$.code").value(ErrorCode.RELATIONSHIP_NOT_FOUND.name())); } + @Test + void getRelationships_returns401_whenUnauthenticated() throws Exception { + mockMvc.perform(get("/api/persons/{id}/relationships", PERSON_ID)) + .andExpect(status().isUnauthorized()); + } + + @Test + void getNetwork_returns401_whenUnauthenticated() throws Exception { + mockMvc.perform(get("/api/network")) + .andExpect(status().isUnauthorized()); + } + @Test @WithMockUser(username = "testuser", authorities = {"READ_ALL"}) void addRelationship_returns403_for_user_with_READ_ALL_only() throws Exception {