diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateExternalDebitorForPartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateExternalDebitorForPartner.java index a96a2596..1f3fcc2d 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateExternalDebitorForPartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateExternalDebitorForPartner.java @@ -21,26 +21,26 @@ public class CreateExternalDebitorForPartner extends UseCase - httpPost("/api/hs/office/bankaccounts", usingJsonBody(""" - { - "holder": "Billing GmbH - refund bank account", - "iban": "DE02120300000000202051", - "bic": "BYLADEM1001" - } - """)) - .expecting(CREATED).expecting(JSON) + httpPost("/api/hs/office/bankaccounts", usingJsonBody(""" + { + "holder": "Billing GmbH - refund bank account", + "iban": "DE02120300000000202051", + "bic": "BYLADEM1001" + } + """)) + .expecting(CREATED).expecting(JSON) ); keep("Contact: Billing GmbH - Test AG billing", () -> - httpPost("/api/hs/office/contacts", usingJsonBody(""" - { - "caption": "Billing GmbH, billing for Test AG", - "emailAddresses": { - "main": "test-ag@billing-GmbH.example.com" - } + httpPost("/api/hs/office/contacts", usingJsonBody(""" + { + "caption": "Billing GmbH, billing for Test AG", + "emailAddresses": { + "main": "test-ag@billing-GmbH.example.com" } - """)) - .expecting(CREATED).expecting(JSON) + } + """)) + .expecting(CREATED).expecting(JSON) ); return httpPost("/api/hs/office/debitors", usingJsonBody(""" diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSelfDebitorForPartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSelfDebitorForPartner.java index 04487ce6..ec25112a 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSelfDebitorForPartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSelfDebitorForPartner.java @@ -24,26 +24,26 @@ public class CreateSelfDebitorForPartner extends UseCase - httpPost("/api/hs/office/bankaccounts", usingJsonBody(""" - { - "holder": "Test AG - refund bank account", - "iban": "DE88100900001234567892", - "bic": "BEVODEBB" - } - """)) - .expecting(CREATED).expecting(JSON) + httpPost("/api/hs/office/bankaccounts", usingJsonBody(""" + { + "holder": "Test AG - refund bank account", + "iban": "DE88100900001234567892", + "bic": "BEVODEBB" + } + """)) + .expecting(CREATED).expecting(JSON) ); keep("Contact: Test AG - billing department", () -> - httpPost("/api/hs/office/contacts", usingJsonBody(""" - { - "caption": ${billingContactCaption}, - "emailAddresses": { - "main": ${billingContactEmailAddress} - } + httpPost("/api/hs/office/contacts", usingJsonBody(""" + { + "caption": ${billingContactCaption}, + "emailAddresses": { + "main": ${billingContactEmailAddress} } - """)) - .expecting(CREATED).expecting(JSON) + } + """)) + .expecting(CREATED).expecting(JSON) ); return httpPost("/api/hs/office/debitors", usingJsonBody(""" diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandataForDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandataForDebitor.java index 0f1226f7..490c1a1a 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandataForDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandataForDebitor.java @@ -15,14 +15,14 @@ public class CreateSepaMandataForDebitor extends UseCase - httpPost("/api/hs/office/bankaccounts", usingJsonBody(""" - { - "holder": "Test AG - debit bank account", - "iban": "DE02701500000000594937", - "bic": "SSKMDEMM" - } - """)) - .expecting(CREATED).expecting(JSON) + httpPost("/api/hs/office/bankaccounts", usingJsonBody(""" + { + "holder": "Test AG - debit bank account", + "iban": "DE02701500000000594937", + "bic": "SSKMDEMM" + } + """)) + .expecting(CREATED).expecting(JSON) ); return httpPost("/api/hs/office/sepamandates", usingJsonBody(""" diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/AddOperationsContactToPartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/AddOperationsContactToPartner.java index 6ed11f61..3c1ddef0 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/AddOperationsContactToPartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/AddOperationsContactToPartner.java @@ -40,18 +40,18 @@ public class AddOperationsContactToPartner extends UseCase - httpPost("/api/hs/office/contacts", usingJsonBody(""" - { - "caption": "%{operationsContactGivenName} %{operationsContactFamilyName}", - "phoneNumbers": { - "main": ${operationsContactPhoneNumber} - }, - "emailAddresses": { - "main": ${operationsContactEMailAddress} - } - } - """)) - .expecting(CREATED).expecting(JSON), + httpPost("/api/hs/office/contacts", usingJsonBody(""" + { + "caption": "%{operationsContactGivenName} %{operationsContactFamilyName}", + "phoneNumbers": { + "main": ${operationsContactPhoneNumber} + }, + "emailAddresses": { + "main": ${operationsContactEMailAddress} + } + } + """)) + .expecting(CREATED).expecting(JSON), "Please check first if that contact already exists, if so, use it's UUID below." ); diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/AddRepresentativeToPartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/AddRepresentativeToPartner.java index 035bb3fb..40e19dee 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/AddRepresentativeToPartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/AddRepresentativeToPartner.java @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.partner; 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.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; @@ -19,39 +19,39 @@ public class AddRepresentativeToPartner extends UseCase - httpGet("/api/hs/office/persons?name=" + uriEncoded("%{partnerPersonTradeName}")) - .expecting(OK).expecting(JSON), + httpGet("/api/hs/office/persons?name=" + uriEncoded("%{partnerPersonTradeName}")) + .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." ); keep("Person: %{representativeGivenName} %{representativeFamilyName}", () -> - httpPost("/api/hs/office/persons", usingJsonBody(""" - { - "personType": "NATURAL_PERSON", - "familyName": ${representativeFamilyName}, - "givenName": ${representativeGivenName} - } - """)) - .expecting(HttpStatus.CREATED).expecting(ContentType.JSON), - "Please check first if that person already exists, if so, use it's UUID below.", - "**HINT**: A representative is always a natural person and represents a non-natural-person." + httpPost("/api/hs/office/persons", usingJsonBody(""" + { + "personType": "NATURAL_PERSON", + "familyName": ${representativeFamilyName}, + "givenName": ${representativeGivenName} + } + """)) + .expecting(HttpStatus.CREATED).expecting(ContentType.JSON), + "Please check first if that person already exists, if so, use it's UUID below.", + "**HINT**: A representative is always a natural person and represents a non-natural-person." ); keep("Contact: %{representativeGivenName} %{representativeFamilyName}", () -> - httpPost("/api/hs/office/contacts", usingJsonBody(""" - { - "caption": "%{representativeGivenName} %{representativeFamilyName}", - "postalAddress": ${representativePostalAddress}, - "phoneNumbers": { - "main": ${representativePhoneNumber} - }, - "emailAddresses": { - "main": ${representativeEMailAddress} - } + httpPost("/api/hs/office/contacts", usingJsonBody(""" + { + "caption": "%{representativeGivenName} %{representativeFamilyName}", + "postalAddress": ${representativePostalAddress}, + "phoneNumbers": { + "main": ${representativePhoneNumber} + }, + "emailAddresses": { + "main": ${representativeEMailAddress} } - """)) - .expecting(CREATED).expecting(JSON), + } + """)) + .expecting(CREATED).expecting(JSON), "Please check first if that contact already exists, if so, use it's UUID below." ); diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/SubscribeToMailinglist.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/SubscribeToMailinglist.java index 4079e6b6..2b164611 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/SubscribeToMailinglist.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/SubscribeToMailinglist.java @@ -17,7 +17,7 @@ public class SubscribeToMailinglist extends UseCase { @Override protected HttpResponse run() { keep("Person: %{subscriberGivenName} %{subscriberFamilyName}", () -> - httpPost("/api/hs/office/persons", usingJsonBody(""" + httpPost("/api/hs/office/persons", usingJsonBody(""" { "personType": "NATURAL_PERSON", "familyName": ${subscriberFamilyName}, @@ -28,15 +28,15 @@ public class SubscribeToMailinglist extends UseCase { ); keep("Contact: %{subscriberGivenName} %{subscriberFamilyName}", () -> - httpPost("/api/hs/office/contacts", usingJsonBody(""" - { - "caption": "%{subscriberGivenName} %{subscriberFamilyName}", - "emailAddresses": { - "main": ${subscriberEMailAddress} - } + httpPost("/api/hs/office/contacts", usingJsonBody(""" + { + "caption": "%{subscriberGivenName} %{subscriberFamilyName}", + "emailAddresses": { + "main": ${subscriberEMailAddress} } - """)) - .expecting(CREATED).expecting(JSON) + } + """)) + .expecting(CREATED).expecting(JSON) ); return httpPost("/api/hs/office/relations", usingJsonBody("""