diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CreateMembership.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CreateMembership.java index f66a0202..b7af4876 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CreateMembership.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CreateMembership.java @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; @@ -16,11 +16,17 @@ public class CreateMembership extends UseCase { @Override protected HttpResponse run() { - // FIXME: httpGet "partner.uuid": ${Partner: Test AG} + + obtain("Partner: %{partnerName}", () -> + httpGet("/api/hs/office/partners?name=&{partnerName}") + .expecting(OK).expecting(JSON), + response -> response.expectArrayElements(1).getFromBody("[0].uuid"), + "In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one." + ); return httpPost("/api/hs/office/memberships", usingJsonBody(""" { - "partner.uuid": ${Partner: P-31010 - Test AG}, + "partner.uuid": ${Partner: %{partnerName}}, "memberNumberSuffix": ${memberNumberSuffix}, "status": "ACTIVE", "validFrom": ${validFrom},