feature/use-case-acceptance-tests #116
@ -80,7 +80,7 @@ class HsOfficeScenarioTests extends ScenarioTest {
|
||||
@Produces("Operations-Contact: Dennis Krause for Test AG")
|
||||
void shouldAddOperationsContactToPartner() {
|
||||
new AddOperationsContactToPartner(this)
|
||||
.given("partnerPersonUuid", "%{Person: Test AG}")
|
||||
.given("partnerPersonTradeName", "Test AG")
|
||||
.given("operationsContactFamilyName", "Krause")
|
||||
.given("operationsContactGivenName", "Dennis")
|
||||
.given("operationsContactPhoneNumber", "+49 9932 587741")
|
||||
|
@ -7,6 +7,7 @@ import org.springframework.http.HttpStatus;
|
||||
|
||||
import static io.restassured.http.ContentType.JSON;
|
||||
import static org.springframework.http.HttpStatus.CREATED;
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
|
||||
public class AddOperationsContactToPartner extends UseCase<AddOperationsContactToPartner> {
|
||||
|
||||
@ -16,6 +17,13 @@ public class AddOperationsContactToPartner extends UseCase<AddOperationsContactT
|
||||
|
||||
@Override
|
||||
protected HttpResponse run() {
|
||||
|
||||
keep("Person: %{partnerPersonTradeName}", () ->
|
||||
httpGet("/api/hs/office/persons?name=" + uriEncoded("%{partnerPersonTradeName}"))
|
||||
.expecting(OK).expecting(JSON),
|
||||
response -> response.expectArrayElements(1).getFromBody("[0].uuid")
|
||||
);
|
||||
|
||||
keep("Person: %{operationsContactGivenName} %{operationsContactFamilyName}",
|
||||
() ->
|
||||
httpPost("/api/hs/office/persons", usingJsonBody("""
|
||||
@ -49,7 +57,7 @@ public class AddOperationsContactToPartner extends UseCase<AddOperationsContactT
|
||||
return httpPost("/api/hs/office/relations", usingJsonBody("""
|
||||
{
|
||||
"type": "OPERATIONS",
|
||||
"anchorUuid": ${partnerPersonUuid},
|
||||
"anchorUuid": ${Person: %{partnerPersonTradeName}},
|
||||
"holderUuid": ${Person: %{operationsContactGivenName} %{operationsContactFamilyName}},
|
||||
"contactUuid": ${Contact: %{operationsContactGivenName} %{operationsContactFamilyName}}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user