From e97b177a92ba6ccec91e8652bd4b4e84af682235 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 7 Nov 2024 10:11:46 +0100 Subject: [PATCH 1/2] feature/use-case-acceptance-tests-3 (#119) Co-authored-by: Michael Hoennig Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/119 Reviewed-by: Marc Sandlus --- .../HsOfficeMembershipController.java | 4 +- .../scenarios/HsOfficeScenarioTests.java | 26 ++++++++++ .../hs/office/scenarios/UseCase.java | 5 +- .../contact/AddPhoneNumberToContactData.java | 2 +- .../RemovePhoneNumberFromContactData.java | 2 +- .../scenarios/contact/ReplaceContactData.java | 2 +- .../membership/CancelMembership.java | 47 ++++++++++++++++++ .../membership/CreateMembership.java | 34 ++++++++----- .../AddOperationsContactToPartner.java | 2 +- .../partner/AddRepresentativeToPartner.java | 2 +- .../scenarios/partner/CreatePartner.java | 2 +- .../person/ShouldUpdatePersonData.java | 48 +++++++++++++++++++ .../RemoveOperationsContactFromPartner.java | 2 +- 13 files changed, 156 insertions(+), 22 deletions(-) create mode 100644 src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CancelMembership.java create mode 100644 src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/ShouldUpdatePersonData.java diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java index d63f9e6a..7a491961 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java @@ -34,8 +34,8 @@ public class HsOfficeMembershipController implements HsOfficeMembershipsApi { public ResponseEntity> listMemberships( final String currentSubject, final String assumedRoles, - UUID partnerUuid, - Integer memberNumber) { + final UUID partnerUuid, + final Integer memberNumber) { context.define(currentSubject, assumedRoles); final var entities = ( memberNumber != null) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java index 0288ab9f..b08e9f3c 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java @@ -11,12 +11,14 @@ import net.hostsharing.hsadminng.hs.office.scenarios.debitor.CreateSepaMandateFo import net.hostsharing.hsadminng.hs.office.scenarios.debitor.FinallyDeleteSepaMandateForDebitor; import net.hostsharing.hsadminng.hs.office.scenarios.debitor.DontDeleteDefaultDebitor; import net.hostsharing.hsadminng.hs.office.scenarios.debitor.InvalidateSepaMandateForDebitor; +import net.hostsharing.hsadminng.hs.office.scenarios.membership.CancelMembership; import net.hostsharing.hsadminng.hs.office.scenarios.membership.CreateMembership; import net.hostsharing.hsadminng.hs.office.scenarios.partner.AddOperationsContactToPartner; import net.hostsharing.hsadminng.hs.office.scenarios.partner.CreatePartner; import net.hostsharing.hsadminng.hs.office.scenarios.debitor.DeleteDebitor; import net.hostsharing.hsadminng.hs.office.scenarios.partner.DeletePartner; import net.hostsharing.hsadminng.hs.office.scenarios.partner.AddRepresentativeToPartner; +import net.hostsharing.hsadminng.hs.office.scenarios.person.ShouldUpdatePersonData; import net.hostsharing.hsadminng.hs.office.scenarios.subscription.RemoveOperationsContactFromPartner; import net.hostsharing.hsadminng.hs.office.scenarios.subscription.SubscribeToMailinglist; import net.hostsharing.hsadminng.hs.office.scenarios.subscription.UnsubscribeFromMailinglist; @@ -197,6 +199,16 @@ class HsOfficeScenarioTests extends ScenarioTest { .doRun(); } + @Test + @Order(1201) + @Requires("Partner: Michelle Matthieu") + void shouldUpdatePersonData() { + new ShouldUpdatePersonData(this) + .given("oldFamilyName", "Matthieu") + .given("newFamilyName", "Matthieu-Zhang") + .doRun(); + } + @Test @Order(2010) @Requires("Partner: Test AG") @@ -302,12 +314,26 @@ class HsOfficeScenarioTests extends ScenarioTest { @Test @Order(4000) @Requires("Partner: Test AG") + @Produces("Membership: Test AG 00") void shouldCreateMembershipForPartner() { new CreateMembership(this) .given("partnerName", "Test AG") .given("memberNumberSuffix", "00") .given("validFrom", "2024-10-15") + .given("newStatus", "ACTIVE") .given("membershipFeeBillable", "true") + .doRun() + .keep(); + } + + @Test + @Order(4900) + @Requires("Membership: Test AG 00") + void shouldCancelMembershipOfPartner() { + new CancelMembership(this) + .given("memberNumber", "3101000") + .given("validTo", "2025-12-30") + .given("newStatus", "CANCELLED") .doRun(); } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/UseCase.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/UseCase.java index 77aa7b93..f224fff2 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/UseCase.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/UseCase.java @@ -86,13 +86,13 @@ public abstract class UseCase> { }) ); final var response = run(); - verify(); + verify(response); return response; } protected abstract HttpResponse run(); - protected void verify() { + protected void verify(final HttpResponse response) { } public final UseCase given(final String propName, final Object propValue) { @@ -233,6 +233,7 @@ public abstract class UseCase> { @Getter private final HttpStatus status; + @Getter private UUID locationUuid; @SneakyThrows diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AddPhoneNumberToContactData.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AddPhoneNumberToContactData.java index 3e837195..5f8d266d 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AddPhoneNumberToContactData.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AddPhoneNumberToContactData.java @@ -40,7 +40,7 @@ public class AddPhoneNumberToContactData extends UseCase.HttpResponse response) { verify( "Verify if the New Phone Number Got Added", () -> httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerName}")) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/RemovePhoneNumberFromContactData.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/RemovePhoneNumberFromContactData.java index c499ee71..715e1832 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/RemovePhoneNumberFromContactData.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/RemovePhoneNumberFromContactData.java @@ -39,7 +39,7 @@ public class RemovePhoneNumberFromContactData extends UseCase.HttpResponse response) { verify( "Verify if the New Phone Number Got Added", () -> httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerName}")) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/ReplaceContactData.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/ReplaceContactData.java index f3e88269..e60bbc8e 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/ReplaceContactData.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/ReplaceContactData.java @@ -57,7 +57,7 @@ public class ReplaceContactData extends UseCase { } @Override - protected void verify() { + protected void verify(final UseCase.HttpResponse response) { verify( "Verify if the Contact-Relation Got Replaced in the Partner-Relation", () -> httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerName}")) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CancelMembership.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CancelMembership.java new file mode 100644 index 00000000..23f718b5 --- /dev/null +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CancelMembership.java @@ -0,0 +1,47 @@ +package net.hostsharing.hsadminng.hs.office.scenarios.membership; + +import io.restassured.http.ContentType; +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; +import static org.springframework.http.HttpStatus.OK; + +public class CancelMembership extends UseCase { + + public CancelMembership(final ScenarioTest testSuite) { + super(testSuite); + } + + @Override + protected HttpResponse run() { + + obtain("Membership: %{memberNumber}", () -> + httpGet("/api/hs/office/memberships?memberNumber=%{memberNumber}") + .expectArrayElements(1), + response -> response.expectArrayElements(1).getFromBody("[0].uuid") + ); + + return withTitle("Patch the New Status Into the Membership", () -> + httpPatch("/api/hs/office/memberships/%{Membership: %{memberNumber}}", usingJsonBody(""" + { + "validTo": ${validTo}, + "status": ${newStatus} + } + """)) + .expecting(HttpStatus.OK).expecting(ContentType.JSON) + ); + } + + @Override + protected void verify(final UseCase.HttpResponse response) { + verify( + "Verify That the Membership Got Cancelled", + () -> httpGet("/api/hs/office/memberships/%{Membership: %{memberNumber}}") + .expecting(OK).expecting(JSON), + path("validTo").contains("%{validTo}"), + path("status").contains("CANCELLED") + ); + } +} diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CreateMembership.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CreateMembership.java index 5a28f4d4..d1b47aec 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CreateMembership.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/CreateMembership.java @@ -5,6 +5,9 @@ import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; +import static io.restassured.http.ContentType.JSON; +import static org.springframework.http.HttpStatus.OK; + public class CreateMembership extends UseCase { public CreateMembership(final ScenarioTest testSuite) { @@ -13,17 +16,26 @@ public class CreateMembership extends UseCase { @Override protected HttpResponse run() { - obtain("Membership: %{partnerName} 00", () -> - httpPost("/api/hs/office/memberships", usingJsonBody(""" - { - "partnerUuid": ${Partner: Test AG}, - "memberNumberSuffix": ${memberNumberSuffix}, - "validFrom": ${validFrom}, - "membershipFeeBillable": ${membershipFeeBillable} - } - """)) - .expecting(HttpStatus.CREATED).expecting(ContentType.JSON) + return httpPost("/api/hs/office/memberships", usingJsonBody(""" + { + "partnerUuid": ${Partner: Test AG}, + "memberNumberSuffix": ${memberNumberSuffix}, + "status": "ACTIVE", + "validFrom": ${validFrom}, + "membershipFeeBillable": ${membershipFeeBillable} + } + """)) + .expecting(HttpStatus.CREATED).expecting(ContentType.JSON); + } + + @Override + protected void verify(final UseCase.HttpResponse response) { + verify( + "Verify That the Membership Got Created", + () -> httpGet("/api/hs/office/memberships/" + response.getLocationUuid()) + .expecting(OK).expecting(JSON), + path("validFrom").contains("%{validFrom}"), + path("status").contains("ACTIVE") ); - return null; } } 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 6c1fd1dd..8cef6e10 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 @@ -66,7 +66,7 @@ public class AddOperationsContactToPartner extends UseCase.HttpResponse response) { verify( "Verify the New OPERATIONS Relation", () -> httpGet("/api/hs/office/relations?relationType=OPERATIONS&personData=" + uriEncoded( 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 c5381684..b90fb532 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 @@ -69,7 +69,7 @@ public class AddRepresentativeToPartner extends UseCase.HttpResponse response) { verify( "Verify the REPRESENTATIVE Relation Got Removed", () -> httpGet("/api/hs/office/relations?relationType=REPRESENTATIVE&personData=" + uriEncoded("%{representativeFamilyName}")) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/CreatePartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/CreatePartner.java index 9538fdbf..5809ea96 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/CreatePartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/CreatePartner.java @@ -76,7 +76,7 @@ public class CreatePartner extends UseCase { } @Override - protected void verify() { + protected void verify(final UseCase.HttpResponse response) { verify( "Verify the New Partner Relation", () -> httpGet("/api/hs/office/relations?relationType=PARTNER&contactData=&{contactCaption}") diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/ShouldUpdatePersonData.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/ShouldUpdatePersonData.java new file mode 100644 index 00000000..04a61c5f --- /dev/null +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/ShouldUpdatePersonData.java @@ -0,0 +1,48 @@ +package net.hostsharing.hsadminng.hs.office.scenarios.person; + +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; +import static org.springframework.http.HttpStatus.OK; + +public class ShouldUpdatePersonData extends UseCase { + + public ShouldUpdatePersonData(final ScenarioTest testSuite) { + super(testSuite); + } + + @Override + protected HttpResponse run() { + + obtain( + "personUuid", + () -> httpGet("/api/hs/office/persons?name=" + uriEncoded("%{oldFamilyName}")) + .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." + ); + + withTitle("Patch the Additional Phone-Number into the Person", () -> + httpPatch("/api/hs/office/persons/%{personUuid}", usingJsonBody(""" + { + "familyName": ${newFamilyName} + } + """)) + .expecting(HttpStatus.OK) + ); + + return null; + } + + @Override + protected void verify(final UseCase.HttpResponse response) { + verify( + "Verify that the Family Name Got Amended", + () -> httpGet("/api/hs/office/persons/%{personUuid}") + .expecting(OK).expecting(JSON), + path("familyName").contains("%{newFamilyName}") + ); + } +} diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/RemoveOperationsContactFromPartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/RemoveOperationsContactFromPartner.java index c30019e7..2190e6d9 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/RemoveOperationsContactFromPartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/RemoveOperationsContactFromPartner.java @@ -33,7 +33,7 @@ public class RemoveOperationsContactFromPartner extends UseCase.HttpResponse response) { verify( "Verify the New OPERATIONS Relation", () -> httpGet("/api/hs/office/relations/&{Operations-Contact: %{operationsContactPerson}}") From 8f410198e9f072e8fd64a6fad75ad437b11b9666 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Mon, 11 Nov 2024 11:25:42 +0100 Subject: [PATCH 2/2] feature/use-dot-uuid-in-api (#120) Co-authored-by: Michael Hoennig Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/120 Reviewed-by: Marc Sandlus --- ...OfficeCoopAssetsTransactionController.java | 1 - .../hs-booking/hs-booking-item-schemas.yaml | 6 ++-- .../hs-booking-project-schemas.yaml | 4 +-- .../hs-hosting/hs-hosting-asset-schemas.yaml | 18 +++++------ .../hs-office-coopassets-schemas.yaml | 6 ++-- .../hs-office-coopshares-schemas.yaml | 6 ++-- .../hs-office/hs-office-debitor-schemas.yaml | 8 ++--- .../hs-office-membership-schemas.yaml | 4 +-- .../hs-office/hs-office-partner-schemas.yaml | 14 ++++---- .../hs-office/hs-office-relation-schemas.yaml | 26 +++++++-------- .../hs-office-sepamandate-schemas.yaml | 8 ++--- .../rbac/rbac-grant-schemas.yaml | 10 +++--- .../rbac/rbac-role-schemas.yaml | 2 +- .../rbac/rbac-subject-schemas.yaml | 6 ++-- ...HsBookingItemControllerAcceptanceTest.java | 14 ++++---- .../item/HsBookingItemControllerRestTest.java | 4 +-- ...ookingProjectControllerAcceptanceTest.java | 2 +- ...sHostingAssetControllerAcceptanceTest.java | 14 ++++---- ...omainSetupHostingAssetFactoryUnitTest.java | 8 ++--- ...tsTransactionControllerAcceptanceTest.java | 12 +++---- ...opAssetsTransactionControllerRestTest.java | 10 +++--- ...esTransactionControllerAcceptanceTest.java | 8 ++--- ...opSharesTransactionControllerRestTest.java | 4 +-- ...OfficeDebitorControllerAcceptanceTest.java | 18 +++++------ ...iceMembershipControllerAcceptanceTest.java | 2 +- .../HsOfficeMembershipControllerRestTest.java | 8 ++--- ...OfficePartnerControllerAcceptanceTest.java | 32 +++++++++---------- .../HsOfficePartnerControllerRestTest.java | 20 ++++++------ ...fficeRelationControllerAcceptanceTest.java | 28 ++++++++-------- .../scenarios/contact/ReplaceContactData.java | 2 +- .../CreateExternalDebitorForPartner.java | 8 ++--- .../debitor/CreateSelfDebitorForPartner.java | 8 ++--- .../debitor/CreateSepaMandateForDebitor.java | 4 +-- .../membership/CreateMembership.java | 2 +- .../AddOperationsContactToPartner.java | 6 ++-- .../partner/AddRepresentativeToPartner.java | 6 ++-- .../scenarios/partner/CreatePartner.java | 6 ++-- .../subscription/SubscribeToMailinglist.java | 6 ++-- ...ceSepaMandateControllerAcceptanceTest.java | 14 ++++---- .../RbacGrantControllerAcceptanceTest.java | 8 ++--- .../rbac/role/RbacRoleControllerRestTest.java | 6 ++-- 41 files changed, 189 insertions(+), 190 deletions(-) diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java index 9154b8f0..b8da7580 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java @@ -77,7 +77,6 @@ public class HsOfficeCoopAssetsTransactionController implements HsOfficeCoopAsse @Override @Transactional(readOnly = true) - public ResponseEntity getCoopAssetTransactionByUuid( final String currentSubject, final String assumedRoles, final UUID assetTransactionUuid) { diff --git a/src/main/resources/api-definition/hs-booking/hs-booking-item-schemas.yaml b/src/main/resources/api-definition/hs-booking/hs-booking-item-schemas.yaml index ef0ac307..97ed69f6 100644 --- a/src/main/resources/api-definition/hs-booking/hs-booking-item-schemas.yaml +++ b/src/main/resources/api-definition/hs-booking/hs-booking-item-schemas.yaml @@ -52,11 +52,11 @@ components: HsBookingItemInsert: type: object properties: - projectUuid: + project.uuid: type: string format: uuid nullable: false - parentItemUuid: + parentItem.uuid: type: string format: uuid nullable: false @@ -77,7 +77,7 @@ components: $ref: '../hs-hosting/hs-hosting-asset-schemas.yaml#/components/schemas/HsHostingAssetAutoInsert' required: - caption - - projectUuid + - project.uuid - validFrom - resources additionalProperties: false diff --git a/src/main/resources/api-definition/hs-booking/hs-booking-project-schemas.yaml b/src/main/resources/api-definition/hs-booking/hs-booking-project-schemas.yaml index de95203d..56626290 100644 --- a/src/main/resources/api-definition/hs-booking/hs-booking-project-schemas.yaml +++ b/src/main/resources/api-definition/hs-booking/hs-booking-project-schemas.yaml @@ -25,7 +25,7 @@ components: HsBookingProjectInsert: type: object properties: - debitorUuid: + debitor.uuid: type: string format: uuid nullable: false @@ -35,6 +35,6 @@ components: maxLength: 80 nullable: false required: - - debitorUuid + - debitor.uuid - caption additionalProperties: false diff --git a/src/main/resources/api-definition/hs-hosting/hs-hosting-asset-schemas.yaml b/src/main/resources/api-definition/hs-hosting/hs-hosting-asset-schemas.yaml index 44813162..39fafaeb 100644 --- a/src/main/resources/api-definition/hs-hosting/hs-hosting-asset-schemas.yaml +++ b/src/main/resources/api-definition/hs-hosting/hs-hosting-asset-schemas.yaml @@ -54,7 +54,7 @@ components: caption: type: string nullable: true - alarmContactUuid: + alarmContact.uuid: type: string format: uuid nullable: true @@ -64,11 +64,11 @@ components: HsHostingAssetInsert: type: object properties: - bookingItemUuid: + bookingItem.uuid: type: string format: uuid nullable: true - parentAssetUuid: + parentAsset.uuid: type: string format: uuid nullable: true @@ -84,7 +84,7 @@ components: minLength: 3 maxLength: 80 nullable: false - alarmContactUuid: + alarmContact.uuid: type: string format: uuid nullable: true @@ -99,11 +99,11 @@ components: HsHostingAssetAutoInsert: type: object properties: - parentAssetUuid: + parentAsset.uuid: type: string format: uuid nullable: true - assignedToAssetUuid: + assignedToAsset.uuid: type: string format: uuid type: @@ -118,7 +118,7 @@ components: minLength: 3 maxLength: 80 nullable: false - alarmContactUuid: + alarmContact.uuid: type: string format: uuid nullable: true @@ -147,10 +147,10 @@ components: minLength: 3 maxLength: 80 nullable: false - assignedToAssetUuid: + assignedToAsset.uuid: type: string format: uuid - alarmContactUuid: + alarmContact.uuid: type: string format: uuid nullable: true diff --git a/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml index 0c937767..16f4806b 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml @@ -62,7 +62,7 @@ components: HsOfficeCoopAssetsTransactionInsert: type: object properties: - membershipUuid: + membership.uuid: type: string format: uuid nullable: false @@ -80,11 +80,11 @@ components: maxLength: 48 comment: type: string - reverseEntryUuid: + reverseEntry.uuid: type: string format: uuid required: - - membershipUuid + - membership.uuid - transactionType - assetValue - valueDate diff --git a/src/main/resources/api-definition/hs-office/hs-office-coopshares-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-coopshares-schemas.yaml index 680321be..50ea65a5 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-coopshares-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-coopshares-schemas.yaml @@ -56,7 +56,7 @@ components: HsOfficeCoopSharesTransactionInsert: type: object properties: - membershipUuid: + membership.uuid: type: string format: uuid nullable: false @@ -73,11 +73,11 @@ components: maxLength: 48 comment: type: string - adjustedShareTxUuid: + adjustedShareTx.uuid: type: string format: uuid required: - - membershipUuid + - membership.uuid - transactionType - shareCount - valueDate diff --git a/src/main/resources/api-definition/hs-office/hs-office-debitor-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-debitor-schemas.yaml index ed4d8c26..bc3d402e 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-debitor-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-debitor-schemas.yaml @@ -41,7 +41,7 @@ components: HsOfficeDebitorPatch: type: object properties: - debitorRelUuid: + debitorRel.uuid: type: string format: uuid nullable: true @@ -61,7 +61,7 @@ components: vatReverseCharge: type: boolean nullable: false - refundBankAccountUuid: + refundBankAccount.uuid: type: string format: uuid nullable: true @@ -75,7 +75,7 @@ components: properties: debitorRel: $ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelationSubInsert' - debitorRelUuid: + debitorRel.uuid: type: string format: uuid debitorNumberSuffix: @@ -92,7 +92,7 @@ components: type: boolean vatReverseCharge: type: boolean - refundBankAccountUuid: + refundBankAccount.uuid: type: string format: uuid defaultPrefix: diff --git a/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml index 7132cff4..20459f4e 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml @@ -62,7 +62,7 @@ components: HsOfficeMembershipInsert: type: object properties: - partnerUuid: + partner.uuid: type: string format: uuid nullable: false @@ -86,7 +86,7 @@ components: nullable: false type: boolean required: - - partnerUuid + - partner.uuid - memberNumberSuffix - validFrom - membershipFeeBillable diff --git a/src/main/resources/api-definition/hs-office/hs-office-partner-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-partner-schemas.yaml index 0e5952e1..bd327e10 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-partner-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-partner-schemas.yaml @@ -50,7 +50,7 @@ components: HsOfficePartnerPatch: type: object properties: - partnerRelUuid: + partnerRel.uuid: type: string format: uuid nullable: true @@ -103,19 +103,19 @@ components: type: object nullable: false properties: - anchorUuid: + anchor.uuid: type: string format: uuid - holderUuid: + holder.uuid: type: string format: uuid - contactUuid: + contact.uuid: type: string format: uuid required: - - anchorUuid - - holderUuid - - relContactUuid + - anchor.uuid + - holder.uuid + - relContact.uuid HsOfficePartnerDetailsInsert: type: object diff --git a/src/main/resources/api-definition/hs-office/hs-office-relation-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-relation-schemas.yaml index cbad776c..16ba6070 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-relation-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-relation-schemas.yaml @@ -36,7 +36,7 @@ components: HsOfficeRelationPatch: type: object properties: - contactUuid: + contact.uuid: type: string format: uuid nullable: true @@ -45,10 +45,10 @@ components: HsOfficeRelationInsert: type: object properties: - anchorUuid: + anchor.uuid: type: string format: uuid - holderUuid: + holder.uuid: type: string format: uuid type: @@ -57,32 +57,32 @@ components: mark: type: string nullable: true - contactUuid: + contact.uuid: type: string format: uuid required: - - anchorUuid - - holderUuid + - anchor.uuid + - holder.uuid - type - - contactUuid + - contact.uuid # relation created as a sub-element with implicitly known type HsOfficeRelationSubInsert: type: object properties: - anchorUuid: + anchor.uuid: type: string format: uuid - holderUuid: + holder.uuid: type: string format: uuid mark: type: string nullable: true - contactUuid: + contact.uuid: type: string format: uuid required: - - anchorUuid - - holderUuid - - contactUuid + - anchor.uuid + - holder.uuid + - contact.uuid diff --git a/src/main/resources/api-definition/hs-office/hs-office-sepamandate-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-sepamandate-schemas.yaml index 80668ba8..2afd4127 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-sepamandate-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-sepamandate-schemas.yaml @@ -48,11 +48,11 @@ components: HsOfficeSepaMandateInsert: type: object properties: - debitorUuid: + debitor.uuid: type: string format: uuid nullable: false - bankAccountUuid: + bankAccount.uuid: type: string format: uuid nullable: false @@ -72,8 +72,8 @@ components: format: date nullable: true required: - - debitorUuid - - bankAccountUuid + - debitor.uuid + - bankAccount.uuid - reference - agreement - validFrom diff --git a/src/main/resources/api-definition/rbac/rbac-grant-schemas.yaml b/src/main/resources/api-definition/rbac/rbac-grant-schemas.yaml index 90700354..c713ebc6 100644 --- a/src/main/resources/api-definition/rbac/rbac-grant-schemas.yaml +++ b/src/main/resources/api-definition/rbac/rbac-grant-schemas.yaml @@ -8,21 +8,21 @@ components: properties: grantedByRoleIdName: type: string - grantedByRoleUuid: + grantedByRole.uuid: type: string format: uuid assumed: type: boolean grantedRoleIdName: type: string - grantedRoleUuid: + grantedRole.uuid: type: string format: uuid granteeSubjectName: type: string - granteeSubjectUuid: + granteeSubject.uuid: type: string format: uuid required: - - grantedRoleUuid - - granteeSubjectUuid + - grantedRole.uuid + - granteeSubject.uuid diff --git a/src/main/resources/api-definition/rbac/rbac-role-schemas.yaml b/src/main/resources/api-definition/rbac/rbac-role-schemas.yaml index 4e5b5f4d..bf72a8e5 100644 --- a/src/main/resources/api-definition/rbac/rbac-role-schemas.yaml +++ b/src/main/resources/api-definition/rbac/rbac-role-schemas.yaml @@ -9,7 +9,7 @@ components: uuid: type: string format: uuid - objectUuid: + object.uuid: type: string format: uuid objectTable: diff --git a/src/main/resources/api-definition/rbac/rbac-subject-schemas.yaml b/src/main/resources/api-definition/rbac/rbac-subject-schemas.yaml index 9cb8ec0f..b907093a 100644 --- a/src/main/resources/api-definition/rbac/rbac-subject-schemas.yaml +++ b/src/main/resources/api-definition/rbac/rbac-subject-schemas.yaml @@ -14,7 +14,7 @@ components: RbacSubjectPermission: type: object properties: - objectUuid: + object.uuid: type: string format: uuid objectTable: @@ -23,10 +23,10 @@ components: type: string roleName: type: string - roleUuid: + role.uuid: type: string format: uuid - permissionUuid: + permission.uuid: type: string format: uuid op: diff --git a/src/test/java/net/hostsharing/hsadminng/hs/booking/item/HsBookingItemControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/booking/item/HsBookingItemControllerAcceptanceTest.java index 6b4a4b29..3598c0ce 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/booking/item/HsBookingItemControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/booking/item/HsBookingItemControllerAcceptanceTest.java @@ -150,7 +150,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "projectUuid": "{projectUuid}", + "project.uuid": "{projectUuid}", "type": "MANAGED_SERVER", "caption": "some new booking", "validTo": "{validTo}", @@ -200,8 +200,8 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "projectUuid": "{projectUuid}", - "parentItemUuid": "{managedServerUuid}", + "project.uuid": "{projectUuid}", + "parentItem.uuid": "{managedServerUuid}", "type": "MANAGED_WEBSPACE", "caption": "some managed webspace", "resources": { @@ -270,7 +270,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "projectUuid": "{projectUuid}", + "project.uuid": "{projectUuid}", "type": "DOMAIN_SETUP", "caption": "Domain-Setup for example.org", "resources": { @@ -285,7 +285,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup }, { "type": "DOMAIN_HTTP_SETUP", - "assignedToAssetUuid": "{unixUserUuid}" + "assignedToAsset.uuid": "{unixUserUuid}" }, { "type": "DOMAIN_MBOX_SETUP" @@ -360,7 +360,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "projectUuid": "{projectUuid}", + "project.uuid": "{projectUuid}", "type": "DOMAIN_SETUP", "caption": "some new domain-setup booking", "resources": { @@ -375,7 +375,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup }, { "type": "DOMAIN_HTTP_SETUP", - "assignedToAssetUuid": "{unixUserUuid}" + "assignedToAsset.uuid": "{unixUserUuid}" }, { "type": "DOMAIN_MBOX_SETUP" diff --git a/src/test/java/net/hostsharing/hsadminng/hs/booking/item/HsBookingItemControllerRestTest.java b/src/test/java/net/hostsharing/hsadminng/hs/booking/item/HsBookingItemControllerRestTest.java index 11ecf5bc..6b2bf5df 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/booking/item/HsBookingItemControllerRestTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/booking/item/HsBookingItemControllerRestTest.java @@ -105,7 +105,7 @@ class HsBookingItemControllerRestTest { .contentType(MediaType.APPLICATION_JSON) .content(""" { - "projectUuid": "{projectUuid}", + "project.uuid": "{projectUuid}", "type": "MANAGED_SERVER", "caption": "some new booking", "validTo": "{validTo}", @@ -155,7 +155,7 @@ class HsBookingItemControllerRestTest { .contentType(MediaType.APPLICATION_JSON) .content(""" { - "projectUuid": "{projectUuid}", + "project.uuid": "{projectUuid}", "type": "MANAGED_SERVER", "caption": "some new booking", "validFrom": "{validFrom}", diff --git a/src/test/java/net/hostsharing/hsadminng/hs/booking/project/HsBookingProjectControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/booking/project/HsBookingProjectControllerAcceptanceTest.java index 69c11d9f..2e281882 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/booking/project/HsBookingProjectControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/booking/project/HsBookingProjectControllerAcceptanceTest.java @@ -92,7 +92,7 @@ class HsBookingProjectControllerAcceptanceTest extends ContextBasedTestWithClean .contentType(ContentType.JSON) .body(""" { - "debitorUuid": "%s", + "debitor.uuid": "%s", "caption": "some new project" } """.formatted(givenDebitor.getUuid())) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java index 30b62a5a..2eff25de 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java @@ -165,10 +165,10 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "bookingItemUuid": "%s", + "bookingItem.uuid": "%s", "type": "MANAGED_WEBSPACE", "identifier": "fir10", - "parentAssetUuid": "%s", + "parentAsset.uuid": "%s", "caption": "some separate ManagedWebspace HA", "config": {} } @@ -227,7 +227,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "parentAssetUuid": "%s", + "parentAsset.uuid": "%s", "type": "UNIX_USER", "identifier": "fir01-temp", "caption": "some new UnixUser in client's ManagedWebspace", @@ -280,7 +280,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "bookingItemUuid": "%s", + "bookingItem.uuid": "%s", "type": "DOMAIN_SETUP", "identifier": "example.com", "caption": "some unrelated domain-setup", @@ -326,7 +326,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "bookingItemUuid": "%s", + "bookingItem.uuid": "%s", "type": "MANAGED_SERVER", "identifier": "vm1400", "caption": "some new ManagedServer", @@ -381,7 +381,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "parentAssetUuid": "%s", + "parentAsset.uuid": "%s", "type": "UNIX_USER", "identifier": "fir01-extra", "caption": "some extra UnixUser", @@ -508,7 +508,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "alarmContactUuid": "%s", + "alarmContact.uuid": "%s", "config": { "monit_max_ssd_usage": 85, "monit_max_hdd_usage": null, diff --git a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/factories/DomainSetupHostingAssetFactoryUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/factories/DomainSetupHostingAssetFactoryUnitTest.java index 14762bd0..cf2fc350 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/factories/DomainSetupHostingAssetFactoryUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/factories/DomainSetupHostingAssetFactoryUnitTest.java @@ -83,7 +83,7 @@ class DomainSetupHostingAssetFactoryUnitTest { "subHostingAssets": [ { "type": "DOMAIN_HTTP_SETUP", - "assignedToAssetUuid": "{unixUserHostingAssetUuid}" + "assignedToAsset.uuid": "{unixUserHostingAssetUuid}" }, { "type": "DOMAIN_DNS_SETUP" @@ -124,7 +124,7 @@ class DomainSetupHostingAssetFactoryUnitTest { "subHostingAssets": [ { "type": "DOMAIN_HTTP_SETUP", - "assignedToAssetUuid": "{unixUserHostingAssetUuid}" + "assignedToAsset.uuid": "{unixUserHostingAssetUuid}" }, { "type": "DOMAIN_DNS_SETUP" @@ -164,7 +164,7 @@ class DomainSetupHostingAssetFactoryUnitTest { "subHostingAssets": [ { "type": "DOMAIN_HTTP_SETUP", - "assignedToAssetUuid": "{unixUserHostingAssetUuid}" + "assignedToAsset.uuid": "{unixUserHostingAssetUuid}" }, { "type": "DOMAIN_DNS_SETUP" @@ -206,7 +206,7 @@ class DomainSetupHostingAssetFactoryUnitTest { "subHostingAssets": [ { "type": "DOMAIN_HTTP_SETUP", - "assignedToAssetUuid": "{unixUserHostingAssetUuid}" + "assignedToAsset.uuid": "{unixUserHostingAssetUuid}" }, { "type": "DOMAIN_DNS_SETUP" diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java index e8766490..6ac97292 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java @@ -180,7 +180,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased .contentType(ContentType.JSON) .body(""" { - "membershipUuid": "%s", + "membership.uuid": "%s", "transactionType": "DEPOSIT", "assetValue": 1024.00, "valueDate": "2022-10-13", @@ -237,13 +237,13 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased .contentType(ContentType.JSON) .body(""" { - "membershipUuid": "%s", + "membership.uuid": "%s", "transactionType": "ADJUSTMENT", "assetValue": %s, "valueDate": "2022-10-30", "reference": "test ref adjustment", "comment": "some coop assets adjustment transaction", - "reverseEntryUuid": "%s" + "reverseEntry.uuid": "%s" } """.formatted( givenMembership.getUuid(), @@ -270,7 +270,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased "reference": "test ref" } } - """.formatted(givenTransaction.getUuid()))) + """)) .header("Location", startsWith("http://localhost")) .extract().header("Location"); // @formatter:on @@ -293,14 +293,14 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased .contentType(ContentType.JSON) .body(""" { - "membershipUuid": "%s", + "membership.uuid": "%s", "transactionType": "DISBURSAL", "assetValue": -10240.00, "valueDate": "2022-10-13", "reference": "temp ref X", "comment": "just some test coop assets transaction" } - """.formatted(givenMembership.getUuid())) + """.formatted(givenMembership.getUuid())) .port(port) .when() .post("http://localhost/api/hs/office/coopassetstransactions") diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerRestTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerRestTest.java index 03a1c71b..b7f44b35 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerRestTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerRestTest.java @@ -37,7 +37,7 @@ class HsOfficeCoopAssetsTransactionControllerRestTest { static final String VALID_INSERT_REQUEST_BODY = """ { - "membershipUuid": "%s", + "membership.uuid": "%s", "transactionType": "DEPOSIT", "assetValue": 128.00, "valueDate": "2022-10-13", @@ -48,8 +48,8 @@ class HsOfficeCoopAssetsTransactionControllerRestTest { enum BadRequestTestCases { MEMBERSHIP_UUID_MISSING( - requestBody -> requestBody.without("membershipUuid"), - "[membershipUuid must not be null but is \"null\"]"), + requestBody -> requestBody.without("membership.uuid"), + "[membershipUuid must not be null but is \"null\"]"), // TODO.impl: should be membership.uuid, Spring validation-problem? TRANSACTION_TYPE_MISSING( requestBody -> requestBody.without("transactionType"), @@ -121,10 +121,10 @@ class HsOfficeCoopAssetsTransactionControllerRestTest { .accept(MediaType.APPLICATION_JSON)) // then - .andExpect(status().is4xxClientError()) + .andExpect(jsonPath("message", is("ERROR: [400] " + testCase.expectedErrorMessage))) .andExpect(jsonPath("statusCode", is(400))) .andExpect(jsonPath("statusPhrase", is("Bad Request"))) - .andExpect(jsonPath("message", is("ERROR: [400] " + testCase.expectedErrorMessage))); + .andExpect(status().is4xxClientError()); } } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java index 28a7723e..a1e8a675 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java @@ -168,7 +168,7 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest extends ContextBased final var location = RestAssured // @formatter:off .given().header("current-subject", "superuser-alex@hostsharing.net").contentType(ContentType.JSON).body(""" { - "membershipUuid": "%s", + "membership.uuid": "%s", "transactionType": "SUBSCRIPTION", "shareCount": 8, "valueDate": "2022-10-13", @@ -214,13 +214,13 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest extends ContextBased .contentType(ContentType.JSON) .body(""" { - "membershipUuid": "%s", + "membership.uuid": "%s", "transactionType": "ADJUSTMENT", "shareCount": %s, "valueDate": "2022-10-30", "reference": "test ref adjustment", "comment": "some coop shares adjustment transaction", - "adjustedShareTxUuid": "%s" + "adjustedShareTx.uuid": "%s" } """.formatted( givenMembership.getUuid(), @@ -267,7 +267,7 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest extends ContextBased RestAssured // @formatter:off .given().header("current-subject", "superuser-alex@hostsharing.net").contentType(ContentType.JSON).body(""" { - "membershipUuid": "%s", + "membership.uuid": "%s", "transactionType": "CANCELLATION", "shareCount": -80, "valueDate": "2022-10-13", diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerRestTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerRestTest.java index 1e33fde9..7024c668 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerRestTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerRestTest.java @@ -37,7 +37,7 @@ class HsOfficeCoopSharesTransactionControllerRestTest { static final String VALID_INSERT_REQUEST_BODY = """ { - "membershipUuid": "%s", + "membership.uuid": "%s", "transactionType": "SUBSCRIPTION", "shareCount": 8, "valueDate": "2022-10-13", @@ -48,7 +48,7 @@ class HsOfficeCoopSharesTransactionControllerRestTest { enum BadRequestTestCases { MEMBERSHIP_UUID_MISSING( - requestBody -> requestBody.without("membershipUuid"), + requestBody -> requestBody.without("membership.uuid"), "[membershipUuid must not be null but is \"null\"]"), TRANSACTION_TYPE_MISSING( diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorControllerAcceptanceTest.java index a15ffbce..f6623fe0 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorControllerAcceptanceTest.java @@ -287,14 +287,14 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu .contentType(ContentType.JSON) .body(""" { - "debitorRelUuid": "%s", + "debitorRel.uuid": "%s", "debitorNumberSuffix": "%s", "billable": "true", "vatId": "VAT123456", "vatCountryCode": "DE", "vatBusiness": true, "vatReverseCharge": "false", - "refundBankAccountUuid": "%s", + "refundBankAccount.uuid": "%s", "defaultPrefix": "for" } """.formatted( givenDebitorRelUUid, ++nextDebitorSuffix, givenBankAccount.getUuid())) @@ -333,9 +333,9 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu .body(""" { "debitorRel": { - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" }, "debitorNumberSuffix": "%s", "defaultPrefix": "for", @@ -384,9 +384,9 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu .body(""" { "debitorRel": { - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" }, "debitorNumberSuffix": "%s", "defaultPrefix": "for", @@ -418,7 +418,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu .contentType(ContentType.JSON) .body(""" { - "debitorRelUuid": "%s", + "debitorRel.uuid": "%s", "debitorNumberSuffix": "%s", "defaultPrefix": "for", "billable": "true", diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java index 55f2fbd7..f3793da1 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java @@ -182,7 +182,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle .contentType(ContentType.JSON) .body(""" { - "partnerUuid": "%s", + "partner.uuid": "%s", "memberNumberSuffix": "%s", "validFrom": "2022-10-13", "membershipFeeBillable": "true" diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerRestTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerRestTest.java index 1fcc9f11..455008a2 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerRestTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerRestTest.java @@ -56,12 +56,12 @@ public class HsOfficeMembershipControllerRestTest { .contentType(MediaType.APPLICATION_JSON) .content(""" { - "partnerUuid": null, + "partner.uuid": null, "memberNumberSuffix": "01", "validFrom": "2022-10-13", "membershipFeeBillable": "true" } - """.formatted(UUID.randomUUID())) + """) .accept(MediaType.APPLICATION_JSON)) // then @@ -86,7 +86,7 @@ public class HsOfficeMembershipControllerRestTest { .contentType(MediaType.APPLICATION_JSON) .content(""" { - "partnerUuid": "%s", + "partner.uuid": "%s", "memberNumberSuffix": "01", "validFrom": "2022-10-13", "membershipFeeBillable": "true" @@ -112,7 +112,7 @@ public class HsOfficeMembershipControllerRestTest { .contentType(MediaType.APPLICATION_JSON) .content(""" { - "partnerUuid": "%s", + "partner.uuid": "%s", %s "validFrom": "2022-10-13", "membershipFeeBillable": "true" diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerAcceptanceTest.java index 8c75ed16..c2ec1271 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerAcceptanceTest.java @@ -102,9 +102,9 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu { "partnerNumber": "20002", "partnerRel": { - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" }, "details": { "registrationOffice": "Temp Registergericht Aurich", @@ -161,12 +161,12 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu { "partnerNumber": "20003", "partnerRel": { - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" }, - "personUuid": "%s", - "contactUuid": "%s", + "person.uuid": "%s", + "contact.uuid": "%s", "details": {} } """.formatted( @@ -199,12 +199,12 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu { "partnerNumber": "20004", "partnerRel": { - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" }, - "personUuid": "%s", - "contactUuid": "%s", + "person.uuid": "%s", + "contact.uuid": "%s", "details": {} } """.formatted( @@ -321,7 +321,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu .body(""" { "partnerNumber": "20011", - "partnerRelUuid": "%s", + "partnerRel.uuid": "%s", "details": { "registrationOffice": "Temp Registergericht Aurich", "registrationNumber": "222222", @@ -330,7 +330,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu "dateOfDeath": "2022-01-12" } } - """.formatted(givenPartnerRel.getUuid())) + """.formatted(givenPartnerRel.getUuid())) .port(port) .when() .patch("http://localhost/api/hs/office/partners/" + givenPartner.getUuid()) @@ -387,7 +387,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu .contentType(ContentType.JSON) .body(""" { - "partnerRelUuid": "%s" + "partnerRel.uuid": "%s" } """.formatted(givenPartnerRel.getUuid())) .port(port) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerRestTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerRestTest.java index 42d0566c..889e776f 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerRestTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerRestTest.java @@ -101,12 +101,12 @@ class HsOfficePartnerControllerRestTest { { "partnerNumber": "20002", "partnerRel": { - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" }, - "personUuid": "%s", - "contactUuid": "%s", + "person.uuid": "%s", + "contact.uuid": "%s", "details": { "registrationOffice": "Temp Registergericht Aurich", "registrationNumber": "111111" @@ -138,12 +138,12 @@ class HsOfficePartnerControllerRestTest { { "partnerNumber": "20002", "partnerRel": { - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" }, - "personUuid": "%s", - "contactUuid": "%s", + "person.uuid": "%s", + "contact.uuid": "%s", "details": { "registrationOffice": "Temp Registergericht Aurich", "registrationNumber": "111111" diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationControllerAcceptanceTest.java index 2dac741b..9bc4eafa 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationControllerAcceptanceTest.java @@ -235,9 +235,9 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean { "type": "%s", "mark": "%s", - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" } """.formatted( HsOfficeRelationTypeResource.SUBSCRIBER, @@ -281,9 +281,9 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean .body(""" { "type": "%s", - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" } """.formatted( HsOfficeRelationTypeResource.DEBITOR, @@ -313,9 +313,9 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean .body(""" { "type": "%s", - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" } """.formatted( HsOfficeRelationTypeResource.DEBITOR, @@ -346,9 +346,9 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean .body(""" { "type": "%s", - "anchorUuid": "%s", - "holderUuid": "%s", - "contactUuid": "%s" + "anchor.uuid": "%s", + "holder.uuid": "%s", + "contact.uuid": "%s" } """.formatted( HsOfficeRelationTypeResource.DEBITOR, @@ -461,9 +461,9 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean .contentType(ContentType.JSON) .body(""" { - "contactUuid": "%s" + "contact.uuid": "%s" } - """.formatted(givenContact.getUuid())) + """.formatted(givenContact.getUuid())) .port(port) .when() .patch("http://localhost/api/hs/office/relations/" + givenRelation.getUuid()) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/ReplaceContactData.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/ReplaceContactData.java index e60bbc8e..2638a4e5 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/ReplaceContactData.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/ReplaceContactData.java @@ -47,7 +47,7 @@ public class ReplaceContactData extends UseCase { withTitle("Replace the Contact-Reference in the Partner-Relation", () -> httpPatch("/api/hs/office/relations/%{partnerRelationUuid}", usingJsonBody(""" { - "contactUuid": ${Contact: %{newContactCaption}} + "contact.uuid": ${Contact: %{newContactCaption}} } """)) .expecting(OK) 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 194d4513..cf525c30 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 @@ -55,9 +55,9 @@ public class CreateExternalDebitorForPartner extends UseCase { protected HttpResponse run() { return httpPost("/api/hs/office/memberships", usingJsonBody(""" { - "partnerUuid": ${Partner: Test AG}, + "partner.uuid": ${Partner: Test AG}, "memberNumberSuffix": ${memberNumberSuffix}, "status": "ACTIVE", "validFrom": ${validFrom}, 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 8cef6e10..f862c782 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 @@ -57,9 +57,9 @@ public class AddOperationsContactToPartner extends UseCase { { "partnerNumber": ${partnerNumber}, "partnerRel": { - "anchorUuid": ${Person: Hostsharing eG}, - "holderUuid": ${Person: %{%{tradeName???}???%{givenName???} %{familyName???}}}, - "contactUuid": ${Contact: %{contactCaption}} + "anchor.uuid": ${Person: Hostsharing eG}, + "holder.uuid": ${Person: %{%{tradeName???}???%{givenName???} %{familyName???}}}, + "contact.uuid": ${Contact: %{contactCaption}} }, "details": { "registrationOffice": "Registergericht Hamburg", 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 3e4ae74b..7cca9ba4 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 @@ -52,9 +52,9 @@ public class SubscribeToMailinglist extends UseCase { { "type": "SUBSCRIBER", "mark": ${mailingList}, - "anchorUuid": ${Person: %{partnerPersonTradeName}}, - "holderUuid": ${Person: %{subscriberGivenName} %{subscriberFamilyName}}, - "contactUuid": ${Contact: %{subscriberGivenName} %{subscriberFamilyName}} + "anchor.uuid": ${Person: %{partnerPersonTradeName}}, + "holder.uuid": ${Person: %{subscriberGivenName} %{subscriberFamilyName}}, + "contact.uuid": ${Contact: %{subscriberGivenName} %{subscriberFamilyName}} } """)) .expecting(CREATED).expecting(JSON); diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateControllerAcceptanceTest.java index 48ed0d9c..82a011dc 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateControllerAcceptanceTest.java @@ -144,8 +144,8 @@ class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCl .contentType(ContentType.JSON) .body(""" { - "debitorUuid": "%s", - "bankAccountUuid": "%s", + "debitor.uuid": "%s", + "bankAccount.uuid": "%s", "reference": "temp ref CAT A", "agreement": "2020-01-02", "validFrom": "2022-10-13" @@ -186,7 +186,7 @@ class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCl .contentType(ContentType.JSON) .body(""" { - "bankAccountUuid": "%s", + "bankAccount.uuid": "%s", "reference": "temp ref CAT B", "validFrom": "2022-10-13" } @@ -211,8 +211,8 @@ class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCl .contentType(ContentType.JSON) .body(""" { - "debitorUuid": "%s", - "bankAccountUuid": "%s", + "debitor.uuid": "%s", + "bankAccount.uuid": "%s", "reference": "temp ref CAT C", "agreement": "2022-10-12", "validFrom": "2022-10-13", @@ -241,8 +241,8 @@ class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCl .contentType(ContentType.JSON) .body(""" { - "debitorUuid": "%s", - "bankAccountUuid": "%s", + "debitor.uuid": "%s", + "bankAccount.uuid": "%s", "reference": "temp refCAT D", "agreement": "2022-10-12", "validFrom": "2022-10-13", diff --git a/src/test/java/net/hostsharing/hsadminng/rbac/grant/RbacGrantControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/rbac/grant/RbacGrantControllerAcceptanceTest.java index 5906f3e3..0dff3e75 100644 --- a/src/test/java/net/hostsharing/hsadminng/rbac/grant/RbacGrantControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/rbac/grant/RbacGrantControllerAcceptanceTest.java @@ -388,8 +388,8 @@ class RbacGrantControllerAcceptanceTest extends ContextBasedTest { .body(""" { "assumed": true, - "grantedRoleUuid": "%s", - "granteeSubjectUuid": "%s" + "grantedRole.uuid": "%s", + "granteeSubject.uuid": "%s" } """.formatted( grantedRole.getUuid(), @@ -424,8 +424,8 @@ class RbacGrantControllerAcceptanceTest extends ContextBasedTest { .body(""" { "assumed": true, - "grantedRoleUuid": "%s", - "granteeSubjectUuid": "%s" + "grantedRole.uuid": "%s", + "granteeSubject.uuid": "%s" } """.formatted( grantedRole.getUuid(), diff --git a/src/test/java/net/hostsharing/hsadminng/rbac/role/RbacRoleControllerRestTest.java b/src/test/java/net/hostsharing/hsadminng/rbac/role/RbacRoleControllerRestTest.java index 0f1abce6..a9f09345 100644 --- a/src/test/java/net/hostsharing/hsadminng/rbac/role/RbacRoleControllerRestTest.java +++ b/src/test/java/net/hostsharing/hsadminng/rbac/role/RbacRoleControllerRestTest.java @@ -76,8 +76,8 @@ class RbacRoleControllerRestTest { .andExpect(jsonPath("$[1].roleName", is("rbactest.customer#xxx:OWNER"))) .andExpect(jsonPath("$[2].roleName", is("rbactest.customer#xxx:ADMIN"))) .andExpect(jsonPath("$[2].uuid", is(customerXxxAdmin.getUuid().toString()))) - .andExpect(jsonPath("$[2].objectUuid", is(customerXxxAdmin.getObjectUuid().toString()))) - .andExpect(jsonPath("$[2].objectTable", is(customerXxxAdmin.getObjectTable().toString()))) - .andExpect(jsonPath("$[2].objectIdName", is(customerXxxAdmin.getObjectIdName().toString()))); + .andExpect(jsonPath("$[2].['object.uuid']", is(customerXxxAdmin.getObjectUuid().toString()))) + .andExpect(jsonPath("$[2].objectTable", is(customerXxxAdmin.getObjectTable()))) + .andExpect(jsonPath("$[2].objectIdName", is(customerXxxAdmin.getObjectIdName()))); } }