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 ca9c5483..9677120b 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 @@ -134,9 +134,11 @@ class HsOfficeScenarioTests extends ScenarioTest { @Test @Order(1100) + @Requires("Partner: Michelle Matthieu") void shouldAmendContactData() { new AmendContactData(this) - .given("partnerNumber", 31020) + .given("partnerName", "Matthieu") + .given("newEmailAddress", "michelle@matthieu.example.org") .doRun(); } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java index 360f0756..49e611bb 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java @@ -2,8 +2,10 @@ package net.hostsharing.hsadminng.hs.office.scenarios.contact; import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import org.springframework.http.HttpStatus; -import static org.assertj.core.api.Assumptions.assumeThat; +import static io.restassured.http.ContentType.JSON; +import static org.springframework.http.HttpStatus.OK; public class AmendContactData extends UseCase { @@ -13,7 +15,28 @@ public class AmendContactData extends UseCase { @Override protected HttpResponse run() { - assumeThat(false).isTrue(); // makes the test gray + + obtain("partnerPersonUuid", () -> + httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerName}")) + .expecting(OK).expecting(JSON), + response -> response.expectArrayElements(1).getFromBody("[0].contact.uuid"), + "In production data this query could result in multiple outputs. In that case, you have to find out which is the right one." + ); + + httpPatch("/api/hs/office/contacts/%{partnerPersonUuid}", usingJsonBody(""" + { + "caption": ${contactCaption???}, + "postalAddress": ${postalAddress???}, + "phoneNumbers": { + "office": ${officePhoneNumber???} + }, + "emailAddresses": { + "main": ${newEmailAddress???} + } + } + """)) + .expecting(HttpStatus.OK); + return null; } } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSelfDebitorForPartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSelfDebitorForPartner.java index 91a21a00..d815bc61 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSelfDebitorForPartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSelfDebitorForPartner.java @@ -19,8 +19,7 @@ public class CreateSelfDebitorForPartner extends UseCase response.expectArrayElements(1).getFromBody("[0].holder.uuid"), - "In production data this query could result in multiple outputs. In that case, you have to find out which is the right one.", - "**HINT**: With production data, you might get multiple results and have to decide which is the right one." + "In production data this query could result in multiple outputs. In that case, you have to find out which is the right one." ); obtain("BankAccount: Test AG - refund bank account", () ->