From 5a296e0a9f40984ff6cd91ea5547b77e6e4a38c4 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 21 Oct 2022 08:01:17 +0200 Subject: [PATCH] improved ArchitectureTest rules and package refactoring --- .../HsOfficeBankAccountController.java | 4 +- .../HsOfficeBankAccountEntity.java | 6 +- .../contact/HsOfficeContactController.java | 4 +- .../office/contact/HsOfficeContactEntity.java | 6 +- .../contact/HsOfficeContactEntityPatch.java | 4 +- ...OfficeCoopSharesTransactionController.java | 4 +- .../HsOfficeCoopSharesTransactionEntity.java | 6 +- .../debitor/HsOfficeDebitorController.java | 8 +- .../office/debitor/HsOfficeDebitorEntity.java | 7 +- .../debitor/HsOfficeDebitorEntityPatcher.java | 4 +- .../HsOfficeMembershipController.java | 4 +- .../membership/HsOfficeMembershipEntity.java | 6 +- .../partner/HsOfficePartnerController.java | 4 +- .../partner/HsOfficePartnerDetailsEntity.java | 6 +- .../HsOfficePartnerDetailsEntityPatcher.java | 5 +- .../office/partner/HsOfficePartnerEntity.java | 7 +- .../partner/HsOfficePartnerEntityPatcher.java | 9 +- .../person/HsOfficePersonController.java | 4 +- .../office/person/HsOfficePersonEntity.java | 6 +- .../person/HsOfficePersonEntityPatcher.java | 4 +- .../HsOfficeRelationshipController.java | 5 +- .../HsOfficeRelationshipEntity.java | 4 +- .../HsOfficeRelationshipEntityPatcher.java | 4 +- .../HsOfficeSepaMandateController.java | 4 +- .../HsOfficeSepaMandateEntity.java | 6 +- .../hsadminng/{ => mapper}/EntityPatcher.java | 2 +- .../hsadminng/{ => mapper}/Mapper.java | 2 +- .../{ => mapper}/OptionalFromJson.java | 2 +- .../hsadminng/{ => ping}/PingController.java | 2 +- .../rbac/rbacgrant/RbacGrantController.java | 4 +- .../rbac/rbacrole/RbacRoleController.java | 2 +- .../rbac/rbacuser/RbacUserController.java | 4 +- .../hsadminng/{ => stringify}/Stringify.java | 2 +- .../{ => stringify}/Stringifyable.java | 2 +- .../test/cust/TestCustomerController.java | 4 +- .../test/pac/TestPackageController.java | 6 +- .../hsadminng/arch/ArchitectureTest.java | 86 +++++++++++++++++-- ...ceBankAccountControllerAcceptanceTest.java | 2 +- ...OfficeContactControllerAcceptanceTest.java | 3 +- .../HsOfficeContactEntityPatcherUnitTest.java | 2 +- ...esTransactionControllerAcceptanceTest.java | 2 +- ...OfficeDebitorControllerAcceptanceTest.java | 2 +- .../HsOfficeDebitorEntityPatcherUnitTest.java | 2 +- ...iceMembershipControllerAcceptanceTest.java | 2 +- ...OfficePartnerControllerAcceptanceTest.java | 2 +- ...cePartnerDetailsEntityPatcherUnitTest.java | 2 +- .../HsOfficePartnerEntityPatcherUnitTest.java | 2 +- ...sOfficePersonControllerAcceptanceTest.java | 2 +- .../HsOfficePersonEntityPatcherUnitTest.java | 2 +- ...eRelationshipControllerAcceptanceTest.java | 2 +- ...ficeRelationshipEntityPatcherUnitTest.java | 2 +- ...ceSepaMandateControllerAcceptanceTest.java | 2 +- .../RbacGrantControllerAcceptanceTest.java | 2 +- .../RbacGrantRepositoryIntegrationTest.java | 2 +- .../RbacRoleControllerAcceptanceTest.java | 2 +- .../RbacUserControllerAcceptanceTest.java | 2 +- .../{hsadminng => test}/Accepts.java | 2 +- .../{hsadminng => test}/MapperUnitTest.java | 3 +- .../OptionalFromJsonUnitTest.java | 3 +- .../PatchUnitTestBase.java | 3 +- .../{hsadminng => test}/StringTemplater.java | 2 +- .../StringifyUnitTest.java | 6 +- 62 files changed, 185 insertions(+), 122 deletions(-) rename src/main/java/net/hostsharing/hsadminng/{ => mapper}/EntityPatcher.java (61%) rename src/main/java/net/hostsharing/hsadminng/{ => mapper}/Mapper.java (97%) rename src/main/java/net/hostsharing/hsadminng/{ => mapper}/OptionalFromJson.java (96%) rename src/main/java/net/hostsharing/hsadminng/{ => ping}/PingController.java (91%) rename src/main/java/net/hostsharing/hsadminng/{ => stringify}/Stringify.java (98%) rename src/main/java/net/hostsharing/hsadminng/{ => stringify}/Stringifyable.java (59%) rename src/test/java/net/hostsharing/{hsadminng => test}/Accepts.java (89%) rename src/test/java/net/hostsharing/{hsadminng => test}/MapperUnitTest.java (95%) rename src/test/java/net/hostsharing/{hsadminng => test}/OptionalFromJsonUnitTest.java (94%) rename src/test/java/net/hostsharing/{hsadminng => test}/PatchUnitTestBase.java (99%) rename src/test/java/net/hostsharing/{hsadminng => test}/StringTemplater.java (96%) rename src/test/java/net/hostsharing/{hsadminng => test}/StringifyUnitTest.java (94%) diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountController.java index 130f934f..7804e58c 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountController.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.bankaccount; -import net.hostsharing.hsadminng.Mapper; +import net.hostsharing.hsadminng.mapper.Mapper; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficeBankAccountsApi; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeBankAccountInsertResource; @@ -16,7 +16,7 @@ import org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBui import java.util.List; import java.util.UUID; -import static net.hostsharing.hsadminng.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.map; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountEntity.java index 90f98f13..eb501265 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountEntity.java @@ -2,8 +2,8 @@ package net.hostsharing.hsadminng.hs.office.bankaccount; import lombok.*; import lombok.experimental.FieldNameConstants; -import net.hostsharing.hsadminng.Stringify; -import net.hostsharing.hsadminng.Stringifyable; +import net.hostsharing.hsadminng.stringify.Stringify; +import net.hostsharing.hsadminng.stringify.Stringifyable; import net.hostsharing.hsadminng.errors.DisplayName; import javax.persistence.Entity; @@ -11,7 +11,7 @@ import javax.persistence.Id; import javax.persistence.Table; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @Table(name = "hs_office_bankaccount_rv") diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactController.java index 6a99098e..34c1fe6c 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactController.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.contact; -import net.hostsharing.hsadminng.Mapper; +import net.hostsharing.hsadminng.mapper.Mapper; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficeContactsApi; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeContactInsertResource; @@ -15,7 +15,7 @@ import org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBui import java.util.List; import java.util.UUID; -import static net.hostsharing.hsadminng.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.map; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntity.java index 8de19a15..5a1463af 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntity.java @@ -3,8 +3,8 @@ package net.hostsharing.hsadminng.hs.office.contact; import lombok.*; import lombok.experimental.FieldNameConstants; import net.hostsharing.hsadminng.errors.DisplayName; -import net.hostsharing.hsadminng.Stringify; -import net.hostsharing.hsadminng.Stringifyable; +import net.hostsharing.hsadminng.stringify.Stringify; +import net.hostsharing.hsadminng.stringify.Stringifyable; import javax.persistence.Column; import javax.persistence.Entity; @@ -12,7 +12,7 @@ import javax.persistence.Id; import javax.persistence.Table; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @Table(name = "hs_office_contact_rv") diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntityPatch.java b/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntityPatch.java index 863d1e1f..af6cfbc6 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntityPatch.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntityPatch.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.contact; -import net.hostsharing.hsadminng.EntityPatcher; -import net.hostsharing.hsadminng.OptionalFromJson; +import net.hostsharing.hsadminng.mapper.EntityPatcher; +import net.hostsharing.hsadminng.mapper.OptionalFromJson; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeContactPatchResource; class HsOfficeContactEntityPatch implements EntityPatcher { diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionController.java index 9c8a6c64..8814e75f 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionController.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.coopshares; -import net.hostsharing.hsadminng.Mapper; +import net.hostsharing.hsadminng.mapper.Mapper; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficeCoopSharesApi; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeCoopSharesTransactionInsertResource; @@ -21,7 +21,7 @@ import java.util.List; import java.util.UUID; import static java.lang.String.join; -import static net.hostsharing.hsadminng.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.map; import static net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeCoopSharesTransactionTypeResource.CANCELLATION; import static net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeCoopSharesTransactionTypeResource.SUBSCRIPTION; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java index 6d34fb3c..c9c58d0b 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java @@ -2,8 +2,8 @@ package net.hostsharing.hsadminng.hs.office.coopshares; import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; import lombok.*; -import net.hostsharing.hsadminng.Stringify; -import net.hostsharing.hsadminng.Stringifyable; +import net.hostsharing.hsadminng.stringify.Stringify; +import net.hostsharing.hsadminng.stringify.Stringifyable; import net.hostsharing.hsadminng.errors.DisplayName; import net.hostsharing.hsadminng.hs.office.membership.HsOfficeMembershipEntity; import org.hibernate.annotations.Type; @@ -13,7 +13,7 @@ import javax.persistence.*; import java.time.LocalDate; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @Table(name = "hs_office_coopsharestransaction_rv") diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorController.java index 50af3fab..31044a5a 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorController.java @@ -1,16 +1,12 @@ package net.hostsharing.hsadminng.hs.office.debitor; -import net.hostsharing.hsadminng.Mapper; +import net.hostsharing.hsadminng.mapper.Mapper; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountEntity; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficeDebitorsApi; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.*; -import net.hostsharing.hsadminng.hs.office.debitor.HsOfficeDebitorEntity; -import net.hostsharing.hsadminng.hs.office.debitor.HsOfficeDebitorEntityPatcher; -import net.hostsharing.hsadminng.hs.office.debitor.HsOfficeDebitorRepository; import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity; -import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; @@ -22,7 +18,7 @@ import java.util.List; import java.util.UUID; import java.util.function.BiConsumer; -import static net.hostsharing.hsadminng.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.map; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntity.java index 5887b65f..3945c79d 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntity.java @@ -2,17 +2,16 @@ package net.hostsharing.hsadminng.hs.office.debitor; import lombok.*; import net.hostsharing.hsadminng.errors.DisplayName; -import net.hostsharing.hsadminng.Stringify; -import net.hostsharing.hsadminng.Stringifyable; +import net.hostsharing.hsadminng.stringify.Stringify; +import net.hostsharing.hsadminng.stringify.Stringifyable; import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountEntity; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity; -import org.apache.commons.lang3.StringUtils; import javax.persistence.*; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @Table(name = "hs_office_debitor_rv") diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcher.java b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcher.java index 5fdef0e6..bc1e1683 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcher.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcher.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.debitor; -import net.hostsharing.hsadminng.EntityPatcher; -import net.hostsharing.hsadminng.OptionalFromJson; +import net.hostsharing.hsadminng.mapper.EntityPatcher; +import net.hostsharing.hsadminng.mapper.OptionalFromJson; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeDebitorPatchResource; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java index 2a2c1e79..73255336 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.membership; import com.vladmihalcea.hibernate.type.range.Range; -import net.hostsharing.hsadminng.Mapper; +import net.hostsharing.hsadminng.mapper.Mapper; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficeMembershipsApi; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeMembershipInsertResource; @@ -21,7 +21,7 @@ import java.util.Optional; import java.util.UUID; import java.util.function.BiConsumer; -import static net.hostsharing.hsadminng.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.map; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java index b068fdf5..59cd81a4 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java @@ -4,8 +4,8 @@ import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; import com.vladmihalcea.hibernate.type.range.PostgreSQLRangeType; import com.vladmihalcea.hibernate.type.range.Range; import lombok.*; -import net.hostsharing.hsadminng.Stringify; -import net.hostsharing.hsadminng.Stringifyable; +import net.hostsharing.hsadminng.stringify.Stringify; +import net.hostsharing.hsadminng.stringify.Stringifyable; import net.hostsharing.hsadminng.errors.DisplayName; import net.hostsharing.hsadminng.hs.office.debitor.HsOfficeDebitorEntity; import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity; @@ -18,7 +18,7 @@ import javax.persistence.*; import java.time.LocalDate; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @Table(name = "hs_office_membership_rv") diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerController.java index db54ec03..daf145e4 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerController.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.partner; -import net.hostsharing.hsadminng.Mapper; +import net.hostsharing.hsadminng.mapper.Mapper; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRepository; import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficePartnersApi; @@ -18,7 +18,7 @@ import java.util.NoSuchElementException; import java.util.UUID; import java.util.function.BiConsumer; -import static net.hostsharing.hsadminng.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.map; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntity.java index e802655b..8f03bde4 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntity.java @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.office.partner; import lombok.*; -import net.hostsharing.hsadminng.Stringify; -import net.hostsharing.hsadminng.Stringifyable; +import net.hostsharing.hsadminng.stringify.Stringify; +import net.hostsharing.hsadminng.stringify.Stringifyable; import net.hostsharing.hsadminng.errors.DisplayName; import javax.persistence.Column; @@ -12,7 +12,7 @@ import javax.persistence.Table; import java.time.LocalDate; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @Table(name = "hs_office_partner_details_rv") diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntityPatcher.java b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntityPatcher.java index 05fffa85..d26f4556 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntityPatcher.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntityPatcher.java @@ -1,11 +1,10 @@ package net.hostsharing.hsadminng.hs.office.partner; -import net.hostsharing.hsadminng.EntityPatcher; -import net.hostsharing.hsadminng.OptionalFromJson; +import net.hostsharing.hsadminng.mapper.EntityPatcher; +import net.hostsharing.hsadminng.mapper.OptionalFromJson; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePartnerDetailsPatchResource; import javax.persistence.EntityManager; -import java.util.UUID; class HsOfficePartnerDetailsEntityPatcher implements EntityPatcher { diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntity.java index 11e8bab1..a63d34c0 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntity.java @@ -2,18 +2,17 @@ package net.hostsharing.hsadminng.hs.office.partner; import lombok.*; import net.hostsharing.hsadminng.errors.DisplayName; -import net.hostsharing.hsadminng.Stringify; -import net.hostsharing.hsadminng.Stringifyable; +import net.hostsharing.hsadminng.stringify.Stringify; +import net.hostsharing.hsadminng.stringify.Stringifyable; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; import javax.persistence.*; -import java.time.LocalDate; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @Table(name = "hs_office_partner_rv") diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityPatcher.java b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityPatcher.java index 08550246..7b1af04f 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityPatcher.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityPatcher.java @@ -1,18 +1,13 @@ package net.hostsharing.hsadminng.hs.office.partner; -import net.hostsharing.hsadminng.EntityPatcher; -import net.hostsharing.hsadminng.OptionalFromJson; +import net.hostsharing.hsadminng.mapper.EntityPatcher; +import net.hostsharing.hsadminng.mapper.OptionalFromJson; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePartnerPatchResource; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; import javax.persistence.EntityManager; -import java.util.NoSuchElementException; -import java.util.Optional; import java.util.UUID; -import java.util.function.Function; -import java.util.function.Supplier; - class HsOfficePartnerEntityPatcher implements EntityPatcher { private final EntityManager em; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonController.java index 9346afbd..bf9cc6b4 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonController.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.person; -import net.hostsharing.hsadminng.Mapper; +import net.hostsharing.hsadminng.mapper.Mapper; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficePersonsApi; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePersonInsertResource; @@ -15,7 +15,7 @@ import org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBui import java.util.List; import java.util.UUID; -import static net.hostsharing.hsadminng.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.map; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntity.java index 8b15ecbb..3a7a494f 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntity.java @@ -4,8 +4,8 @@ import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; import lombok.*; import lombok.experimental.FieldNameConstants; import net.hostsharing.hsadminng.errors.DisplayName; -import net.hostsharing.hsadminng.Stringify; -import net.hostsharing.hsadminng.Stringifyable; +import net.hostsharing.hsadminng.stringify.Stringify; +import net.hostsharing.hsadminng.stringify.Stringifyable; import org.apache.commons.lang3.StringUtils; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; @@ -13,7 +13,7 @@ import org.hibernate.annotations.TypeDef; import javax.persistence.*; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @Table(name = "hs_office_person_rv") diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityPatcher.java b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityPatcher.java index 01e200eb..d1d3fa8c 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityPatcher.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityPatcher.java @@ -1,9 +1,9 @@ package net.hostsharing.hsadminng.hs.office.person; -import net.hostsharing.hsadminng.OptionalFromJson; +import net.hostsharing.hsadminng.mapper.OptionalFromJson; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePersonPatchResource; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePersonTypeResource; -import net.hostsharing.hsadminng.EntityPatcher; +import net.hostsharing.hsadminng.mapper.EntityPatcher; import java.util.Optional; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipController.java index e30a0b31..0b9ac61f 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipController.java @@ -1,6 +1,5 @@ package net.hostsharing.hsadminng.hs.office.relationship; -import net.hostsharing.hsadminng.Mapper; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRepository; import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficeRelationshipsApi; @@ -18,8 +17,8 @@ import java.util.NoSuchElementException; import java.util.UUID; import java.util.function.BiConsumer; -import static net.hostsharing.hsadminng.Mapper.map; -import static net.hostsharing.hsadminng.Mapper.mapList; +import static net.hostsharing.hsadminng.mapper.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.mapList; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntity.java index 5513ceee..39f7997b 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntity.java @@ -3,7 +3,7 @@ package net.hostsharing.hsadminng.hs.office.relationship; import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; import lombok.*; import lombok.experimental.FieldNameConstants; -import net.hostsharing.hsadminng.Stringify; +import net.hostsharing.hsadminng.stringify.Stringify; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; import org.hibernate.annotations.Type; @@ -12,7 +12,7 @@ import org.hibernate.annotations.TypeDef; import javax.persistence.*; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @Table(name = "hs_office_relationship_rv") diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityPatcher.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityPatcher.java index c01a3467..1f7e4487 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityPatcher.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityPatcher.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.relationship; -import net.hostsharing.hsadminng.EntityPatcher; -import net.hostsharing.hsadminng.OptionalFromJson; +import net.hostsharing.hsadminng.mapper.EntityPatcher; +import net.hostsharing.hsadminng.mapper.OptionalFromJson; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeRelationshipPatchResource; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateController.java index 51e998a0..9b1a1f57 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateController.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.sepamandate; import com.vladmihalcea.hibernate.type.range.Range; -import net.hostsharing.hsadminng.Mapper; +import net.hostsharing.hsadminng.mapper.Mapper; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficeSepaMandatesApi; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeSepaMandateInsertResource; @@ -20,7 +20,7 @@ import java.util.List; import java.util.UUID; import java.util.function.BiConsumer; -import static net.hostsharing.hsadminng.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.map; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateEntity.java index 7559b29a..15aaf419 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateEntity.java @@ -4,8 +4,8 @@ import com.vladmihalcea.hibernate.type.range.PostgreSQLRangeType; import com.vladmihalcea.hibernate.type.range.Range; import lombok.*; import net.hostsharing.hsadminng.errors.DisplayName; -import net.hostsharing.hsadminng.Stringify; -import net.hostsharing.hsadminng.Stringifyable; +import net.hostsharing.hsadminng.stringify.Stringify; +import net.hostsharing.hsadminng.stringify.Stringifyable; import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountEntity; import net.hostsharing.hsadminng.hs.office.debitor.HsOfficeDebitorEntity; import org.hibernate.annotations.TypeDef; @@ -14,7 +14,7 @@ import javax.persistence.*; import java.time.LocalDate; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @Table(name = "hs_office_sepamandate_rv") diff --git a/src/main/java/net/hostsharing/hsadminng/EntityPatcher.java b/src/main/java/net/hostsharing/hsadminng/mapper/EntityPatcher.java similarity index 61% rename from src/main/java/net/hostsharing/hsadminng/EntityPatcher.java rename to src/main/java/net/hostsharing/hsadminng/mapper/EntityPatcher.java index 5a0c0f44..23eb9753 100644 --- a/src/main/java/net/hostsharing/hsadminng/EntityPatcher.java +++ b/src/main/java/net/hostsharing/hsadminng/mapper/EntityPatcher.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.hsadminng.mapper; public interface EntityPatcher { diff --git a/src/main/java/net/hostsharing/hsadminng/Mapper.java b/src/main/java/net/hostsharing/hsadminng/mapper/Mapper.java similarity index 97% rename from src/main/java/net/hostsharing/hsadminng/Mapper.java rename to src/main/java/net/hostsharing/hsadminng/mapper/Mapper.java index 4d82cf32..05e1b44d 100644 --- a/src/main/java/net/hostsharing/hsadminng/Mapper.java +++ b/src/main/java/net/hostsharing/hsadminng/mapper/Mapper.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.hsadminng.mapper; import org.modelmapper.ModelMapper; diff --git a/src/main/java/net/hostsharing/hsadminng/OptionalFromJson.java b/src/main/java/net/hostsharing/hsadminng/mapper/OptionalFromJson.java similarity index 96% rename from src/main/java/net/hostsharing/hsadminng/OptionalFromJson.java rename to src/main/java/net/hostsharing/hsadminng/mapper/OptionalFromJson.java index 745e5f8a..6963e1c9 100644 --- a/src/main/java/net/hostsharing/hsadminng/OptionalFromJson.java +++ b/src/main/java/net/hostsharing/hsadminng/mapper/OptionalFromJson.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.hsadminng.mapper; import org.openapitools.jackson.nullable.JsonNullable; diff --git a/src/main/java/net/hostsharing/hsadminng/PingController.java b/src/main/java/net/hostsharing/hsadminng/ping/PingController.java similarity index 91% rename from src/main/java/net/hostsharing/hsadminng/PingController.java rename to src/main/java/net/hostsharing/hsadminng/ping/PingController.java index 5730c347..f6f92f52 100644 --- a/src/main/java/net/hostsharing/hsadminng/PingController.java +++ b/src/main/java/net/hostsharing/hsadminng/ping/PingController.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.hsadminng.ping; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/src/main/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantController.java b/src/main/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantController.java index b3806f9f..0ea9929a 100644 --- a/src/main/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantController.java +++ b/src/main/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantController.java @@ -13,8 +13,8 @@ import javax.persistence.EntityManager; import java.util.List; import java.util.UUID; -import static net.hostsharing.hsadminng.Mapper.map; -import static net.hostsharing.hsadminng.Mapper.mapList; +import static net.hostsharing.hsadminng.mapper.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.mapList; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleController.java b/src/main/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleController.java index 70c809af..0f1055a5 100644 --- a/src/main/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleController.java +++ b/src/main/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; -import static net.hostsharing.hsadminng.Mapper.mapList; +import static net.hostsharing.hsadminng.mapper.Mapper.mapList; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserController.java b/src/main/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserController.java index 24e0934d..1d46960a 100644 --- a/src/main/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserController.java +++ b/src/main/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserController.java @@ -13,8 +13,8 @@ import org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBui import java.util.List; import java.util.UUID; -import static net.hostsharing.hsadminng.Mapper.map; -import static net.hostsharing.hsadminng.Mapper.mapList; +import static net.hostsharing.hsadminng.mapper.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.mapList; @RestController public class RbacUserController implements RbacUsersApi { diff --git a/src/main/java/net/hostsharing/hsadminng/Stringify.java b/src/main/java/net/hostsharing/hsadminng/stringify/Stringify.java similarity index 98% rename from src/main/java/net/hostsharing/hsadminng/Stringify.java rename to src/main/java/net/hostsharing/hsadminng/stringify/Stringify.java index 4a665b1e..e6b690ff 100644 --- a/src/main/java/net/hostsharing/hsadminng/Stringify.java +++ b/src/main/java/net/hostsharing/hsadminng/stringify/Stringify.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.hsadminng.stringify; import net.hostsharing.hsadminng.errors.DisplayName; diff --git a/src/main/java/net/hostsharing/hsadminng/Stringifyable.java b/src/main/java/net/hostsharing/hsadminng/stringify/Stringifyable.java similarity index 59% rename from src/main/java/net/hostsharing/hsadminng/Stringifyable.java rename to src/main/java/net/hostsharing/hsadminng/stringify/Stringifyable.java index 2e4cec93..70877dc9 100644 --- a/src/main/java/net/hostsharing/hsadminng/Stringifyable.java +++ b/src/main/java/net/hostsharing/hsadminng/stringify/Stringifyable.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.hsadminng.stringify; public interface Stringifyable { diff --git a/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerController.java b/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerController.java index e592ddf6..9dfe3b46 100644 --- a/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerController.java +++ b/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerController.java @@ -12,8 +12,8 @@ import org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBui import java.util.List; import java.util.UUID; -import static net.hostsharing.hsadminng.Mapper.map; -import static net.hostsharing.hsadminng.Mapper.mapList; +import static net.hostsharing.hsadminng.mapper.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.mapList; @RestController diff --git a/src/main/java/net/hostsharing/hsadminng/test/pac/TestPackageController.java b/src/main/java/net/hostsharing/hsadminng/test/pac/TestPackageController.java index a0f2600c..68e403ec 100644 --- a/src/main/java/net/hostsharing/hsadminng/test/pac/TestPackageController.java +++ b/src/main/java/net/hostsharing/hsadminng/test/pac/TestPackageController.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.test.pac; -import net.hostsharing.hsadminng.OptionalFromJson; +import net.hostsharing.hsadminng.mapper.OptionalFromJson; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.test.generated.api.v1.api.TestPackagesApi; import net.hostsharing.hsadminng.test.generated.api.v1.model.TestPackageResource; @@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; import java.util.UUID; -import static net.hostsharing.hsadminng.Mapper.map; -import static net.hostsharing.hsadminng.Mapper.mapList; +import static net.hostsharing.hsadminng.mapper.Mapper.map; +import static net.hostsharing.hsadminng.mapper.Mapper.mapList; @RestController public class TestPackageController implements TestPackagesApi { diff --git a/src/test/java/net/hostsharing/hsadminng/arch/ArchitectureTest.java b/src/test/java/net/hostsharing/hsadminng/arch/ArchitectureTest.java index 43a4fafb..e0c5274c 100644 --- a/src/test/java/net/hostsharing/hsadminng/arch/ArchitectureTest.java +++ b/src/test/java/net/hostsharing/hsadminng/arch/ArchitectureTest.java @@ -3,7 +3,8 @@ package net.hostsharing.hsadminng.arch; import com.tngtech.archunit.junit.AnalyzeClasses; import com.tngtech.archunit.junit.ArchTest; import com.tngtech.archunit.lang.ArchRule; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.hsadminng.HsadminNgApplication; +import net.hostsharing.test.Accepts; import org.junit.jupiter.api.Test; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.web.bind.annotation.RestController; @@ -16,6 +17,38 @@ public class ArchitectureTest { public static final String NET_HOSTSHARING_HSADMINNG = "net.hostsharing.hsadminng"; + @ArchTest + @SuppressWarnings("unused") + public static final ArchRule onlyValidPackages = noClasses() + .that().doNotBelongToAnyOf(HsadminNgApplication.class, ArchitectureTest.class) + .should().resideOutsideOfPackages( + // ATTENTION: Don't simply add packages here, also add arch rules for the new package! + "..config", + "..test", + "..test.cust", + "..test.pac", + "..context", + "..generated..", + "..hs.office.person", + "..hs.office.partner", + "..hs.office.bankaccount", + "..hs.office.debitor", + "..hs.office.relationship", + "..hs.office.contact", + "..hs.office.sepamandate", + "..hs.office.coopshares", + "..hs.office.membership", + "..errors", + "..mapper", + "..ping", + "..rbac", + "..rbac.rbacuser", + "..rbac.rbacgrant", + "..rbac.rbacrole", + "..stringify" + // ATTENTION: Don't simply add packages here, also add arch rules for the new package! + ); + @ArchTest @SuppressWarnings("unused") public static final ArchRule doNotUseJUnit4 = noClasses() @@ -27,6 +60,11 @@ public class ArchitectureTest { public static final ArchRule dontUseImplSuffix = noClasses() .should().haveSimpleNameEndingWith("Impl"); + @ArchTest + @SuppressWarnings("unused") + public static final ArchRule allPackagesBelowNetHostsharingHsAdmin = noClasses() + .should().resideOutsideOfPackages(NET_HOSTSHARING_HSADMINNG + ".."); + @ArchTest @SuppressWarnings("unused") public static final ArchRule contextPackageRule = classes() @@ -69,30 +107,64 @@ public class ArchitectureTest { .should().onlyBeAccessed().byClassesThat() .resideInAnyPackage("..hs.office.(*).."); - // TODO.test: rule to check if all packages have rules - // TODO.test: rules for contact, person, ... - @ArchTest @SuppressWarnings("unused") - public static final ArchRule HsOfficeBankAccountPackageRule = classes() + public static final ArchRule hsOfficeBankAccountPackageRule = classes() .that().resideInAPackage("..hs.office.bankaccount..") .should().onlyBeAccessed().byClassesThat() .resideInAnyPackage("..hs.office.bankaccount..", "..hs.office.sepamandate..", "..hs.office.debitor.."); @ArchTest @SuppressWarnings("unused") - public static final ArchRule HsOfficePartnerPackageRule = classes() + public static final ArchRule hsOfficeSepaMandatePackageRule = classes() + .that().resideInAPackage("..hs.office.sepamandate..") + .should().onlyBeAccessed().byClassesThat() + .resideInAnyPackage("..hs.office.sepamandate..", "..hs.office.debitor.."); + + @ArchTest + @SuppressWarnings("unused") + public static final ArchRule hsOfficeContactPackageRule = classes() + .that().resideInAPackage("..hs.office.contact..") + .should().onlyBeAccessed().byClassesThat() + .resideInAnyPackage("..hs.office.contact..", "..hs.office.relationship..", + "..hs.office.partner..", "..hs.office.debitor..", "..hs.office.membership.."); + + @ArchTest + @SuppressWarnings("unused") + public static final ArchRule hsOfficePersonPackageRule = classes() + .that().resideInAPackage("..hs.office.person..") + .should().onlyBeAccessed().byClassesThat() + .resideInAnyPackage("..hs.office.person..", "..hs.office.relationship..", + "..hs.office.partner..", "..hs.office.debitor..", "..hs.office.membership.."); + + @ArchTest + @SuppressWarnings("unused") + public static final ArchRule hsOfficeRelationshipPackageRule = classes() + .that().resideInAPackage("..hs.office.relationship..") + .should().onlyBeAccessed().byClassesThat() + .resideInAnyPackage("..hs.office.relationship.."); + + @ArchTest + @SuppressWarnings("unused") + public static final ArchRule hsOfficePartnerPackageRule = classes() .that().resideInAPackage("..hs.office.partner..") .should().onlyBeAccessed().byClassesThat() .resideInAnyPackage("..hs.office.partner..", "..hs.office.debitor..", "..hs.office.membership.."); @ArchTest @SuppressWarnings("unused") - public static final ArchRule HsOfficeMembershipPackageRule = classes() + public static final ArchRule hsOfficeMembershipPackageRule = classes() .that().resideInAPackage("..hs.office.membership..") .should().onlyBeAccessed().byClassesThat() .resideInAnyPackage("..hs.office.membership..", "..hs.office.coopshares.."); + @ArchTest + @SuppressWarnings("unused") + public static final ArchRule hsOfficeCoopSharesPackageRule = classes() + .that().resideInAPackage("..hs.office.coopshares..") + .should().onlyBeAccessed().byClassesThat() + .resideInAnyPackage("..hs.office.coopshares.."); + @ArchTest @SuppressWarnings("unused") public static final ArchRule acceptsAnnotationOnMethodsRule = methods() diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountControllerAcceptanceTest.java index 31391fd9..9d961123 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountControllerAcceptanceTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.bankaccount; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.test.JpaAttempt; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactControllerAcceptanceTest.java index bfef17ee..091bd291 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactControllerAcceptanceTest.java @@ -2,13 +2,12 @@ package net.hostsharing.hsadminng.hs.office.contact; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.test.JpaAttempt; import org.apache.commons.lang3.RandomStringUtils; import org.json.JSONException; -import org.junit.Before; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntityPatcherUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntityPatcherUnitTest.java index 624db76c..f8a45070 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntityPatcherUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactEntityPatcherUnitTest.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.contact; -import net.hostsharing.hsadminng.PatchUnitTestBase; +import net.hostsharing.test.PatchUnitTestBase; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeContactPatchResource; import org.junit.jupiter.api.TestInstance; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java index d2ca7606..95d05007 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.coopshares; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.membership.HsOfficeMembershipRepository; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorControllerAcceptanceTest.java index 0a149881..954aba75 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorControllerAcceptanceTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.debitor; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountRepository; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcherUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcherUnitTest.java index ab250cc0..3897ef9c 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcherUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcherUnitTest.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.debitor; -import net.hostsharing.hsadminng.PatchUnitTestBase; +import net.hostsharing.test.PatchUnitTestBase; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeDebitorPatchResource; import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java index 84470f8a..b2a9f2aa 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java @@ -3,7 +3,7 @@ package net.hostsharing.hsadminng.hs.office.membership; import com.vladmihalcea.hibernate.type.range.Range; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.debitor.HsOfficeDebitorRepository; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerAcceptanceTest.java index 5c408603..36a2f7f8 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerAcceptanceTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.partner; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRepository; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntityPatcherUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntityPatcherUnitTest.java index 3b3811e5..1cc2b792 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntityPatcherUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerDetailsEntityPatcherUnitTest.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.partner; -import net.hostsharing.hsadminng.PatchUnitTestBase; +import net.hostsharing.test.PatchUnitTestBase; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePartnerDetailsPatchResource; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityPatcherUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityPatcherUnitTest.java index a7b11bd1..8671150c 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityPatcherUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityPatcherUnitTest.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.partner; -import net.hostsharing.hsadminng.PatchUnitTestBase; +import net.hostsharing.test.PatchUnitTestBase; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePartnerPatchResource; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonControllerAcceptanceTest.java index 9bd09a7e..04853b9e 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonControllerAcceptanceTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.person; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.test.JpaAttempt; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityPatcherUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityPatcherUnitTest.java index 7a227789..f6f29f00 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityPatcherUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityPatcherUnitTest.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.person; -import net.hostsharing.hsadminng.PatchUnitTestBase; +import net.hostsharing.test.PatchUnitTestBase; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePersonPatchResource; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePersonTypeResource; import org.junit.jupiter.api.TestInstance; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipControllerAcceptanceTest.java index 4e4d0ff2..6288bb4c 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipControllerAcceptanceTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.relationship; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRepository; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityPatcherUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityPatcherUnitTest.java index 65ece28c..21695b34 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityPatcherUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityPatcherUnitTest.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.relationship; -import net.hostsharing.hsadminng.PatchUnitTestBase; +import net.hostsharing.test.PatchUnitTestBase; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeRelationshipPatchResource; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateControllerAcceptanceTest.java index cbb0abb2..3f7813a9 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateControllerAcceptanceTest.java @@ -3,7 +3,7 @@ package net.hostsharing.hsadminng.hs.office.sepamandate; import com.vladmihalcea.hibernate.type.range.Range; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountRepository; diff --git a/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantControllerAcceptanceTest.java index 4b8b1b5d..47d13956 100644 --- a/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantControllerAcceptanceTest.java @@ -3,7 +3,7 @@ package net.hostsharing.hsadminng.rbac.rbacgrant; import io.restassured.RestAssured; import io.restassured.http.ContentType; import io.restassured.response.ValidatableResponse; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.ContextBasedTest; import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleEntity; diff --git a/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantRepositoryIntegrationTest.java index f9b304af..c5788389 100644 --- a/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantRepositoryIntegrationTest.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.rbac.rbacgrant; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.context.ContextBasedTest; import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleRepository; diff --git a/src/test/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleControllerAcceptanceTest.java index 39514c21..0412b332 100644 --- a/src/test/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleControllerAcceptanceTest.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.rbac.rbacrole; import io.restassured.RestAssured; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.rbac.rbacuser.RbacUserRepository; diff --git a/src/test/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserControllerAcceptanceTest.java index 37f5852d..b6aee5f0 100644 --- a/src/test/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserControllerAcceptanceTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.rbac.rbacuser; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import net.hostsharing.hsadminng.Accepts; +import net.hostsharing.test.Accepts; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.test.JpaAttempt; diff --git a/src/test/java/net/hostsharing/hsadminng/Accepts.java b/src/test/java/net/hostsharing/test/Accepts.java similarity index 89% rename from src/test/java/net/hostsharing/hsadminng/Accepts.java rename to src/test/java/net/hostsharing/test/Accepts.java index fbbd34bb..505b5d2e 100644 --- a/src/test/java/net/hostsharing/hsadminng/Accepts.java +++ b/src/test/java/net/hostsharing/test/Accepts.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.test; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/test/java/net/hostsharing/hsadminng/MapperUnitTest.java b/src/test/java/net/hostsharing/test/MapperUnitTest.java similarity index 95% rename from src/test/java/net/hostsharing/hsadminng/MapperUnitTest.java rename to src/test/java/net/hostsharing/test/MapperUnitTest.java index b23e6c3c..7e72910d 100644 --- a/src/test/java/net/hostsharing/hsadminng/MapperUnitTest.java +++ b/src/test/java/net/hostsharing/test/MapperUnitTest.java @@ -1,9 +1,10 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.test; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; +import net.hostsharing.hsadminng.mapper.Mapper; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/net/hostsharing/hsadminng/OptionalFromJsonUnitTest.java b/src/test/java/net/hostsharing/test/OptionalFromJsonUnitTest.java similarity index 94% rename from src/test/java/net/hostsharing/hsadminng/OptionalFromJsonUnitTest.java rename to src/test/java/net/hostsharing/test/OptionalFromJsonUnitTest.java index 219ad4d4..52c22d0b 100644 --- a/src/test/java/net/hostsharing/hsadminng/OptionalFromJsonUnitTest.java +++ b/src/test/java/net/hostsharing/test/OptionalFromJsonUnitTest.java @@ -1,5 +1,6 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.test; +import net.hostsharing.hsadminng.mapper.OptionalFromJson; import org.junit.jupiter.api.Test; import org.openapitools.jackson.nullable.JsonNullable; diff --git a/src/test/java/net/hostsharing/hsadminng/PatchUnitTestBase.java b/src/test/java/net/hostsharing/test/PatchUnitTestBase.java similarity index 99% rename from src/test/java/net/hostsharing/hsadminng/PatchUnitTestBase.java rename to src/test/java/net/hostsharing/test/PatchUnitTestBase.java index 9d9ad888..7be61b19 100644 --- a/src/test/java/net/hostsharing/hsadminng/PatchUnitTestBase.java +++ b/src/test/java/net/hostsharing/test/PatchUnitTestBase.java @@ -1,5 +1,6 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.test; +import net.hostsharing.hsadminng.mapper.EntityPatcher; import org.junit.jupiter.api.Named; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/net/hostsharing/hsadminng/StringTemplater.java b/src/test/java/net/hostsharing/test/StringTemplater.java similarity index 96% rename from src/test/java/net/hostsharing/hsadminng/StringTemplater.java rename to src/test/java/net/hostsharing/test/StringTemplater.java index 38914a94..23bf2cf0 100644 --- a/src/test/java/net/hostsharing/hsadminng/StringTemplater.java +++ b/src/test/java/net/hostsharing/test/StringTemplater.java @@ -1,4 +1,4 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.test; import lombok.experimental.UtilityClass; diff --git a/src/test/java/net/hostsharing/hsadminng/StringifyUnitTest.java b/src/test/java/net/hostsharing/test/StringifyUnitTest.java similarity index 94% rename from src/test/java/net/hostsharing/hsadminng/StringifyUnitTest.java rename to src/test/java/net/hostsharing/test/StringifyUnitTest.java index 9bf1870c..d8830335 100644 --- a/src/test/java/net/hostsharing/hsadminng/StringifyUnitTest.java +++ b/src/test/java/net/hostsharing/test/StringifyUnitTest.java @@ -1,12 +1,14 @@ -package net.hostsharing.hsadminng; +package net.hostsharing.test; import lombok.*; import lombok.experimental.FieldNameConstants; +import net.hostsharing.hsadminng.stringify.Stringify; +import net.hostsharing.hsadminng.stringify.Stringifyable; import org.junit.jupiter.api.Test; import java.util.UUID; -import static net.hostsharing.hsadminng.Stringify.stringify; +import static net.hostsharing.hsadminng.stringify.Stringify.stringify; import static org.assertj.core.api.Assertions.assertThat; class StringifyUnitTest {