From 8f4ee5f16b69fec4100ee9e38087f6c595553607 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 28 Nov 2024 07:35:05 +0100 Subject: [PATCH 1/7] extract generic ScenarioTest-code to separate directory --- .../hs/office/scenarios/HsOfficeScenarioTests.java | 3 +++ .../scenarios/contact/AddPhoneNumberToContactData.java | 4 ++-- .../hs/office/scenarios/contact/AmendContactData.java | 4 ++-- .../contact/RemovePhoneNumberFromContactData.java | 4 ++-- .../hs/office/scenarios/contact/ReplaceContactData.java | 4 ++-- .../debitor/CreateExternalDebitorForPartner.java | 4 ++-- .../scenarios/debitor/CreateSelfDebitorForPartner.java | 4 ++-- .../scenarios/debitor/CreateSepaMandateForDebitor.java | 4 ++-- .../hs/office/scenarios/debitor/DeleteDebitor.java | 4 ++-- .../scenarios/debitor/DontDeleteDefaultDebitor.java | 4 ++-- .../debitor/FinallyDeleteSepaMandateForDebitor.java | 4 ++-- .../debitor/InvalidateSepaMandateForDebitor.java | 4 ++-- .../hs/office/scenarios/membership/CancelMembership.java | 4 ++-- .../hs/office/scenarios/membership/CreateMembership.java | 4 ++-- .../coopassets/CreateCoopAssetsDepositTransaction.java | 2 +- .../coopassets/CreateCoopAssetsDisbursalTransaction.java | 2 +- .../CreateCoopAssetsRevertSimpleTransaction.java | 2 +- .../CreateCoopAssetsRevertTransferTransaction.java | 6 +++--- .../coopassets/CreateCoopAssetsTransaction.java | 4 ++-- .../coopassets/CreateCoopAssetsTransferTransaction.java | 4 ++-- .../CreateCoopSharesCancellationTransaction.java | 2 +- .../coopshares/CreateCoopSharesRevertTransaction.java | 2 +- .../CreateCoopSharesSubscriptionTransaction.java | 2 +- .../coopshares/CreateCoopSharesTransaction.java | 4 ++-- .../scenarios/partner/AddOperationsContactToPartner.java | 4 ++-- .../scenarios/partner/AddRepresentativeToPartner.java | 4 ++-- .../hs/office/scenarios/partner/CreatePartner.java | 4 ++-- .../hs/office/scenarios/partner/DeletePartner.java | 4 ++-- .../hs/office/scenarios/person/CreatePerson.java | 4 ++-- .../office/scenarios/person/ShouldUpdatePersonData.java | 4 ++-- .../subscription/RemoveOperationsContactFromPartner.java | 4 ++-- .../scenarios/subscription/SubscribeToMailinglist.java | 4 ++-- .../subscription/UnsubscribeFromMailinglist.java | 4 ++-- .../{hs/office => test}/scenarios/JsonOptional.java | 2 +- .../{hs/office => test}/scenarios/PathAssertion.java | 6 +++--- .../hsadminng/{hs/office => test}/scenarios/Produces.java | 2 +- .../hsadminng/{hs/office => test}/scenarios/README.md | 0 .../hsadminng/{hs/office => test}/scenarios/Requires.java | 2 +- .../{hs/office => test}/scenarios/ScenarioTest.java | 8 ++++---- .../{hs/office => test}/scenarios/TemplateResolver.java | 4 ++-- .../scenarios/TemplateResolverUnitTest.java | 4 ++-- .../{hs/office => test}/scenarios/TestReport.java | 2 +- .../hsadminng/{hs/office => test}/scenarios/UseCase.java | 8 ++++---- .../scenarios/UseCaseNotImplementedYet.java | 2 +- 44 files changed, 82 insertions(+), 79 deletions(-) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/JsonOptional.java (95%) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/PathAssertion.java (84%) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/Produces.java (90%) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/README.md (100%) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/Requires.java (83%) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/ScenarioTest.java (95%) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/TemplateResolver.java (98%) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/TemplateResolverUnitTest.java (92%) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/TestReport.java (99%) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/UseCase.java (98%) rename src/test/java/net/hostsharing/hsadminng/{hs/office => test}/scenarios/UseCaseNotImplementedYet.java (87%) 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 eecd0a4f..90220a20 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 @@ -30,6 +30,9 @@ import net.hostsharing.hsadminng.hs.office.scenarios.person.ShouldUpdatePersonDa 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; +import net.hostsharing.hsadminng.test.scenarios.Produces; +import net.hostsharing.hsadminng.test.scenarios.Requires; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.test.IgnoreOnFailureExtension; import org.junit.jupiter.api.Disabled; 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 5f8d266d..55530031 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.contact; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java index 0c0e3021..96b075e8 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.contact; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 715e1832..10e54445 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.contact; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 2638a4e5..7309d095 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.contact; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.CREATED; 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 cf525c30..2e160573 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import net.hostsharing.hsadminng.hs.office.scenarios.person.CreatePerson; import static io.restassured.http.ContentType.JSON; 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 41b40ee6..763eefb3 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.CREATED; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandateForDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandateForDebitor.java index 549848f1..0651665b 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandateForDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandateForDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.CREATED; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DeleteDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DeleteDebitor.java index 84e9cd30..8b87086a 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DeleteDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DeleteDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; public class DeleteDebitor extends UseCase { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DontDeleteDefaultDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DontDeleteDefaultDebitor.java index e5459c88..4a72837e 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DontDeleteDefaultDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DontDeleteDefaultDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; public class DontDeleteDefaultDebitor extends UseCase { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/FinallyDeleteSepaMandateForDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/FinallyDeleteSepaMandateForDebitor.java index 224a98f3..82d90ed3 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/FinallyDeleteSepaMandateForDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/FinallyDeleteSepaMandateForDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/InvalidateSepaMandateForDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/InvalidateSepaMandateForDebitor.java index 3af160c7..55241a09 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/InvalidateSepaMandateForDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/InvalidateSepaMandateForDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.OK; 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 index 23f718b5..a93106eb 100644 --- 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 @@ -1,8 +1,8 @@ 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 net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 890dfedf..40ab5dc7 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 @@ -1,8 +1,8 @@ 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 net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDepositTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDepositTransaction.java index af9b01a1..aab9b9c8 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDepositTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDepositTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; public class CreateCoopAssetsDepositTransaction extends CreateCoopAssetsTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDisbursalTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDisbursalTransaction.java index 542f75d8..627b582b 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDisbursalTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDisbursalTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; public class CreateCoopAssetsDisbursalTransaction extends CreateCoopAssetsTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertSimpleTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertSimpleTransaction.java index 0ba384a1..c5f2177f 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertSimpleTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertSimpleTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; public class CreateCoopAssetsRevertSimpleTransaction extends CreateCoopAssetsTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertTransferTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertTransferTransaction.java index 56ca670c..86c3b701 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertTransferTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertTransferTransaction.java @@ -1,13 +1,13 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; import java.math.BigDecimal; -import static net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest.resolveTyped; +import static net.hostsharing.hsadminng.test.scenarios.ScenarioTest.resolveTyped; public class CreateCoopAssetsRevertTransferTransaction extends CreateCoopAssetsTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransaction.java index fbe4b8d5..8eecdabf 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransaction.java @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java index 9cfe871f..faf3779d 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java @@ -1,10 +1,10 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import net.hostsharing.hsadminng.hs.office.scenarios.membership.CreateMembership; import net.hostsharing.hsadminng.hs.office.scenarios.partner.CreatePartner; -import static net.hostsharing.hsadminng.hs.office.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; public class CreateCoopAssetsTransferTransaction extends CreateCoopAssetsTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesCancellationTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesCancellationTransaction.java index 16549b36..fb88c3ac 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesCancellationTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesCancellationTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; public class CreateCoopSharesCancellationTransaction extends CreateCoopSharesTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesRevertTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesRevertTransaction.java index 8464393a..18c0654e 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesRevertTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesRevertTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; public class CreateCoopSharesRevertTransaction extends CreateCoopSharesTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesSubscriptionTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesSubscriptionTransaction.java index 84db07dd..395d5d26 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesSubscriptionTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesSubscriptionTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; public class CreateCoopSharesSubscriptionTransaction extends CreateCoopSharesTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesTransaction.java index cd8d9c14..5e82b3aa 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesTransaction.java @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares; 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.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 f862c782..fe703e34 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 @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.partner; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 0e4a28c5..d5ffa22f 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.ScenarioTest; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 3896bbf6..e587ac3c 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 @@ -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.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/DeletePartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/DeletePartner.java index 4453d959..8d02d2a0 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/DeletePartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/DeletePartner.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.partner; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; public class DeletePartner extends UseCase { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/CreatePerson.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/CreatePerson.java index 4a43503c..5a4bf987 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/CreatePerson.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/CreatePerson.java @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.person; 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.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; public class CreatePerson extends UseCase { 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 index 04a61c5f..f1472005 100644 --- 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 @@ -1,7 +1,7 @@ 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 net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 2190e6d9..42b9f45f 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.subscription; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.NOT_FOUND; 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 7cca9ba4..7b5acaf4 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 @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.subscription; 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.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/UnsubscribeFromMailinglist.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/UnsubscribeFromMailinglist.java index dfb17ea1..99c63ca9 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/UnsubscribeFromMailinglist.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/UnsubscribeFromMailinglist.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.subscription; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase; -import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.NO_CONTENT; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/JsonOptional.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/JsonOptional.java similarity index 95% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/JsonOptional.java rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/JsonOptional.java index 2a169fe2..c4f3a71e 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/JsonOptional.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/JsonOptional.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.hs.office.scenarios; +package net.hostsharing.hsadminng.test.scenarios; public final class JsonOptional { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/PathAssertion.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/PathAssertion.java similarity index 84% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/PathAssertion.java rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/PathAssertion.java index e7aac280..fec91e2a 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/PathAssertion.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/PathAssertion.java @@ -1,10 +1,10 @@ -package net.hostsharing.hsadminng.hs.office.scenarios; +package net.hostsharing.hsadminng.test.scenarios; -import net.hostsharing.hsadminng.hs.office.scenarios.UseCase.HttpResponse; +import net.hostsharing.hsadminng.test.scenarios.UseCase.HttpResponse; import java.util.function.Consumer; -import static net.hostsharing.hsadminng.hs.office.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; import static org.junit.jupiter.api.Assertions.fail; public class PathAssertion { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/Produces.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/Produces.java similarity index 90% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/Produces.java rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/Produces.java index 5d24fd2c..9acdd3ab 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/Produces.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/Produces.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.hs.office.scenarios; +package net.hostsharing.hsadminng.test.scenarios; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/README.md b/src/test/java/net/hostsharing/hsadminng/test/scenarios/README.md similarity index 100% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/README.md rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/README.md diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/Requires.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/Requires.java similarity index 83% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/Requires.java rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/Requires.java index 59ea21ec..fa691c31 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/Requires.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/Requires.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.hs.office.scenarios; +package net.hostsharing.hsadminng.test.scenarios; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/ScenarioTest.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java similarity index 95% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/ScenarioTest.java rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java index 4e3557eb..d996d12b 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/ScenarioTest.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java @@ -1,9 +1,9 @@ -package net.hostsharing.hsadminng.hs.office.scenarios; +package net.hostsharing.hsadminng.test.scenarios; import lombok.SneakyThrows; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; -import net.hostsharing.hsadminng.hs.office.scenarios.TemplateResolver.Resolver; +import net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver; import net.hostsharing.hsadminng.lambda.Reducer; import net.hostsharing.hsadminng.rbac.context.ContextBasedTest; import net.hostsharing.hsadminng.rbac.test.JpaAttempt; @@ -28,8 +28,7 @@ import java.util.stream.Collectors; import static java.util.Arrays.asList; import static java.util.Optional.ofNullable; -import static net.hostsharing.hsadminng.hs.office.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; -import static net.hostsharing.hsadminng.hs.office.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; import static org.assertj.core.api.Assertions.assertThat; public abstract class ScenarioTest extends ContextBasedTest { @@ -120,6 +119,7 @@ public abstract class ScenarioTest extends ContextBasedTest { callRequiredProducers(potentialProducerMethod); // and finally we call the producer method + potentialProducerMethod.setAccessible(true); potentialProducerMethod.invoke(this); } // @formatter:on diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TemplateResolver.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolver.java similarity index 98% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TemplateResolver.java rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolver.java index 002d0512..27ecc4cf 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TemplateResolver.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolver.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.hs.office.scenarios; +package net.hostsharing.hsadminng.test.scenarios; import org.apache.commons.lang3.StringUtils; @@ -10,7 +10,7 @@ import java.util.Objects; import java.util.regex.Pattern; import java.util.stream.Collectors; -import static net.hostsharing.hsadminng.hs.office.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; public class TemplateResolver { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TemplateResolverUnitTest.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolverUnitTest.java similarity index 92% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TemplateResolverUnitTest.java rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolverUnitTest.java index 435d44d3..babdb32e 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TemplateResolverUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolverUnitTest.java @@ -1,10 +1,10 @@ -package net.hostsharing.hsadminng.hs.office.scenarios; +package net.hostsharing.hsadminng.test.scenarios; import org.junit.jupiter.api.Test; import java.util.Map; -import static net.hostsharing.hsadminng.hs.office.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; import static org.assertj.core.api.Assertions.assertThat; class TemplateResolverUnitTest { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TestReport.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/TestReport.java similarity index 99% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TestReport.java rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/TestReport.java index f0b47bcc..6dd39447 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TestReport.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/TestReport.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.hs.office.scenarios; +package net.hostsharing.hsadminng.test.scenarios; import lombok.SneakyThrows; import net.hostsharing.hsadminng.system.SystemProcess; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/UseCase.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java similarity index 98% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/UseCase.java rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java index 58d76759..8f1eaf1a 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/UseCase.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.hs.office.scenarios; +package net.hostsharing.hsadminng.test.scenarios; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -35,8 +35,8 @@ import java.util.function.Supplier; import static java.net.URLEncoder.encode; import static java.util.stream.Collectors.joining; -import static net.hostsharing.hsadminng.hs.office.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; -import static net.hostsharing.hsadminng.hs.office.scenarios.TemplateResolver.Resolver.KEEP_COMMENTS; +import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.KEEP_COMMENTS; import static net.hostsharing.hsadminng.test.DebuggerDetection.isDebuggerAttached; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.fail; @@ -113,7 +113,7 @@ public abstract class UseCase> { } public final UseCase given(final String propName, final Object propValue) { - givenProperties.put(propName, ScenarioTest.resolve(propValue == null ? null : propValue.toString(), KEEP_COMMENTS)); + givenProperties.put(propName, ScenarioTest.resolve(propValue == null ? null : propValue.toString(), TemplateResolver.Resolver.KEEP_COMMENTS)); ScenarioTest.putProperty(propName, propValue); return this; } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/UseCaseNotImplementedYet.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCaseNotImplementedYet.java similarity index 87% rename from src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/UseCaseNotImplementedYet.java rename to src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCaseNotImplementedYet.java index d21d6413..7f323165 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/UseCaseNotImplementedYet.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCaseNotImplementedYet.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.hs.office.scenarios; +package net.hostsharing.hsadminng.test.scenarios; import static org.assertj.core.api.Assumptions.assumeThat; -- 2.39.5 From b45639878ed360ef245ae3f12a967686f553fc53 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 28 Nov 2024 15:04:20 +0100 Subject: [PATCH 2/7] refactor scenario-tests into inner classes --- .../hs/migration/BaseOfficeDataImport.java | 12 +- .../scenarios/HsOfficeScenarioTests.java | 869 ++++++++++-------- .../test/scenarios/ScenarioTest.java | 88 +- 3 files changed, 535 insertions(+), 434 deletions(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java b/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java index 3ab17692..ed97041f 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java @@ -880,17 +880,19 @@ public abstract class BaseOfficeDataImport extends CsvDataImport { coopAssets.put(rec.getInteger("member_asset_id"), assetTransaction); }); - coopAssets.values().forEach(assetTransaction -> { + coopAssets.entrySet().forEach(entry -> { + final var legacyId = entry.getKey(); + final var assetTransaction = entry.getValue(); if (assetTransaction.getTransactionType() == HsOfficeCoopAssetsTransactionType.REVERSAL) { - connectToRelatedRevertedAssetTx(assetTransaction); + connectToRelatedRevertedAssetTx(legacyId, assetTransaction); } if (assetTransaction.getTransactionType() == HsOfficeCoopAssetsTransactionType.TRANSFER) { - connectToRelatedAdoptionAssetTx(assetTransaction); + connectToRelatedAdoptionAssetTx(legacyId, assetTransaction); } }); } - private static void connectToRelatedRevertedAssetTx(final HsOfficeCoopAssetsTransactionEntity assetTransaction) { + private static void connectToRelatedRevertedAssetTx(final int legacyId, final HsOfficeCoopAssetsTransactionEntity assetTransaction) { final var negativeValue = assetTransaction.getAssetValue().negate(); final var revertedAssetTx = coopAssets.values().stream().filter(a -> a.getTransactionType() != HsOfficeCoopAssetsTransactionType.REVERSAL && @@ -903,7 +905,7 @@ public abstract class BaseOfficeDataImport extends CsvDataImport { //revertedAssetTx.setAssetReversalTx(assetTransaction); } - private static void connectToRelatedAdoptionAssetTx(final HsOfficeCoopAssetsTransactionEntity assetTransaction) { + private static void connectToRelatedAdoptionAssetTx(final Integer legacyId, final HsOfficeCoopAssetsTransactionEntity assetTransaction) { final var negativeValue = assetTransaction.getAssetValue().negate(); final var adoptionAssetTx = coopAssets.values().stream().filter(a -> a.getTransactionType() == HsOfficeCoopAssetsTransactionType.ADOPTION && 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 90220a20..d59bfc89 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 @@ -35,11 +35,14 @@ import net.hostsharing.hsadminng.test.scenarios.Requires; import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.test.IgnoreOnFailureExtension; +import org.junit.jupiter.api.ClassOrderer; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestClassOrder; import org.junit.jupiter.api.TestMethodOrder; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.test.context.SpringBootTest; @@ -56,431 +59,487 @@ import org.springframework.test.annotation.DirtiesContext; "hsadminng.superuser=${HSADMINNG_SUPERUSER:superuser-alex@hostsharing.net}" } ) -@DirtiesContext -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +//@DirtiesContext +@TestClassOrder(ClassOrderer.OrderAnnotation.class) @ExtendWith(IgnoreOnFailureExtension.class) class HsOfficeScenarioTests extends ScenarioTest { - @Test - @Order(1010) - @Produces(explicitly = "Partner: P-31010 - Test AG", implicitly = { "Person: Test AG", "Contact: Test AG - Hamburg" }) - void shouldCreateLegalPersonAsPartner() { - new CreatePartner(this) - .given("partnerNumber", "P-31010") - .given("personType", "LEGAL_PERSON") - .given("tradeName", "Test AG") - .given("contactCaption", "Test AG - Hamburg") - .given("postalAddress", """ - "firm": "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") - .doRun() - .keep(); + @Nested + @Order(10) + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) + class PartnerScenarios { + + @Test + @Order(1010) + @Produces(explicitly = "Partner: P-31010 - Test AG", implicitly = { "Person: Test AG", "Contact: Test AG - Hamburg" }) + void shouldCreateLegalPersonAsPartner() { + new CreatePartner(scenarioTest) + .given("partnerNumber", "P-31010") + .given("personType", "LEGAL_PERSON") + .given("tradeName", "Test AG") + .given("contactCaption", "Test AG - Hamburg") + .given( + "postalAddress", """ + "firm": "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") + .doRun() + .keep(); + } + + @Test + @Order(1011) + @Produces(explicitly = "Partner: P-31011 - Michelle Matthieu", + implicitly = { "Person: Michelle Matthieu", "Contact: Michelle Matthieu" }) + void shouldCreateNaturalPersonAsPartner() { + new CreatePartner(scenarioTest) + .given("partnerNumber", "P-31011") + .given("personType", "NATURAL_PERSON") + .given("givenName", "Michelle") + .given("familyName", "Matthieu") + .given("contactCaption", "Michelle Matthieu") + .given( + "postalAddress", """ + "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") + .doRun() + .keep(); + } + + @Test + @Order(1020) + @Requires("Person: Test AG") + @Produces("Representative: Tracy Trust for Test AG") + void shouldAddRepresentativeToPartner() { + new AddRepresentativeToPartner(scenarioTest) + .given("partnerPersonTradeName", "Test AG") + .given("representativeFamilyName", "Trust") + .given("representativeGivenName", "Tracy") + .given( + "representativePostalAddress", """ + "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") + .doRun() + .keep(); + } + + @Test + @Order(1030) + @Requires("Person: Test AG") + @Produces("Operations-Contact: Dennis Krause for Test AG") + void shouldAddOperationsContactToPartner() { + new AddOperationsContactToPartner(scenarioTest) + .given("partnerPersonTradeName", "Test AG") + .given("operationsContactFamilyName", "Krause") + .given("operationsContactGivenName", "Dennis") + .given("operationsContactPhoneNumber", "+49 9932 587741") + .given("operationsContactEMailAddress", "dennis.krause@example.org") + .doRun() + .keep(); + } + + @Test + @Order(1039) + @Requires("Operations-Contact: Dennis Krause for Test AG") + void shouldRemoveOperationsContactFromPartner() { + new RemoveOperationsContactFromPartner(scenarioTest) + .given("operationsContactPerson", "Dennis Krause") + .doRun(); + } + + @Test + @Order(1090) + void shouldDeletePartner() { + new DeletePartner(scenarioTest) + .given("partnerNumber", "P-31020") + .doRun(); + } } - @Test - @Order(1011) - @Produces(explicitly = "Partner: P-31011 - Michelle Matthieu", - implicitly = { "Person: Michelle Matthieu", "Contact: Michelle Matthieu" }) - void shouldCreateNaturalPersonAsPartner() { - new CreatePartner(this) - .given("partnerNumber", "P-31011") - .given("personType", "NATURAL_PERSON") - .given("givenName", "Michelle") - .given("familyName", "Matthieu") - .given("contactCaption", "Michelle Matthieu") - .given("postalAddress", """ - "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") - .doRun() - .keep(); + @Nested + @Order(11) + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) + class PartnerContactScenarios { + + @Test + @Order(1100) + @Requires("Partner: P-31011 - Michelle Matthieu") + void shouldAmendContactData() { + new AmendContactData(scenarioTest) + .given("partnerName", "Matthieu") + .given("newEmailAddress", "michelle@matthieu.example.org") + .doRun(); + } + + @Test + @Order(1101) + @Requires("Partner: P-31011 - Michelle Matthieu") + void shouldAddPhoneNumberToContactData() { + new AddPhoneNumberToContactData(scenarioTest) + .given("partnerName", "Matthieu") + .given("phoneNumberKeyToAdd", "mobile") + .given("phoneNumberToAdd", "+49 152 1234567") + .doRun(); + } + + @Test + @Order(1102) + @Requires("Partner: P-31011 - Michelle Matthieu") + void shouldRemovePhoneNumberFromContactData() { + new RemovePhoneNumberFromContactData(scenarioTest) + .given("partnerName", "Matthieu") + .given("phoneNumberKeyToRemove", "office") + .doRun(); + } + + @Test + @Order(1103) + @Requires("Partner: P-31010 - Test AG") + void shouldReplaceContactData() { + new ReplaceContactData(scenarioTest) + .given("partnerName", "Test AG") + .given("newContactCaption", "Test AG - China") + .given("newPostalAddress", """ + "firm": "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(); + } } - @Test - @Order(1020) - @Requires("Person: Test AG") - @Produces("Representative: Tracy Trust for Test AG") - void shouldAddRepresentativeToPartner() { - new AddRepresentativeToPartner(this) - .given("partnerPersonTradeName", "Test AG") - .given("representativeFamilyName", "Trust") - .given("representativeGivenName", "Tracy") - .given("representativePostalAddress", """ - "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") - .doRun() - .keep(); + @Nested + @Order(12) + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) + class PartnerPersonScenarios { + + @Test + @Order(1201) + @Requires("Partner: P-31011 - Michelle Matthieu") + void shouldUpdatePersonData() { + new ShouldUpdatePersonData(scenarioTest) + .given("oldFamilyName", "Matthieu") + .given("newFamilyName", "Matthieu-Zhang") + .doRun(); + } } - @Test - @Order(1030) - @Requires("Person: Test AG") - @Produces("Operations-Contact: Dennis Krause for Test AG") - void shouldAddOperationsContactToPartner() { - new AddOperationsContactToPartner(this) - .given("partnerPersonTradeName", "Test AG") - .given("operationsContactFamilyName", "Krause") - .given("operationsContactGivenName", "Dennis") - .given("operationsContactPhoneNumber", "+49 9932 587741") - .given("operationsContactEMailAddress", "dennis.krause@example.org") - .doRun() - .keep(); + @Nested + @Order(20) + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) + class DebitorScenarios { + @Test + @Order(2010) + @Requires("Partner: P-31010 - Test AG") + @Produces("Debitor: D-3101000 - Test AG - main debitor") + void shouldCreateSelfDebitorForPartner() { + new CreateSelfDebitorForPartner(scenarioTest) + .given("partnerPersonTradeName", "Test AG") + .given("billingContactCaption", "Test AG - billing department") + .given("billingContactEmailAddress", "billing@test-ag.example.org") + .given("debitorNumberSuffix", "00") // TODO.impl: could be assigned automatically, but is not yet + .given("billable", true) + .given("vatId", "VAT123456") + .given("vatCountryCode", "DE") + .given("vatBusiness", true) + .given("vatReverseCharge", false) + .given("defaultPrefix", "tst") + .doRun() + .keep(); + } + + @Test + @Order(2011) + @Requires("Person: Test AG") + @Produces("Debitor: D-3101001 - Test AG - main debitor") + void shouldCreateExternalDebitorForPartner() { + new CreateExternalDebitorForPartner(scenarioTest) + .given("partnerPersonTradeName", "Test AG") + .given("billingContactCaption", "Billing GmbH - billing department") + .given("billingContactEmailAddress", "billing@test-ag.example.org") + .given("debitorNumberSuffix", "01") + .given("billable", true) + .given("vatId", "VAT123456") + .given("vatCountryCode", "DE") + .given("vatBusiness", true) + .given("vatReverseCharge", false) + .given("defaultPrefix", "tsx") + .doRun() + .keep(); + } + + @Test + @Order(2020) + @Requires("Person: Test AG") + @Produces(explicitly = "Debitor: D-3101000 - Test AG - delete debitor", permanent = false) + void shouldDeleteDebitor() { + new DeleteDebitor(scenarioTest) + .given("partnerNumber", "P-31020") + .given("debitorSuffix", "02") + .doRun(); + } + + @Test + @Order(2020) + @Requires("Debitor: D-3101000 - Test AG - main debitor") + @Disabled("see TODO.spec in DontDeleteDefaultDebitor") + void shouldNotDeleteDefaultDebitor() { + new DontDeleteDefaultDebitor(scenarioTest) + .given("partnerNumber", "P-31010") + .given("debitorSuffix", "00") + .doRun(); + } } - @Test - @Order(1039) - @Requires("Operations-Contact: Dennis Krause for Test AG") - void shouldRemoveOperationsContactFromPartner() { - new RemoveOperationsContactFromPartner(this) - .given("operationsContactPerson", "Dennis Krause") - .doRun(); + @Nested + @Order(31) + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) + class SepaMandateScenarios { + + @Test + @Order(3100) + @Requires("Debitor: D-3101000 - Test AG - main debitor") + @Produces("SEPA-Mandate: Test AG") + void shouldCreateSepaMandateForDebitor() { + new CreateSepaMandateForDebitor(scenarioTest) + // existing debitor + .given("debitorNumber", "D-3101000") + + // new sepa-mandate + .given("mandateReference", "Test AG - main debitor") + .given("mandateAgreement", "2022-10-12") + .given("mandateValidFrom", "2024-10-15") + + // new bank-account + .given("bankAccountHolder", "Test AG - debit bank account") + .given("bankAccountIBAN", "DE02701500000000594937") + .given("bankAccountBIC", "SSKMDEMM") + .doRun() + .keep(); + } + + @Test + @Order(3108) + @Requires("SEPA-Mandate: Test AG") + void shouldInvalidateSepaMandateForDebitor() { + new InvalidateSepaMandateForDebitor(scenarioTest) + .given("bankAccountIBAN", "DE02701500000000594937") + .given("mandateValidUntil", "2025-09-30") + .doRun(); + } + + @Test + @Order(3109) + @Requires("SEPA-Mandate: Test AG") + void shouldFinallyDeleteSepaMandateForDebitor() { + new FinallyDeleteSepaMandateForDebitor(scenarioTest) + .given("bankAccountIBAN", "DE02701500000000594937") + .doRun(); + } } - @Test - @Order(1090) - void shouldDeletePartner() { - new DeletePartner(this) - .given("partnerNumber", "P-31020") - .doRun(); + @Nested + @Order(40) + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) + class MembershipScenarios { + + @Test + @Order(4000) + @Requires("Partner: P-31010 - Test AG") + @Produces("Membership: M-3101000 - Test AG") + void shouldCreateMembershipForPartner() { + new CreateMembership(scenarioTest) + .given("partnerName", "Test AG") + .given("validFrom", "2024-10-15") + .given("newStatus", "ACTIVE") + .given("membershipFeeBillable", "true") + .doRun() + .keep(); + } + + @Test + @Order(4090) + @Requires("Membership: M-3101000 - Test AG") + void shouldCancelMembershipOfPartner() { + new CancelMembership(scenarioTest) + .given("memberNumber", "M-3101000") + .given("validTo", "2025-12-30") + .given("newStatus", "CANCELLED") + .doRun(); + } } - @Test - @Order(1100) - @Requires("Partner: P-31011 - Michelle Matthieu") - void shouldAmendContactData() { - new AmendContactData(this) - .given("partnerName", "Matthieu") - .given("newEmailAddress", "michelle@matthieu.example.org") - .doRun(); + @Nested + @Order(42) + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) + class CoopSharesScenarios { + + @Test + @Order(4201) + @Requires("Membership: M-3101000 - Test AG") + @Produces("Coop-Shares M-3101000 - Test AG - SUBSCRIPTION Transaction") + void shouldSubscribeCoopShares() { + new CreateCoopSharesSubscriptionTransaction(scenarioTest) + .given("memberNumber", "M-3101000") + .given("reference", "sign 2024-01-15") + .given("shareCount", 100) + .given("comment", "Signing the Membership") + .given("transactionDate", "2024-01-15") + .doRun(); + } + + @Test + @Order(4202) + @Requires("Membership: M-3101000 - Test AG") + void shouldRevertCoopSharesSubscription() { + new CreateCoopSharesRevertTransaction(scenarioTest) + .given("memberNumber", "M-3101000") + .given("comment", "reverting some incorrect transaction") + .given("dateOfIncorrectTransaction", "2024-02-15") + .doRun(); + } + + @Test + @Order(4202) + @Requires("Coop-Shares M-3101000 - Test AG - SUBSCRIPTION Transaction") + @Produces("Coop-Shares M-3101000 - Test AG - CANCELLATION Transaction") + void shouldCancelCoopSharesSubscription() { + new CreateCoopSharesCancellationTransaction(scenarioTest) + .given("memberNumber", "M-3101000") + .given("reference", "cancel 2024-01-15") + .given("sharesToCancel", 8) + .given("comment", "Cancelling 8 Shares") + .given("transactionDate", "2024-02-15") + .doRun(); + } } - @Test - @Order(1101) - @Requires("Partner: P-31011 - Michelle Matthieu") - void shouldAddPhoneNumberToContactData() { - new AddPhoneNumberToContactData(this) - .given("partnerName", "Matthieu") - .given("phoneNumberKeyToAdd", "mobile") - .given("phoneNumberToAdd", "+49 152 1234567") - .doRun(); + @Nested + @Order(43) + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) + class CoopAssetsScenarios { + + @Test + @Order(4301) + @Requires("Membership: M-3101000 - Test AG") + @Produces("Coop-Assets M-3101000 - Test AG - DEPOSIT Transaction") + void shouldSubscribeCoopAssets() { + new CreateCoopAssetsDepositTransaction(scenarioTest) + .given("memberNumber", "M-3101000") + .given("reference", "sign 2024-01-15") + .given("assetValue", 100 * 64) + .given("comment", "disposal for initial shares") + .given("transactionDate", "2024-01-15") + .doRun(); + } + + @Test + @Order(4302) + @Requires("Membership: M-3101000 - Test AG") + void shouldRevertCoopAssetsSubscription() { + new CreateCoopAssetsRevertSimpleTransaction(scenarioTest) + .given("memberNumber", "M-3101000") + .given("comment", "reverting some incorrect transaction") + .given("dateOfIncorrectTransaction", "2024-02-15") + .doRun(); + } + + @Test + @Order(4303) + @Requires("Coop-Assets M-3101000 - Test AG - DEPOSIT Transaction") + @Produces("Coop-Assets M-3101000 - Test AG - DISBURSAL Transaction") + void shouldDisburseCoopAssets() { + new CreateCoopAssetsDisbursalTransaction(scenarioTest) + .given("memberNumber", "M-3101000") + .given("reference", "cancel 2024-01-15") + .given("valueToDisburse", 8 * 64) + .given("comment", "disbursal according to shares cancellation") + .given("transactionDate", "2024-02-15") + .doRun(); + } + + @Test + @Order(4304) + @Requires("Coop-Assets M-3101000 - Test AG - DEPOSIT Transaction") + @Produces(explicitly = "Coop-Assets M-3101000 - Test AG - TRANSFER Transaction", implicitly = "Membership M-4303000") + void shouldTransferCoopAssets() { + new CreateCoopAssetsTransferTransaction(scenarioTest) + .given("transferringMemberNumber", "M-3101000") + .given("adoptingMemberNumber", "M-4303000") + .given("reference", "transfer 2024-12-31") + .given("valueToTransfer", 2 * 64) + .given("comment", "transfer assets from M-3101000 to M-4303000") + .given("transactionDate", "2024-12-31") + .doRun(); + } + + @Test + @Order(4305) + @Requires("Membership M-4303000") + void shouldRevertCoopAssetsTransferIncludingRelatedAssetAdoption() { + new CreateCoopAssetsRevertTransferTransaction(scenarioTest) + .given("transferringMemberNumber", "M-3101000") + .given("adoptingMemberNumber", "M-4303000") + .given("transferredValue", 2 * 64) + .given("comment", "reverting some incorrect transfer transaction") + .given("dateOfIncorrectTransaction", "2024-02-15") + .doRun(); + } } - @Test - @Order(1102) - @Requires("Partner: P-31011 - Michelle Matthieu") - void shouldRemovePhoneNumberFromContactData() { - new RemovePhoneNumberFromContactData(this) - .given("partnerName", "Matthieu") - .given("phoneNumberKeyToRemove", "office") - .doRun(); - } + @Nested + @Order(50) + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) + class SubscriptionScenarios { - @Test - @Order(1103) - @Requires("Partner: P-31010 - Test AG") - void shouldReplaceContactData() { - new ReplaceContactData(this) - .given("partnerName", "Test AG") - .given("newContactCaption", "Test AG - China") - .given("newPostalAddress", """ - "firm": "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(); - } + @Test + @Order(5000) + @Requires("Person: Test AG") + @Produces("Subscription: Michael Miller to operations-announce") + void shouldSubscribeNewPersonAndContactToMailinglist() { + new SubscribeToMailinglist(scenarioTest) + // TODO.spec: do we need the personType? or is an operational contact always a natural person? what about distribution lists? + .given("partnerPersonTradeName", "Test AG") + .given("subscriberFamilyName", "Miller") + .given("subscriberGivenName", "Michael") + .given("subscriberEMailAddress", "michael.miller@example.org") + .given("mailingList", "operations-announce") + .doRun() + .keep(); + } - @Test - @Order(1201) - @Requires("Partner: P-31011 - Michelle Matthieu") - void shouldUpdatePersonData() { - new ShouldUpdatePersonData(this) - .given("oldFamilyName", "Matthieu") - .given("newFamilyName", "Matthieu-Zhang") - .doRun(); - } - - @Test - @Order(2010) - @Requires("Partner: P-31010 - Test AG") - @Produces("Debitor: D-3101000 - Test AG - main debitor") - void shouldCreateSelfDebitorForPartner() { - new CreateSelfDebitorForPartner(this) - .given("partnerPersonTradeName", "Test AG") - .given("billingContactCaption", "Test AG - billing department") - .given("billingContactEmailAddress", "billing@test-ag.example.org") - .given("debitorNumberSuffix", "00") // TODO.impl: could be assigned automatically, but is not yet - .given("billable", true) - .given("vatId", "VAT123456") - .given("vatCountryCode", "DE") - .given("vatBusiness", true) - .given("vatReverseCharge", false) - .given("defaultPrefix", "tst") - .doRun() - .keep(); - } - - @Test - @Order(2011) - @Requires("Person: Test AG") - @Produces("Debitor: D-3101001 - Test AG - main debitor") - void shouldCreateExternalDebitorForPartner() { - new CreateExternalDebitorForPartner(this) - .given("partnerPersonTradeName", "Test AG") - .given("billingContactCaption", "Billing GmbH - billing department") - .given("billingContactEmailAddress", "billing@test-ag.example.org") - .given("debitorNumberSuffix", "01") - .given("billable", true) - .given("vatId", "VAT123456") - .given("vatCountryCode", "DE") - .given("vatBusiness", true) - .given("vatReverseCharge", false) - .given("defaultPrefix", "tsx") - .doRun() - .keep(); - } - - @Test - @Order(2020) - @Requires("Person: Test AG") - @Produces(explicitly = "Debitor: D-3101000 - Test AG - delete debitor", permanent = false) - void shouldDeleteDebitor() { - new DeleteDebitor(this) - .given("partnerNumber", "P-31020") - .given("debitorSuffix", "02") - .doRun(); - } - - @Test - @Order(2020) - @Requires("Debitor: D-3101000 - Test AG - main debitor") - @Disabled("see TODO.spec in DontDeleteDefaultDebitor") - void shouldNotDeleteDefaultDebitor() { - new DontDeleteDefaultDebitor(this) - .given("partnerNumber", "P-31010") - .given("debitorSuffix", "00") - .doRun(); - } - - @Test - @Order(3100) - @Requires("Debitor: D-3101000 - Test AG - main debitor") - @Produces("SEPA-Mandate: Test AG") - void shouldCreateSepaMandateForDebitor() { - new CreateSepaMandateForDebitor(this) - // existing debitor - .given("debitorNumber", "D-3101000") - - // new sepa-mandate - .given("mandateReference", "Test AG - main debitor") - .given("mandateAgreement", "2022-10-12") - .given("mandateValidFrom", "2024-10-15") - - // new bank-account - .given("bankAccountHolder", "Test AG - debit bank account") - .given("bankAccountIBAN", "DE02701500000000594937") - .given("bankAccountBIC", "SSKMDEMM") - .doRun() - .keep(); - } - - @Test - @Order(3108) - @Requires("SEPA-Mandate: Test AG") - void shouldInvalidateSepaMandateForDebitor() { - new InvalidateSepaMandateForDebitor(this) - .given("bankAccountIBAN", "DE02701500000000594937") - .given("mandateValidUntil", "2025-09-30") - .doRun(); - } - - @Test - @Order(3109) - @Requires("SEPA-Mandate: Test AG") - void shouldFinallyDeleteSepaMandateForDebitor() { - new FinallyDeleteSepaMandateForDebitor(this) - .given("bankAccountIBAN", "DE02701500000000594937") - .doRun(); - } - - @Test - @Order(4000) - @Requires("Partner: P-31010 - Test AG") - @Produces("Membership: M-3101000 - Test AG") - void shouldCreateMembershipForPartner() { - new CreateMembership(this) - .given("partnerName", "Test AG") - .given("validFrom", "2024-10-15") - .given("newStatus", "ACTIVE") - .given("membershipFeeBillable", "true") - .doRun() - .keep(); - } - - @Test - @Order(4201) - @Requires("Membership: M-3101000 - Test AG") - @Produces("Coop-Shares M-3101000 - Test AG - SUBSCRIPTION Transaction") - void shouldSubscribeCoopShares() { - new CreateCoopSharesSubscriptionTransaction(this) - .given("memberNumber", "M-3101000") - .given("reference", "sign 2024-01-15") - .given("shareCount", 100) - .given("comment", "Signing the Membership") - .given("transactionDate", "2024-01-15") - .doRun(); - } - - @Test - @Order(4202) - @Requires("Membership: M-3101000 - Test AG") - void shouldRevertCoopSharesSubscription() { - new CreateCoopSharesRevertTransaction(this) - .given("memberNumber", "M-3101000") - .given("comment", "reverting some incorrect transaction") - .given("dateOfIncorrectTransaction", "2024-02-15") - .doRun(); - } - - @Test - @Order(4202) - @Requires("Coop-Shares M-3101000 - Test AG - SUBSCRIPTION Transaction") - @Produces("Coop-Shares M-3101000 - Test AG - CANCELLATION Transaction") - void shouldCancelCoopSharesSubscription() { - new CreateCoopSharesCancellationTransaction(this) - .given("memberNumber", "M-3101000") - .given("reference", "cancel 2024-01-15") - .given("sharesToCancel", 8) - .given("comment", "Cancelling 8 Shares") - .given("transactionDate", "2024-02-15") - .doRun(); - } - - @Test - @Order(4301) - @Requires("Membership: M-3101000 - Test AG") - @Produces("Coop-Assets M-3101000 - Test AG - DEPOSIT Transaction") - void shouldSubscribeCoopAssets() { - new CreateCoopAssetsDepositTransaction(this) - .given("memberNumber", "M-3101000") - .given("reference", "sign 2024-01-15") - .given("assetValue", 100 * 64) - .given("comment", "disposal for initial shares") - .given("transactionDate", "2024-01-15") - .doRun(); - } - - @Test - @Order(4302) - @Requires("Membership: M-3101000 - Test AG") - void shouldRevertCoopAssetsSubscription() { - new CreateCoopAssetsRevertSimpleTransaction(this) - .given("memberNumber", "M-3101000") - .given("comment", "reverting some incorrect transaction") - .given("dateOfIncorrectTransaction", "2024-02-15") - .doRun(); - } - - @Test - @Order(4303) - @Requires("Coop-Assets M-3101000 - Test AG - DEPOSIT Transaction") - @Produces("Coop-Assets M-3101000 - Test AG - DISBURSAL Transaction") - void shouldDisburseCoopAssets() { - new CreateCoopAssetsDisbursalTransaction(this) - .given("memberNumber", "M-3101000") - .given("reference", "cancel 2024-01-15") - .given("valueToDisburse", 8 * 64) - .given("comment", "disbursal according to shares cancellation") - .given("transactionDate", "2024-02-15") - .doRun(); - } - - @Test - @Order(4304) - @Requires("Coop-Assets M-3101000 - Test AG - DEPOSIT Transaction") - @Produces(explicitly = "Coop-Assets M-3101000 - Test AG - TRANSFER Transaction", implicitly = "Membership M-4303000") - void shouldTransferCoopAssets() { - new CreateCoopAssetsTransferTransaction(this) - .given("transferringMemberNumber", "M-3101000") - .given("adoptingMemberNumber", "M-4303000") - .given("reference", "transfer 2024-12-31") - .given("valueToTransfer", 2 * 64) - .given("comment", "transfer assets from M-3101000 to M-4303000") - .given("transactionDate", "2024-12-31") - .doRun(); - } - - @Test - @Order(4305) - @Requires("Membership M-4303000") - void shouldRevertCoopAssetsTransferIncludingRelatedAssetAdoption() { - new CreateCoopAssetsRevertTransferTransaction(this) - .given("transferringMemberNumber", "M-3101000") - .given("adoptingMemberNumber", "M-4303000") - .given("transferredValue", 2*64) - .given("comment", "reverting some incorrect transfer transaction") - .given("dateOfIncorrectTransaction", "2024-02-15") - .doRun(); - } - - @Test - @Order(4900) - @Requires("Membership: M-3101000 - Test AG") - void shouldCancelMembershipOfPartner() { - new CancelMembership(this) - .given("memberNumber", "M-3101000") - .given("validTo", "2025-12-30") - .given("newStatus", "CANCELLED") - .doRun(); - } - - @Test - @Order(5000) - @Requires("Person: Test AG") - @Produces("Subscription: Michael Miller to operations-announce") - void shouldSubscribeNewPersonAndContactToMailinglist() { - new SubscribeToMailinglist(this) - // TODO.spec: do we need the personType? or is an operational contact always a natural person? what about distribution lists? - .given("partnerPersonTradeName", "Test AG") - .given("subscriberFamilyName", "Miller") - .given("subscriberGivenName", "Michael") - .given("subscriberEMailAddress", "michael.miller@example.org") - .given("mailingList", "operations-announce") - .doRun() - .keep(); - } - - @Test - @Order(5001) - @Requires("Subscription: Michael Miller to operations-announce") - void shouldUnsubscribeNewPersonAndContactToMailinglist() { - new UnsubscribeFromMailinglist(this) - .given("mailingList", "operations-announce") - .given("subscriberEMailAddress", "michael.miller@example.org") - .doRun(); + @Test + @Order(5001) + @Requires("Subscription: Michael Miller to operations-announce") + void shouldUnsubscribeNewPersonAndContactToMailinglist() { + new UnsubscribeFromMailinglist(scenarioTest) + .given("mailingList", "operations-announce") + .given("subscriberEMailAddress", "michael.miller@example.org") + .doRun(); + } } } diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java index d996d12b..6944e245 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java @@ -3,11 +3,13 @@ package net.hostsharing.hsadminng.test.scenarios; import lombok.SneakyThrows; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; -import net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver; import net.hostsharing.hsadminng.lambda.Reducer; import net.hostsharing.hsadminng.rbac.context.ContextBasedTest; import net.hostsharing.hsadminng.rbac.test.JpaAttempt; +import net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver; import org.apache.commons.collections4.SetUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.TestInfo; @@ -15,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.web.server.LocalServerPort; import org.testcontainers.shaded.org.apache.commons.lang3.ObjectUtils; +import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.math.BigDecimal; import java.util.HashMap; @@ -25,8 +28,10 @@ import java.util.Optional; import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; +import java.util.stream.Stream; import static java.util.Arrays.asList; +import static java.util.Arrays.stream; import static java.util.Optional.ofNullable; import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; import static org.assertj.core.api.Assertions.assertThat; @@ -35,6 +40,8 @@ public abstract class ScenarioTest extends ContextBasedTest { final static String RUN_AS_USER = "superuser-alex@hostsharing.net"; // TODO.test: use global:AGENT when implemented + protected ScenarioTest scenarioTest = this; + record Alias>(Class useCase, UUID uuid) { @Override @@ -43,6 +50,7 @@ public abstract class ScenarioTest extends ContextBasedTest { } } + private final static Map> aliases = new HashMap<>(); private final static Map properties = new HashMap<>(); @@ -94,37 +102,67 @@ public abstract class ScenarioTest extends ContextBasedTest { @SneakyThrows private void callRequiredProducers(final Method currentTestMethod) { - final var testMethodRequired = Optional.of(currentTestMethod) + final var testMethodRequires = Optional.of(currentTestMethod) .map(m -> m.getAnnotation(Requires.class)) .map(Requires::value) .orElse(null); - if (testMethodRequired != null) { - for (Method potentialProducerMethod : getClass().getDeclaredMethods()) { + if (testMethodRequires != null) { + for (Method potentialProducerMethod : getPotentialProducerMethods()) { final var producesAnnot = potentialProducerMethod.getAnnotation(Produces.class); - if (producesAnnot != null) { - final var testMethodProduces = allOf( - producesAnnot.value(), - producesAnnot.explicitly(), - producesAnnot.implicitly()); - // @formatter:off - if ( // that method can produce something required - testMethodProduces.contains(testMethodRequired) && + final var testMethodProduces = allOf( + producesAnnot.value(), + producesAnnot.explicitly(), + producesAnnot.implicitly()); + // @formatter:off + if ( // that method can produce something required + testMethodProduces.contains(testMethodRequires) && - // and it does not produce anything we already have (would cause errors) - SetUtils.intersection(testMethodProduces, knowVariables().keySet()).isEmpty() - ) { - assertThat(producesAnnot.permanent()).as("cannot depend on non-permanent producer: " + potentialProducerMethod); + // and it does not produce anything we already have (would cause errors) + SetUtils.intersection(testMethodProduces, knowVariables().keySet()).isEmpty() + ) { + assertThat(producesAnnot.permanent()).as("cannot depend on non-permanent producer: " + potentialProducerMethod); - // then we recursively produce the pre-requisites of the producer method - callRequiredProducers(potentialProducerMethod); + // then we recursively produce the pre-requisites of the producer method + callRequiredProducers(potentialProducerMethod); - // and finally we call the producer method - potentialProducerMethod.setAccessible(true); - potentialProducerMethod.invoke(this); - } - // @formatter:on + // and finally we call the producer method + invokeProducerMethod(this, potentialProducerMethod); + + assertThat(knowVariables().containsKey(testMethodRequires)) + .as("@Producer(\"" + testMethodRequires + "\") did not produce") + .isTrue(); } + // @formatter:on } + + assertThat(knowVariables().containsKey(testMethodRequires)) + .as("no @Producer for @Required(\"" + testMethodRequires + "\") found") + .isTrue(); + } + } + + private Method @NotNull [] getPotentialProducerMethods() { + final var methodsDeclaredInOuterTestClass = stream(getClass().getDeclaredMethods()) + .filter(m -> m.getAnnotation(Produces.class) != null) + .toArray(Method[]::new); + final var methodsDeclaredInInnerTestClasses = stream(getClass().getDeclaredClasses()) + .map(Class::getDeclaredMethods).flatMap(Stream::of) + .filter(m -> m.getAnnotation(Produces.class) != null) + .toArray(Method[]::new); + return ArrayUtils.addAll(methodsDeclaredInOuterTestClass, methodsDeclaredInInnerTestClasses); + } + + @SneakyThrows + private void invokeProducerMethod(final ScenarioTest scenarioTest, final Method producerMethod) { + producerMethod.setAccessible(true); + if (producerMethod.getDeclaringClass() == scenarioTest.getClass()) { + producerMethod.invoke(this); + } else { + final var innerClassConstructor = producerMethod.getDeclaringClass() + .getDeclaredConstructor(scenarioTest.getClass()); + innerClassConstructor.setAccessible(true); + final var inner = innerClassConstructor.newInstance(this); + producerMethod.invoke(inner); } } @@ -146,7 +184,9 @@ public abstract class ScenarioTest extends ContextBasedTest { static UUID uuid(final String nameWithPlaceholders) { final var resolvedName = resolve(nameWithPlaceholders, DROP_COMMENTS); - final UUID alias = ofNullable(knowVariables().get(resolvedName)).filter(v -> v instanceof UUID).map(UUID.class::cast).orElse(null); + final UUID alias = ofNullable(knowVariables().get(resolvedName)).filter(v -> v instanceof UUID) + .map(UUID.class::cast) + .orElse(null); assertThat(alias).as("alias '" + resolvedName + "' not found in aliases nor in properties [" + knowVariables().keySet().stream().map(v -> "'" + v + "'").collect(Collectors.joining(", ")) + "]" ).isNotNull(); -- 2.39.5 From ad9ae3d766d894b58af6b330998ea74cb31aeb09 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 29 Nov 2024 09:44:14 +0100 Subject: [PATCH 3/7] also keep aliases from @Produces annotations --- .../scenarios/HsOfficeScenarioTests.java | 1 - .../test/scenarios/ScenarioTest.java | 31 +++++++++++++++++-- .../hsadminng/test/scenarios/UseCase.java | 8 +++++ 3 files changed, 36 insertions(+), 4 deletions(-) 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 d59bfc89..52a45ad4 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 @@ -46,7 +46,6 @@ import org.junit.jupiter.api.TestClassOrder; import org.junit.jupiter.api.TestMethodOrder; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.annotation.DirtiesContext; @Tag("scenarioTest") @SpringBootTest( diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java index 6944e245..e23fc584 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java @@ -17,7 +17,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.web.server.LocalServerPort; import org.testcontainers.shaded.org.apache.commons.lang3.ObjectUtils; -import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.math.BigDecimal; import java.util.HashMap; @@ -26,6 +25,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.Stack; import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -34,14 +34,24 @@ import static java.util.Arrays.asList; import static java.util.Arrays.stream; import static java.util.Optional.ofNullable; import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.assertj.core.api.Assertions.assertThat; public abstract class ScenarioTest extends ContextBasedTest { final static String RUN_AS_USER = "superuser-alex@hostsharing.net"; // TODO.test: use global:AGENT when implemented + private final Stack currentTestMethodProduces = new Stack<>(); + protected ScenarioTest scenarioTest = this; + Optional takeProducedAlias() { + if (currentTestMethodProduces.isEmpty()) { + return Optional.empty(); + } + return Optional.of(currentTestMethodProduces.pop()); + } + record Alias>(Class useCase, UUID uuid) { @Override @@ -70,7 +80,10 @@ public abstract class ScenarioTest extends ContextBasedTest { void init(final TestInfo testInfo) { createHostsharingPerson(); try { - testInfo.getTestMethod().ifPresent(this::callRequiredProducers); + testInfo.getTestMethod().ifPresent(currentTestMethod -> { + callRequiredProducers(currentTestMethod); + keepProducesAlias(currentTestMethod); + }); testReport.createTestLogMarkdownFile(testInfo); } catch (Exception exc) { throw exc; @@ -124,12 +137,13 @@ public abstract class ScenarioTest extends ContextBasedTest { // then we recursively produce the pre-requisites of the producer method callRequiredProducers(potentialProducerMethod); + keepProducesAlias(currentTestMethod); // and finally we call the producer method invokeProducerMethod(this, potentialProducerMethod); assertThat(knowVariables().containsKey(testMethodRequires)) - .as("@Producer(\"" + testMethodRequires + "\") did not produce") + .as("@Producer method " + potentialProducerMethod.getName() + " did declare but not produce \"" + testMethodRequires + "\"") .isTrue(); } // @formatter:on @@ -141,6 +155,17 @@ public abstract class ScenarioTest extends ContextBasedTest { } } + private void keepProducesAlias(final Method currentTestMethod) { + final var producesAnnot = currentTestMethod.getAnnotation(Produces.class); + if ( producesAnnot != null ) { + final var producesAlias = isNotBlank(producesAnnot.value()) ? producesAnnot.value() : producesAnnot.explicitly(); + assertThat(producesAlias) + .as(currentTestMethod.getName() + " must define either value or explicit for @Produces") + .isNotNull(); + this.currentTestMethodProduces.push(producesAlias); + } + } + private Method @NotNull [] getPotentialProducerMethods() { final var methodsDeclaredInOuterTestClass = stream(getClass().getDeclaredMethods()) .filter(m -> m.getAnnotation(Produces.class) != null) diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java index 8f1eaf1a..1209cfbc 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java @@ -96,6 +96,7 @@ public abstract class UseCase> { ); final var response = run(); verify(response); + keepInProduceAlias(response); resetProperties(); @@ -244,6 +245,13 @@ public abstract class UseCase> { } + private void keepInProduceAlias(final HttpResponse response) { + final var producedAlias = testSuite.takeProducedAlias(); + if (response != null) { + producedAlias.ifPresent(response::keepAs); + } + } + private static Duration seconds(final int secondsIfNoDebuggerAttached) { return isDebuggerAttached() ? Duration.ofHours(1) : Duration.ofSeconds(secondsIfNoDebuggerAttached); } -- 2.39.5 From b0c26df6323a0277a138eb0c300881f275e54964 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 29 Nov 2024 10:52:40 +0100 Subject: [PATCH 4/7] revert experimental changes in BaseOfficeDataImport --- .../hsadminng/hs/migration/BaseOfficeDataImport.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java b/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java index ed97041f..311ce4ad 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java @@ -884,15 +884,15 @@ public abstract class BaseOfficeDataImport extends CsvDataImport { final var legacyId = entry.getKey(); final var assetTransaction = entry.getValue(); if (assetTransaction.getTransactionType() == HsOfficeCoopAssetsTransactionType.REVERSAL) { - connectToRelatedRevertedAssetTx(legacyId, assetTransaction); + connectToRelatedRevertedAssetTx(assetTransaction); } if (assetTransaction.getTransactionType() == HsOfficeCoopAssetsTransactionType.TRANSFER) { - connectToRelatedAdoptionAssetTx(legacyId, assetTransaction); + connectToRelatedAdoptionAssetTx(assetTransaction); } }); } - private static void connectToRelatedRevertedAssetTx(final int legacyId, final HsOfficeCoopAssetsTransactionEntity assetTransaction) { + private static void connectToRelatedRevertedAssetTx(final HsOfficeCoopAssetsTransactionEntity assetTransaction) { final var negativeValue = assetTransaction.getAssetValue().negate(); final var revertedAssetTx = coopAssets.values().stream().filter(a -> a.getTransactionType() != HsOfficeCoopAssetsTransactionType.REVERSAL && @@ -905,7 +905,7 @@ public abstract class BaseOfficeDataImport extends CsvDataImport { //revertedAssetTx.setAssetReversalTx(assetTransaction); } - private static void connectToRelatedAdoptionAssetTx(final Integer legacyId, final HsOfficeCoopAssetsTransactionEntity assetTransaction) { + private static void connectToRelatedAdoptionAssetTx(final HsOfficeCoopAssetsTransactionEntity assetTransaction) { final var negativeValue = assetTransaction.getAssetValue().negate(); final var adoptionAssetTx = coopAssets.values().stream().filter(a -> a.getTransactionType() == HsOfficeCoopAssetsTransactionType.ADOPTION && -- 2.39.5 From 87e23b935546a29f0dccd2d37e7982f6382cced8 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 29 Nov 2024 11:51:41 +0100 Subject: [PATCH 5/7] fix office scenario tests - but implicitly produced aliases are not properly checked yet --- .../hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 52a45ad4..0b95bdaf 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 @@ -58,7 +58,6 @@ import org.springframework.boot.test.context.SpringBootTest; "hsadminng.superuser=${HSADMINNG_SUPERUSER:superuser-alex@hostsharing.net}" } ) -//@DirtiesContext @TestClassOrder(ClassOrderer.OrderAnnotation.class) @ExtendWith(IgnoreOnFailureExtension.class) class HsOfficeScenarioTests extends ScenarioTest { @@ -484,7 +483,7 @@ class HsOfficeScenarioTests extends ScenarioTest { @Test @Order(4304) @Requires("Coop-Assets M-3101000 - Test AG - DEPOSIT Transaction") - @Produces(explicitly = "Coop-Assets M-3101000 - Test AG - TRANSFER Transaction", implicitly = "Membership M-4303000") + @Produces(explicitly = "Coop-Assets M-3101000 - Test AG - TRANSFER Transaction", implicitly = "Membership M-4303000 - New AG") void shouldTransferCoopAssets() { new CreateCoopAssetsTransferTransaction(scenarioTest) .given("transferringMemberNumber", "M-3101000") @@ -498,7 +497,7 @@ class HsOfficeScenarioTests extends ScenarioTest { @Test @Order(4305) - @Requires("Membership M-4303000") + @Requires("Coop-Assets M-3101000 - Test AG - TRANSFER Transaction") void shouldRevertCoopAssetsTransferIncludingRelatedAssetAdoption() { new CreateCoopAssetsRevertTransferTransaction(scenarioTest) .given("transferringMemberNumber", "M-3101000") -- 2.39.5 From 0ae0131ef748769a2ac48a26adf3309503e9362b Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 29 Nov 2024 13:27:23 +0100 Subject: [PATCH 6/7] fix requires with resolvable alias name --- .../scenarios/HsOfficeScenarioTests.java | 12 ++--- .../CreateCoopAssetsTransferTransaction.java | 2 +- .../hsadminng/test/scenarios/Produces.java | 30 ++++++++++++ .../test/scenarios/ScenarioTest.java | 48 ++++++++----------- .../hsadminng/test/scenarios/UseCase.java | 9 ++-- 5 files changed, 61 insertions(+), 40 deletions(-) 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 0b95bdaf..4d785a63 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 @@ -444,7 +444,7 @@ class HsOfficeScenarioTests extends ScenarioTest { @Test @Order(4301) @Requires("Membership: M-3101000 - Test AG") - @Produces("Coop-Assets M-3101000 - Test AG - DEPOSIT Transaction") + @Produces("Coop-Assets: M-3101000 - Test AG - DEPOSIT Transaction") void shouldSubscribeCoopAssets() { new CreateCoopAssetsDepositTransaction(scenarioTest) .given("memberNumber", "M-3101000") @@ -468,8 +468,8 @@ class HsOfficeScenarioTests extends ScenarioTest { @Test @Order(4303) - @Requires("Coop-Assets M-3101000 - Test AG - DEPOSIT Transaction") - @Produces("Coop-Assets M-3101000 - Test AG - DISBURSAL Transaction") + @Requires("Coop-Assets: M-3101000 - Test AG - DEPOSIT Transaction") + @Produces("Coop-Assets: M-3101000 - Test AG - DISBURSAL Transaction") void shouldDisburseCoopAssets() { new CreateCoopAssetsDisbursalTransaction(scenarioTest) .given("memberNumber", "M-3101000") @@ -482,8 +482,8 @@ class HsOfficeScenarioTests extends ScenarioTest { @Test @Order(4304) - @Requires("Coop-Assets M-3101000 - Test AG - DEPOSIT Transaction") - @Produces(explicitly = "Coop-Assets M-3101000 - Test AG - TRANSFER Transaction", implicitly = "Membership M-4303000 - New AG") + @Requires("Coop-Assets: M-3101000 - Test AG - DEPOSIT Transaction") + @Produces(explicitly = "Coop-Assets: M-3101000 - Test AG - TRANSFER Transaction", implicitly = "Membership: M-4303000 - New AG") void shouldTransferCoopAssets() { new CreateCoopAssetsTransferTransaction(scenarioTest) .given("transferringMemberNumber", "M-3101000") @@ -497,7 +497,7 @@ class HsOfficeScenarioTests extends ScenarioTest { @Test @Order(4305) - @Requires("Coop-Assets M-3101000 - Test AG - TRANSFER Transaction") + @Requires("Coop-Assets: M-3101000 - Test AG - TRANSFER Transaction") void shouldRevertCoopAssetsTransferIncludingRelatedAssetAdoption() { new CreateCoopAssetsRevertTransferTransaction(scenarioTest) .given("transferringMemberNumber", "M-3101000") diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java index faf3779d..8a9a31da 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java @@ -19,7 +19,7 @@ public class CreateCoopAssetsTransferTransaction extends CreateCoopAssetsTransac .given("emailAddress", "board-of-directors@new-ag.example.org") ); - requires("Membership: New AG", alias -> new CreateMembership(testSuite) + requires("Membership: %{adoptingMemberNumber} - New AG", alias -> new CreateMembership(testSuite) .given("memberNumber", toPartnerNumber("%{adoptingMemberNumber}")) .given("partnerName", "New AG") .given("validFrom", "2024-11-15") diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/Produces.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/Produces.java index 9acdd3ab..7ad5bb9c 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/Produces.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/Produces.java @@ -1,10 +1,15 @@ package net.hostsharing.hsadminng.test.scenarios; +import lombok.experimental.UtilityClass; + import java.lang.annotation.Retention; import java.lang.annotation.Target; +import java.util.HashSet; +import java.util.Set; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.util.Arrays.asList; @Target(METHOD) @Retention(RUNTIME) @@ -13,4 +18,29 @@ public @interface Produces { String explicitly() default ""; // same as value String[] implicitly() default {}; boolean permanent() default true; // false means that the object gets deleted again in the process + + @UtilityClass + final class Aggregator { + + public static Set producedAliases(final Produces producesAnnot) { + return allOf( + producesAnnot.value(), + producesAnnot.explicitly(), + producesAnnot.implicitly()); + } + + + + private Set allOf(final String value, final String explicitly, final String[] implicitly) { + final var all = new HashSet(); + if (!value.isEmpty()) { + all.add(value); + } + if (!explicitly.isEmpty()) { + all.add(explicitly); + } + all.addAll(asList(implicitly)); + return all; + } + } } diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java index e23fc584..3364554f 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java @@ -15,24 +15,22 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.TestInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.web.server.LocalServerPort; -import org.testcontainers.shaded.org.apache.commons.lang3.ObjectUtils; import java.lang.reflect.Method; import java.math.BigDecimal; import java.util.HashMap; -import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.Optional; -import java.util.Set; import java.util.Stack; import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.Stream; -import static java.util.Arrays.asList; import static java.util.Arrays.stream; import static java.util.Optional.ofNullable; +import static net.hostsharing.hsadminng.test.scenarios.Produces.Aggregator.producedAliases; import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.assertj.core.api.Assertions.assertThat; @@ -56,7 +54,7 @@ public abstract class ScenarioTest extends ContextBasedTest { @Override public String toString() { - return ObjectUtils.toString(uuid); + return Objects.toString(uuid); } } @@ -77,7 +75,7 @@ public abstract class ScenarioTest extends ContextBasedTest { @SneakyThrows @BeforeEach - void init(final TestInfo testInfo) { + void beforeScenario(final TestInfo testInfo) { createHostsharingPerson(); try { testInfo.getTestMethod().ifPresent(currentTestMethod -> { @@ -91,7 +89,20 @@ public abstract class ScenarioTest extends ContextBasedTest { } @AfterEach - void cleanup() { // final TestInfo testInfo + void afterScenario(final TestInfo testInfo) { // final TestInfo testInfo + testInfo.getTestMethod() .ifPresent(currentTestMethod -> { + // FIXME: extract to method + final var producesAnnot = currentTestMethod.getAnnotation(Produces.class); + if (producesAnnot != null && producesAnnot.permanent()) { + final var testMethodProduces = producedAliases(producesAnnot); + testMethodProduces.forEach(declaredAlias -> + assertThat(knowVariables().containsKey(declaredAlias)) + .as("@Producer method " + currentTestMethod.getName() + + " did declare but not produce \"" + declaredAlias + "\"") + .isTrue() ); + } + }); + properties.clear(); testReport.close(); } @@ -122,10 +133,7 @@ public abstract class ScenarioTest extends ContextBasedTest { if (testMethodRequires != null) { for (Method potentialProducerMethod : getPotentialProducerMethods()) { final var producesAnnot = potentialProducerMethod.getAnnotation(Produces.class); - final var testMethodProduces = allOf( - producesAnnot.value(), - producesAnnot.explicitly(), - producesAnnot.implicitly()); + final var testMethodProduces = producedAliases(producesAnnot); // @formatter:off if ( // that method can produce something required testMethodProduces.contains(testMethodRequires) && @@ -141,10 +149,6 @@ public abstract class ScenarioTest extends ContextBasedTest { // and finally we call the producer method invokeProducerMethod(this, potentialProducerMethod); - - assertThat(knowVariables().containsKey(testMethodRequires)) - .as("@Producer method " + potentialProducerMethod.getName() + " did declare but not produce \"" + testMethodRequires + "\"") - .isTrue(); } // @formatter:on } @@ -157,7 +161,7 @@ public abstract class ScenarioTest extends ContextBasedTest { private void keepProducesAlias(final Method currentTestMethod) { final var producesAnnot = currentTestMethod.getAnnotation(Produces.class); - if ( producesAnnot != null ) { + if (producesAnnot != null) { final var producesAlias = isNotBlank(producesAnnot.value()) ? producesAnnot.value() : producesAnnot.explicitly(); assertThat(producesAlias) .as(currentTestMethod.getName() + " must define either value or explicit for @Produces") @@ -191,18 +195,6 @@ public abstract class ScenarioTest extends ContextBasedTest { } } - private Set allOf(final String value, final String explicitly, final String[] implicitly) { - final var all = new HashSet(); - if (!value.isEmpty()) { - all.add(value); - } - if (!explicitly.isEmpty()) { - all.add(explicitly); - } - all.addAll(asList(implicitly)); - return all; - } - static boolean containsAlias(final String alias) { return aliases.containsKey(alias); } diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java b/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java index 1209cfbc..283058e7 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java +++ b/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java @@ -71,9 +71,7 @@ public abstract class UseCase> { } public final void requires(final String alias, final Function> useCaseFactory) { - if (!ScenarioTest.containsAlias(alias)) { - requirements.put(alias, useCaseFactory); - } + requirements.put(alias, useCaseFactory); } public final HttpResponse doRun() { @@ -89,8 +87,9 @@ public abstract class UseCase> { testReport.printLine(""); testReport.silent(() -> requirements.forEach((alias, factory) -> { - if (!ScenarioTest.containsAlias(alias)) { - factory.apply(alias).run().keepAs(alias); + final var resolvedAlias = ScenarioTest.resolve(alias, DROP_COMMENTS); + if (!ScenarioTest.containsAlias(resolvedAlias)) { + factory.apply(resolvedAlias).run().keepAs(resolvedAlias); } }) ); -- 2.39.5 From e9e078673c4c3bc6bb53dceb8dfae6964907e812 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 29 Nov 2024 13:42:44 +0100 Subject: [PATCH 7/7] fix arch test, partly by moving scenarios out of test to avoid cycles --- .../net/hostsharing/hsadminng/arch/ArchitectureTest.java | 3 +++ .../hs/office/scenarios/HsOfficeScenarioTests.java | 6 +++--- .../scenarios/contact/AddPhoneNumberToContactData.java | 4 ++-- .../hs/office/scenarios/contact/AmendContactData.java | 4 ++-- .../contact/RemovePhoneNumberFromContactData.java | 4 ++-- .../hs/office/scenarios/contact/ReplaceContactData.java | 4 ++-- .../debitor/CreateExternalDebitorForPartner.java | 4 ++-- .../scenarios/debitor/CreateSelfDebitorForPartner.java | 4 ++-- .../scenarios/debitor/CreateSepaMandateForDebitor.java | 4 ++-- .../hs/office/scenarios/debitor/DeleteDebitor.java | 4 ++-- .../scenarios/debitor/DontDeleteDefaultDebitor.java | 4 ++-- .../debitor/FinallyDeleteSepaMandateForDebitor.java | 4 ++-- .../debitor/InvalidateSepaMandateForDebitor.java | 4 ++-- .../hs/office/scenarios/membership/CancelMembership.java | 4 ++-- .../hs/office/scenarios/membership/CreateMembership.java | 4 ++-- .../coopassets/CreateCoopAssetsDepositTransaction.java | 2 +- .../coopassets/CreateCoopAssetsDisbursalTransaction.java | 2 +- .../CreateCoopAssetsRevertSimpleTransaction.java | 2 +- .../CreateCoopAssetsRevertTransferTransaction.java | 6 +++--- .../coopassets/CreateCoopAssetsTransaction.java | 4 ++-- .../coopassets/CreateCoopAssetsTransferTransaction.java | 4 ++-- .../CreateCoopSharesCancellationTransaction.java | 2 +- .../coopshares/CreateCoopSharesRevertTransaction.java | 2 +- .../CreateCoopSharesSubscriptionTransaction.java | 2 +- .../coopshares/CreateCoopSharesTransaction.java | 4 ++-- .../scenarios/partner/AddOperationsContactToPartner.java | 4 ++-- .../scenarios/partner/AddRepresentativeToPartner.java | 4 ++-- .../hs/office/scenarios/partner/CreatePartner.java | 4 ++-- .../hs/office/scenarios/partner/DeletePartner.java | 4 ++-- .../hs/office/scenarios/person/CreatePerson.java | 4 ++-- .../office/scenarios/person/ShouldUpdatePersonData.java | 4 ++-- .../subscription/RemoveOperationsContactFromPartner.java | 4 ++-- .../scenarios/subscription/SubscribeToMailinglist.java | 4 ++-- .../subscription/UnsubscribeFromMailinglist.java | 4 ++-- .../hsadminng/{test => hs}/scenarios/JsonOptional.java | 2 +- .../hsadminng/{test => hs}/scenarios/PathAssertion.java | 6 +++--- .../hsadminng/{test => hs}/scenarios/Produces.java | 2 +- .../hsadminng/{test => hs}/scenarios/README.md | 0 .../hsadminng/{test => hs}/scenarios/Requires.java | 2 +- .../hsadminng/{test => hs}/scenarios/ScenarioTest.java | 8 ++++---- .../{test => hs}/scenarios/TemplateResolver.java | 4 ++-- .../{test => hs}/scenarios/TemplateResolverUnitTest.java | 4 ++-- .../hsadminng/{test => hs}/scenarios/TestReport.java | 2 +- .../hsadminng/{test => hs}/scenarios/UseCase.java | 6 +++--- .../{test => hs}/scenarios/UseCaseNotImplementedYet.java | 2 +- 45 files changed, 84 insertions(+), 81 deletions(-) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/JsonOptional.java (95%) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/PathAssertion.java (85%) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/Produces.java (96%) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/README.md (100%) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/Requires.java (84%) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/ScenarioTest.java (97%) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/TemplateResolver.java (98%) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/TemplateResolverUnitTest.java (93%) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/TestReport.java (99%) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/UseCase.java (98%) rename src/test/java/net/hostsharing/hsadminng/{test => hs}/scenarios/UseCaseNotImplementedYet.java (88%) diff --git a/src/test/java/net/hostsharing/hsadminng/arch/ArchitectureTest.java b/src/test/java/net/hostsharing/hsadminng/arch/ArchitectureTest.java index e53a7c75..9152d68f 100644 --- a/src/test/java/net/hostsharing/hsadminng/arch/ArchitectureTest.java +++ b/src/test/java/net/hostsharing/hsadminng/arch/ArchitectureTest.java @@ -68,6 +68,7 @@ public class ArchitectureTest { "..hs.hosting.asset", "..hs.hosting.asset.validators", "..hs.hosting.asset.factories", + "..hs.scenarios", "..errors", "..mapper", "..ping", @@ -160,9 +161,11 @@ public class ArchitectureTest { .that().resideInAPackage("..hs.office.(*)..") .should().onlyBeAccessed().byClassesThat() .resideInAnyPackage( + "..hs.office.(*)..", "..hs.office.(*)..", "..hs.booking.(*)..", "..hs.hosting.(*)..", + "..hs.scenarios", "..hs.migration", "..rbacgrant" // TODO.test: just because of RbacGrantsDiagramServiceIntegrationTest ); 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 4d785a63..70d74414 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 @@ -30,9 +30,9 @@ import net.hostsharing.hsadminng.hs.office.scenarios.person.ShouldUpdatePersonDa 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; -import net.hostsharing.hsadminng.test.scenarios.Produces; -import net.hostsharing.hsadminng.test.scenarios.Requires; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.Produces; +import net.hostsharing.hsadminng.hs.scenarios.Requires; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.test.IgnoreOnFailureExtension; import org.junit.jupiter.api.ClassOrderer; 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 55530031..501a2a6d 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.contact; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java index 96b075e8..5f05b6a8 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/contact/AmendContactData.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.contact; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 10e54445..03a8e07a 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.contact; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 7309d095..d7a0569a 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.contact; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.CREATED; 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 2e160573..f05a9e47 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import net.hostsharing.hsadminng.hs.office.scenarios.person.CreatePerson; import static io.restassured.http.ContentType.JSON; 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 763eefb3..daa00811 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.CREATED; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandateForDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandateForDebitor.java index 0651665b..b50cc7c9 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandateForDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/CreateSepaMandateForDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.CREATED; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DeleteDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DeleteDebitor.java index 8b87086a..2ff0484d 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DeleteDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DeleteDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; public class DeleteDebitor extends UseCase { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DontDeleteDefaultDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DontDeleteDefaultDebitor.java index 4a72837e..00d7fa79 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DontDeleteDefaultDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/DontDeleteDefaultDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; public class DontDeleteDefaultDebitor extends UseCase { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/FinallyDeleteSepaMandateForDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/FinallyDeleteSepaMandateForDebitor.java index 82d90ed3..7dff8d6a 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/FinallyDeleteSepaMandateForDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/FinallyDeleteSepaMandateForDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/InvalidateSepaMandateForDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/InvalidateSepaMandateForDebitor.java index 55241a09..501e9f06 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/InvalidateSepaMandateForDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/debitor/InvalidateSepaMandateForDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.debitor; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.OK; 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 index a93106eb..d5d00900 100644 --- 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 @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 40ab5dc7..63541e09 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 @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDepositTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDepositTransaction.java index aab9b9c8..7c7a05ad 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDepositTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDepositTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; public class CreateCoopAssetsDepositTransaction extends CreateCoopAssetsTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDisbursalTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDisbursalTransaction.java index 627b582b..e605782f 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDisbursalTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsDisbursalTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; public class CreateCoopAssetsDisbursalTransaction extends CreateCoopAssetsTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertSimpleTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertSimpleTransaction.java index c5f2177f..45cba19d 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertSimpleTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertSimpleTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; public class CreateCoopAssetsRevertSimpleTransaction extends CreateCoopAssetsTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertTransferTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertTransferTransaction.java index 86c3b701..a1680682 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertTransferTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsRevertTransferTransaction.java @@ -1,13 +1,13 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; import java.math.BigDecimal; -import static net.hostsharing.hsadminng.test.scenarios.ScenarioTest.resolveTyped; +import static net.hostsharing.hsadminng.hs.scenarios.ScenarioTest.resolveTyped; public class CreateCoopAssetsRevertTransferTransaction extends CreateCoopAssetsTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransaction.java index 8eecdabf..beb78b52 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransaction.java @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java index 8a9a31da..bf43bd85 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopassets/CreateCoopAssetsTransferTransaction.java @@ -1,10 +1,10 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import net.hostsharing.hsadminng.hs.office.scenarios.membership.CreateMembership; import net.hostsharing.hsadminng.hs.office.scenarios.partner.CreatePartner; -import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; public class CreateCoopAssetsTransferTransaction extends CreateCoopAssetsTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesCancellationTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesCancellationTransaction.java index fb88c3ac..19f02820 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesCancellationTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesCancellationTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; public class CreateCoopSharesCancellationTransaction extends CreateCoopSharesTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesRevertTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesRevertTransaction.java index 18c0654e..4f2a8555 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesRevertTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesRevertTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; public class CreateCoopSharesRevertTransaction extends CreateCoopSharesTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesSubscriptionTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesSubscriptionTransaction.java index 395d5d26..79f79285 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesSubscriptionTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesSubscriptionTransaction.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; public class CreateCoopSharesSubscriptionTransaction extends CreateCoopSharesTransaction { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesTransaction.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesTransaction.java index 5e82b3aa..a70cbdf5 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesTransaction.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/membership/coopshares/CreateCoopSharesTransaction.java @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 fe703e34..4ea68cba 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 @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.partner; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 d5ffa22f..41732d3a 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.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 e587ac3c..87ca7c87 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 @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.partner; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/DeletePartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/DeletePartner.java index 8d02d2a0..df0a0c57 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/DeletePartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/partner/DeletePartner.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.partner; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; public class DeletePartner extends UseCase { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/CreatePerson.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/CreatePerson.java index 5a4bf987..39e39068 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/CreatePerson.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/person/CreatePerson.java @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.person; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; public class CreatePerson extends UseCase { 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 index f1472005..1d092936 100644 --- 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.person; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; 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 42b9f45f..905c3a72 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 @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.subscription; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; -import net.hostsharing.hsadminng.test.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.NOT_FOUND; 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 7b5acaf4..c524fb18 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 @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.scenarios.subscription; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import org.springframework.http.HttpStatus; import static io.restassured.http.ContentType.JSON; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/UnsubscribeFromMailinglist.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/UnsubscribeFromMailinglist.java index 99c63ca9..4a6b34cb 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/UnsubscribeFromMailinglist.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/subscription/UnsubscribeFromMailinglist.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.scenarios.subscription; -import net.hostsharing.hsadminng.test.scenarios.UseCase; -import net.hostsharing.hsadminng.test.scenarios.ScenarioTest; +import net.hostsharing.hsadminng.hs.scenarios.UseCase; +import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest; import static io.restassured.http.ContentType.JSON; import static org.springframework.http.HttpStatus.NO_CONTENT; diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/JsonOptional.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/JsonOptional.java similarity index 95% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/JsonOptional.java rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/JsonOptional.java index c4f3a71e..f5c829c6 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/JsonOptional.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/JsonOptional.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.test.scenarios; +package net.hostsharing.hsadminng.hs.scenarios; public final class JsonOptional { diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/PathAssertion.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/PathAssertion.java similarity index 85% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/PathAssertion.java rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/PathAssertion.java index fec91e2a..4a51932e 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/PathAssertion.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/PathAssertion.java @@ -1,10 +1,10 @@ -package net.hostsharing.hsadminng.test.scenarios; +package net.hostsharing.hsadminng.hs.scenarios; -import net.hostsharing.hsadminng.test.scenarios.UseCase.HttpResponse; +import net.hostsharing.hsadminng.hs.scenarios.UseCase.HttpResponse; import java.util.function.Consumer; -import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; import static org.junit.jupiter.api.Assertions.fail; public class PathAssertion { diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/Produces.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/Produces.java similarity index 96% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/Produces.java rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/Produces.java index 7ad5bb9c..181d6648 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/Produces.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/Produces.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.test.scenarios; +package net.hostsharing.hsadminng.hs.scenarios; import lombok.experimental.UtilityClass; diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/README.md b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/README.md similarity index 100% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/README.md rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/README.md diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/Requires.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/Requires.java similarity index 84% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/Requires.java rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/Requires.java index fa691c31..d0a3ed5a 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/Requires.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/Requires.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.test.scenarios; +package net.hostsharing.hsadminng.hs.scenarios; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/ScenarioTest.java similarity index 97% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/ScenarioTest.java index 3364554f..d1da4bb1 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/ScenarioTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/ScenarioTest.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.test.scenarios; +package net.hostsharing.hsadminng.hs.scenarios; import lombok.SneakyThrows; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; @@ -6,7 +6,7 @@ import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; import net.hostsharing.hsadminng.lambda.Reducer; import net.hostsharing.hsadminng.rbac.context.ContextBasedTest; import net.hostsharing.hsadminng.rbac.test.JpaAttempt; -import net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver; +import net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver; import org.apache.commons.collections4.SetUtils; import org.apache.commons.lang3.ArrayUtils; import org.jetbrains.annotations.NotNull; @@ -30,8 +30,8 @@ import java.util.stream.Stream; import static java.util.Arrays.stream; import static java.util.Optional.ofNullable; -import static net.hostsharing.hsadminng.test.scenarios.Produces.Aggregator.producedAliases; -import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.hs.scenarios.Produces.Aggregator.producedAliases; +import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolver.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/TemplateResolver.java similarity index 98% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolver.java rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/TemplateResolver.java index 27ecc4cf..d28adb26 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolver.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/TemplateResolver.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.test.scenarios; +package net.hostsharing.hsadminng.hs.scenarios; import org.apache.commons.lang3.StringUtils; @@ -10,7 +10,7 @@ import java.util.Objects; import java.util.regex.Pattern; import java.util.stream.Collectors; -import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; public class TemplateResolver { diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolverUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/TemplateResolverUnitTest.java similarity index 93% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolverUnitTest.java rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/TemplateResolverUnitTest.java index babdb32e..34e2783f 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/TemplateResolverUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/TemplateResolverUnitTest.java @@ -1,10 +1,10 @@ -package net.hostsharing.hsadminng.test.scenarios; +package net.hostsharing.hsadminng.hs.scenarios; import org.junit.jupiter.api.Test; import java.util.Map; -import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; import static org.assertj.core.api.Assertions.assertThat; class TemplateResolverUnitTest { diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/TestReport.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/TestReport.java similarity index 99% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/TestReport.java rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/TestReport.java index 6dd39447..b700d556 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/TestReport.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/TestReport.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.test.scenarios; +package net.hostsharing.hsadminng.hs.scenarios; import lombok.SneakyThrows; import net.hostsharing.hsadminng.system.SystemProcess; diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/UseCase.java similarity index 98% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/UseCase.java index 283058e7..7b438134 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCase.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/UseCase.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.test.scenarios; +package net.hostsharing.hsadminng.hs.scenarios; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -35,8 +35,8 @@ import java.util.function.Supplier; import static java.net.URLEncoder.encode; import static java.util.stream.Collectors.joining; -import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; -import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.KEEP_COMMENTS; +import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS; +import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.KEEP_COMMENTS; import static net.hostsharing.hsadminng.test.DebuggerDetection.isDebuggerAttached; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.fail; diff --git a/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCaseNotImplementedYet.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/UseCaseNotImplementedYet.java similarity index 88% rename from src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCaseNotImplementedYet.java rename to src/test/java/net/hostsharing/hsadminng/hs/scenarios/UseCaseNotImplementedYet.java index 7f323165..98073e65 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/scenarios/UseCaseNotImplementedYet.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/UseCaseNotImplementedYet.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng.test.scenarios; +package net.hostsharing.hsadminng.hs.scenarios; import static org.assertj.core.api.Assumptions.assumeThat; -- 2.39.5