OfficeScenarioTests CoopShares+Assets #121

Merged
hsh-michaelhoennig merged 39 commits from feature/use-case-acceptance-tests-4 into master 2024-11-15 11:54:19 +01:00
Showing only changes of commit a8de7029e9 - Show all commits

View File

@ -1,8 +1,8 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership; package net.hostsharing.hsadminng.hs.office.scenarios.membership;
import io.restassured.http.ContentType; 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.ScenarioTest;
import net.hostsharing.hsadminng.hs.office.scenarios.UseCase;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON; import static io.restassured.http.ContentType.JSON;
@ -16,11 +16,17 @@ public class CreateMembership extends UseCase<CreateMembership> {
@Override @Override
protected HttpResponse run() { 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(""" return httpPost("/api/hs/office/memberships", usingJsonBody("""
{ {
"partner.uuid": ${Partner: P-31010 - Test AG}, "partner.uuid": ${Partner: %{partnerName}},
"memberNumberSuffix": ${memberNumberSuffix}, "memberNumberSuffix": ${memberNumberSuffix},
"status": "ACTIVE", "status": "ACTIVE",
"validFrom": ${validFrom}, "validFrom": ${validFrom},