feature/use-case-acceptance-tests #116

Merged
hsh-michaelhoennig merged 49 commits from feature/use-case-acceptance-tests into master 2024-10-30 11:40:46 +01:00
Showing only changes of commit 6b30d0f6f9 - Show all commits

View File

@ -5,6 +5,9 @@ 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 org.springframework.http.HttpStatus; 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 class CreatePartner extends UseCase<CreatePartner> {
public CreatePartner(final ScenarioTest testSuite, final String resultAlias) { public CreatePartner(final ScenarioTest testSuite, final String resultAlias) {
@ -18,6 +21,12 @@ public class CreatePartner extends UseCase<CreatePartner> {
@Override @Override
protected HttpResponse run() { 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}", () -> keep("Person: %{tradeName}", () ->
httpPost("/api/hs/office/persons", usingJsonBody(""" httpPost("/api/hs/office/persons", usingJsonBody("""
{ {