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
4 changed files with 8 additions and 5 deletions
Showing only changes of commit e5cc1da71a - Show all commits

View File

@ -19,7 +19,7 @@ public class CreateSelfDebitorForPartner extends UseCase<CreateSelfDebitorForPar
httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerPersonTradeName}")) httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerPersonTradeName}"))
.expecting(OK).expecting(JSON), .expecting(OK).expecting(JSON),
response -> response.expectArrayElements(1).getFromBody("[0].holder.uuid"), response -> response.expectArrayElements(1).getFromBody("[0].holder.uuid"),
"From that output above, we're taking the UUID of the holder of the first result element.", "In production data this query could result in multiple outputs. In that case, you have to find out which is the right one.",
"**HINT**: With production data, you might get multiple results and have to decide which is the right one." "**HINT**: With production data, you might get multiple results and have to decide which is the right one."
); );

View File

@ -21,7 +21,8 @@ public class AddOperationsContactToPartner extends UseCase<AddOperationsContactT
keep("Person: %{partnerPersonTradeName}", () -> keep("Person: %{partnerPersonTradeName}", () ->
httpGet("/api/hs/office/persons?name=" + uriEncoded("%{partnerPersonTradeName}")) httpGet("/api/hs/office/persons?name=" + uriEncoded("%{partnerPersonTradeName}"))
.expecting(OK).expecting(JSON), .expecting(OK).expecting(JSON),
response -> response.expectArrayElements(1).getFromBody("[0].uuid") 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."
); );
keep("Person: %{operationsContactGivenName} %{operationsContactFamilyName}", keep("Person: %{operationsContactGivenName} %{operationsContactFamilyName}",

View File

@ -21,7 +21,8 @@ public class AddRepresentativeToPartner extends UseCase<AddRepresentativeToPartn
keep("Person: %{partnerPersonTradeName}", () -> keep("Person: %{partnerPersonTradeName}", () ->
httpGet("/api/hs/office/persons?name=" + uriEncoded("%{partnerPersonTradeName}")) httpGet("/api/hs/office/persons?name=" + uriEncoded("%{partnerPersonTradeName}"))
.expecting(OK).expecting(JSON), .expecting(OK).expecting(JSON),
response -> response.expectArrayElements(1).getFromBody("[0].uuid") 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."
); );
keep("Person: %{representativeGivenName} %{representativeFamilyName}", () -> keep("Person: %{representativeGivenName} %{representativeFamilyName}", () ->

View File

@ -24,7 +24,8 @@ public class CreatePartner extends UseCase<CreatePartner> {
keep("Person: Hostsharing eG", () -> keep("Person: Hostsharing eG", () ->
httpGet("/api/hs/office/persons?name=Hostsharing+eG") httpGet("/api/hs/office/persons?name=Hostsharing+eG")
.expecting(OK).expecting(JSON), .expecting(OK).expecting(JSON),
response -> response.expectArrayElements(1).getFromBody("[0].uuid") response -> response.expectArrayElements(1).getFromBody("[0].uuid"),
"Even in production data we expect this query to return just a single result." // TODO.impl: add constraint?
); );
keep("Person: %{tradeName}", () -> keep("Person: %{tradeName}", () ->