From 6107a5df3361dacc892d3d8d7280091ceae10b91 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Sat, 7 Dec 2024 12:32:01 +0100 Subject: [PATCH] Assigning the new new Partner-Relation to the existing Partner --- .../scenarios/HsOfficeScenarioTests.java | 1 - ...ceDeceasedPartnerWithCommunityOfHeirs.java | 31 +++++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java index fd14b3a6..ff7c261c 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java @@ -600,7 +600,6 @@ class HsOfficeScenarioTests extends ScenarioTest { @Test @Order(6010) @Requires("Partner: P-31011 - Michelle Matthieu") - @Produces("Partner-Relation: Erbengemeinschaft Michelle Matthieu") void shouldReplaceDeceasedPartnerByCommunityOfHeirs() { new ReplaceDeceasedPartnerWithCommunityOfHeirs(scenarioTest) .given("partnerNumber", "P-31011") diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/ReplaceDeceasedPartnerWithCommunityOfHeirs.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/ReplaceDeceasedPartnerWithCommunityOfHeirs.java index bb27e063..92ff7924 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/ReplaceDeceasedPartnerWithCommunityOfHeirs.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/ReplaceDeceasedPartnerWithCommunityOfHeirs.java @@ -63,15 +63,28 @@ public class ReplaceDeceasedPartnerWithCommunityOfHeirs extends UseCase + httpPost("/api/hs/office/relations", usingJsonBody(""" + { + "type": "PARTNER", + "anchor.uuid": ${Person: Hostsharing eG}, + "holder.uuid": ${Person: Erbengemeinschaft %{nameOfDeceasedPerson}}, + "contact.uuid": ${Contact: Erbengemeinschaft %{nameOfDeceasedPerson}} + } + """)) + .expecting(HttpStatus.CREATED).expecting(ContentType.JSON) + ); + + // httpGet("/api/hs/office/debitors/%{partnerNumber}") FIXME + + return withTitle("Assigning the new new Partner-Relation to the existing Partner", () -> + httpPatch("/api/hs/office/partners/%{Partner: %{partnerNumber}}", usingJsonBody(""" + { + "partnerRel": ${Partner-Relation: Erbengemeinschaft %{nameOfDeceasedPerson}} + } + """)) + .expecting(HttpStatus.OK) + ); } @Override