Assigning the new new Partner-Relation to the existing Partner

This commit is contained in:
Michael Hoennig 2024-12-07 12:32:01 +01:00
parent d9166067dc
commit 6107a5df33
2 changed files with 22 additions and 10 deletions

View File

@ -600,7 +600,6 @@ class HsOfficeScenarioTests extends ScenarioTest {
@Test @Test
@Order(6010) @Order(6010)
@Requires("Partner: P-31011 - Michelle Matthieu") @Requires("Partner: P-31011 - Michelle Matthieu")
@Produces("Partner-Relation: Erbengemeinschaft Michelle Matthieu")
void shouldReplaceDeceasedPartnerByCommunityOfHeirs() { void shouldReplaceDeceasedPartnerByCommunityOfHeirs() {
new ReplaceDeceasedPartnerWithCommunityOfHeirs(scenarioTest) new ReplaceDeceasedPartnerWithCommunityOfHeirs(scenarioTest)
.given("partnerNumber", "P-31011") .given("partnerNumber", "P-31011")

View File

@ -63,7 +63,8 @@ public class ReplaceDeceasedPartnerWithCommunityOfHeirs extends UseCase<ReplaceD
.expecting(HttpStatus.CREATED).expecting(ContentType.JSON) .expecting(HttpStatus.CREATED).expecting(ContentType.JSON)
); );
return httpPost("/api/hs/office/relations", usingJsonBody(""" obtain("Partner-Relation: Erbengemeinschaft %{nameOfDeceasedPerson}", () ->
httpPost("/api/hs/office/relations", usingJsonBody("""
{ {
"type": "PARTNER", "type": "PARTNER",
"anchor.uuid": ${Person: Hostsharing eG}, "anchor.uuid": ${Person: Hostsharing eG},
@ -71,7 +72,19 @@ public class ReplaceDeceasedPartnerWithCommunityOfHeirs extends UseCase<ReplaceD
"contact.uuid": ${Contact: Erbengemeinschaft %{nameOfDeceasedPerson}} "contact.uuid": ${Contact: Erbengemeinschaft %{nameOfDeceasedPerson}}
} }
""")) """))
.expecting(HttpStatus.CREATED).expecting(ContentType.JSON); .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 @Override