fix postalAddress format in scenario tests

This commit is contained in:
Michael Hoennig 2024-11-05 18:54:39 +01:00
parent 626db1fa16
commit 48bc6c9ccf
8 changed files with 54 additions and 25 deletions

View File

@ -96,9 +96,9 @@ class HsOfficeContactPatcherUnitTest extends PatchUnitTestBase<
HsOfficeContactRbacEntity::setCaption),
new SimpleProperty<>(
"postalAddress",
HsOfficeContactPatchResource::setEmailAddresses,
HsOfficeContactPatchResource::setPostalAddress,
PATCH_POSTAL_ADDRESS,
HsOfficeContactRbacEntity::putEmailAddresses,
HsOfficeContactRbacEntity::putPhoneNumbers,
PATCHED_POSTAL_ADDRESS)
.notNullable(),
new SimpleProperty<>(

View File

@ -460,9 +460,12 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
"type": "DEBITOR",
"contact": {
"caption": "first contact",
"postalAddress": "Vorname Nachname\\nStraße Hnr\\nPLZ Stadt",
"emailAddresses": { "main": "contact-admin@firstcontact.example.com" },
"phoneNumbers": { "phone_office": "+49 123 1234567" }
"postalAddress": {
"country": "Germany"
},
"emailAddresses": { "main": "contact-admin@firstcontact.example.com" },
"phoneNumbers": { "phone_office": "+49 123 1234567" }
}
}
},
"debitorNumber": 1000111,
@ -476,10 +479,11 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
"mark": null,
"contact": {
"caption": "first contact",
"postalAddress": "Vorname Nachname\\nStraße Hnr\\nPLZ Stadt",
"emailAddresses": { "main": "contact-admin@firstcontact.example.com" },
"phoneNumbers": { "phone_office": "+49 123 1234567" }
}
"postalAddress": {
"country": "Germany"
},
"emailAddresses": { "main": "contact-admin@firstcontact.example.com" },
"phoneNumbers": { "phone_office": "+49 123 1234567" }
},
"details": {
"registrationOffice": "Hamburg",

View File

@ -199,7 +199,9 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean
"type": "REPRESENTATIVE",
"contact": {
"caption": "first contact",
"postalAddress": "Vorname Nachname\\nStraße Hnr\\nPLZ Stadt",
"postalAddress": {
"country": "Germany"
},
"emailAddresses": {
"main": "contact-admin@firstcontact.example.com"
},

View File

@ -55,8 +55,11 @@ class HsOfficeScenarioTests extends ScenarioTest {
.given("tradeName", "Test AG")
.given("contactCaption", "Test AG - Hamburg")
.given("postalAddress", """
Shanghai-Allee 1
20123 Hamburg
"firma": "Test AG",
"street": "Shanghai-Allee 1",
"zipcode": "20123",
"city": "Hamburg",
"country": "Germany"
""")
.given("officePhoneNumber", "+49 40 654321-0")
.given("emailAddress", "hamburg@test-ag.example.org")
@ -75,8 +78,11 @@ class HsOfficeScenarioTests extends ScenarioTest {
.given("familyName", "Matthieu")
.given("contactCaption", "Michelle Matthieu")
.given("postalAddress", """
An der Wandse 34
22123 Hamburg
"name": "Michelle Matthieu",
"street": "An der Wandse 34",
"zipcode": "22123",
"city": "Hamburg",
"country": "Germany"
""")
.given("officePhoneNumber", "+49 40 123456")
.given("emailAddress", "michelle.matthieu@example.org")
@ -94,8 +100,11 @@ class HsOfficeScenarioTests extends ScenarioTest {
.given("representativeFamilyName", "Trust")
.given("representativeGivenName", "Tracy")
.given("representativePostalAddress", """
An der Alster 100
20000 Hamburg
"name": "Michelle Matthieu",
"street": "An der Alster 100",
"zipcode": "20000",
"city": "Hamburg",
"country": "Germany"
""")
.given("representativePhoneNumber", "+49 40 123456")
.given("representativeEMailAddress", "tracy.trust@example.org")
@ -172,12 +181,18 @@ class HsOfficeScenarioTests extends ScenarioTest {
void shouldReplaceContactData() {
new ReplaceContactData(this)
.given("partnerName", "Test AG")
.given("newContactCaption", "Test AG - Norden")
.given("newContactCaption", "Test AG - China")
.given("newPostalAddress", """
Am Hafen 11
26506 Norden
""")
.given("newOfficePhoneNumber", "+49 4931 654321-0")
"firma": "Test AG",
"name": "Fi Zhong-Kha",
"building": "Thi Chi Koh Building",
"street": "No.2 Commercial Second Street",
"district": "Niushan Wei Wu",
"city": "Dongguan City",
"province": "Guangdong Province",
"country": "China"
""")
.given("newOfficePhoneNumber", "++15 999 654321" )
.given("newEmailAddress", "norden@test-ag.example.org")
.doRun();
}

View File

@ -27,7 +27,9 @@ public class AmendContactData extends UseCase<AmendContactData> {
httpPatch("/api/hs/office/contacts/%{partnerContactUuid}", usingJsonBody("""
{
"caption": ${newContactCaption???},
"postalAddress": ${newPostalAddress???},
"postalAddress": {
%{newPostalAddress???}
},
"phoneNumbers": {
"office": ${newOfficePhoneNumber???}
},

View File

@ -27,7 +27,9 @@ public class ReplaceContactData extends UseCase<ReplaceContactData> {
httpPost("/api/hs/office/contacts", usingJsonBody("""
{
"caption": ${newContactCaption},
"postalAddress": ${newPostalAddress???},
"postalAddress": {
%{newPostalAddress???}
},
"phoneNumbers": {
"phone": ${newOfficePhoneNumber???}
},

View File

@ -42,7 +42,9 @@ public class AddRepresentativeToPartner extends UseCase<AddRepresentativeToPartn
httpPost("/api/hs/office/contacts", usingJsonBody("""
{
"caption": "%{representativeGivenName} %{representativeFamilyName}",
"postalAddress": ${representativePostalAddress},
"postalAddress": {
%{representativePostalAddress}
},
"phoneNumbers": {
"main": ${representativePhoneNumber}
},

View File

@ -44,7 +44,9 @@ public class CreatePartner extends UseCase<CreatePartner> {
httpPost("/api/hs/office/contacts", usingJsonBody("""
{
"caption": ${contactCaption},
"postalAddress": ${postalAddress???},
"postalAddress": {
%{postalAddress???}
},
"phoneNumbers": {
"office": ${officePhoneNumber???}
},