From 8f3c799b8f933a5c32b9649b4ebc0bd7f525ced2 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 28 May 2026 11:38:48 +0200 Subject: [PATCH] test(relationship): reset family_member flag in setFamilyMember network test addRelationship now auto-flips family_member=true on both endpoints for PARENT_OF/SPOUSE_OF/SIBLING_OF (commit 07300aef). That side-effect breaks the pre-condition assertion in setFamilyMember_true_makes_person_appear_in_network, which expects charlie not to appear in the network before the explicit flip. Reset charlie's flag after addRelationship so the test still exercises the setFamilyMember(true) -> network presence path it was written for. Co-Authored-By: Claude Opus 4.7 --- .../relationship/RelationshipServiceIntegrationTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/test/java/org/raddatz/familienarchiv/person/relationship/RelationshipServiceIntegrationTest.java b/backend/src/test/java/org/raddatz/familienarchiv/person/relationship/RelationshipServiceIntegrationTest.java index a2d4a5f2..acbb3825 100644 --- a/backend/src/test/java/org/raddatz/familienarchiv/person/relationship/RelationshipServiceIntegrationTest.java +++ b/backend/src/test/java/org/raddatz/familienarchiv/person/relationship/RelationshipServiceIntegrationTest.java @@ -144,10 +144,12 @@ class RelationshipServiceIntegrationTest { @Test void setFamilyMember_true_makes_person_appear_in_network() { - // charlie starts with familyMember = false. Add a PARENT_OF edge alice→charlie - // so the edge exists, then flip charlie's flag and verify he appears in nodes. + // addRelationship side-effects family_member=true on both endpoints for family-graph + // edges (PARENT_OF/SPOUSE_OF/SIBLING_OF). Reset charlie so the explicit + // setFamilyMember(true) call below is the thing under test, not the auto-flip. relationshipService.addRelationship(alice.getId(), new CreateRelationshipRequest(charlie.getId(), RelationType.PARENT_OF, null, null, null)); + relationshipService.setFamilyMember(charlie.getId(), false); NetworkDTO before = relationshipService.getFamilyNetwork(); assertThat(before.nodes()).extracting("id").doesNotContain(charlie.getId());