explicitly fetch Hostsharing eG in CreatePartner

This commit is contained in:
Michael Hoennig 2024-10-29 17:44:02 +01:00
parent 77cf97ded9
commit 6b30d0f6f9

View File

@ -5,6 +5,9 @@ import net.hostsharing.hsadminng.hs.office.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.OK;
public class CreatePartner extends UseCase<CreatePartner> {
public CreatePartner(final ScenarioTest testSuite, final String resultAlias) {
@ -18,6 +21,12 @@ public class CreatePartner extends UseCase<CreatePartner> {
@Override
protected HttpResponse run() {
keep("Person: Hostsharing eG", () ->
httpGet("/api/hs/office/persons?name=Hostsharing+eG")
.expecting(OK).expecting(JSON),
response -> response.expectArrayElements(1).getFromBody("[0].uuid")
);
keep("Person: %{tradeName}", () ->
httpPost("/api/hs/office/persons", usingJsonBody("""
{