From df3f1dd5aae4ba7aff8b2ce4b0056d8987c87f6d Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Wed, 4 Dec 2024 15:56:34 +0100 Subject: [PATCH] split HsOfficePersonEntity into HsOfficePerson+HsOfficePersonRealEntity+HsOfficePersonRbacEntity --- .../debitor/HsOfficeDebitorRepository.java | 2 +- .../partner/HsOfficePartnerController.java | 6 +- .../office/partner/HsOfficePartnerEntity.java | 4 +- .../partner/HsOfficePartnerRepository.java | 2 +- .../person/HsOfficePersonController.java | 4 +- .../office/person/HsOfficePersonEntity.java | 103 ------------------ .../person/HsOfficePersonEntityPatcher.java | 4 +- .../person/HsOfficePersonRbacEntity.java | 52 +++++++++ ...java => HsOfficePersonRbacRepository.java} | 10 +- .../person/HsOfficePersonRealEntity.java | 23 ++++ .../person/HsOfficePersonRealRepository.java | 34 ++++++ .../hs/office/relation/HsOfficeRelation.java | 6 +- .../relation/HsOfficeRelationController.java | 8 +- .../relation/HsOfficeRelationRbacEntity.java | 6 +- .../hs/migration/BaseOfficeDataImport.java | 16 +-- ...OfficeDebitorControllerAcceptanceTest.java | 20 ++-- .../HsOfficeDebitorEntityUnitTest.java | 6 +- ...fficeDebitorRepositoryIntegrationTest.java | 4 +- .../office/debitor/TestHsOfficeDebitor.java | 6 +- ...OfficePartnerControllerAcceptanceTest.java | 8 +- .../HsOfficePartnerControllerRestTest.java | 10 +- ...cePartnerDetailsEntityPatcherUnitTest.java | 6 +- .../HsOfficePartnerEntityPatcherUnitTest.java | 4 +- .../HsOfficePartnerEntityUnitTest.java | 6 +- ...fficePartnerRepositoryIntegrationTest.java | 4 +- .../office/partner/TestHsOfficePartner.java | 6 +- ...sOfficePersonControllerAcceptanceTest.java | 8 +- .../HsOfficePersonEntityPatcherUnitTest.java | 20 ++-- .../person/HsOfficePersonEntityUnitTest.java | 26 ++--- ...OfficePersonRepositoryIntegrationTest.java | 20 ++-- .../hs/office/person/TestHsOfficePerson.java | 6 +- ...RealRelationRepositoryIntegrationTest.java | 4 +- ...fficeRelationControllerAcceptanceTest.java | 4 +- .../HsOfficeRelationPatcherUnitTest.java | 6 +- ...ficeRelationRepositoryIntegrationTest.java | 4 +- .../relation/HsOfficeRelationUnitTest.java | 6 +- .../hsadminng/hs/scenarios/ScenarioTest.java | 8 +- 37 files changed, 239 insertions(+), 233 deletions(-) delete mode 100644 src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntity.java create mode 100644 src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRbacEntity.java rename src/main/java/net/hostsharing/hsadminng/hs/office/person/{HsOfficePersonRepository.java => HsOfficePersonRbacRepository.java} (71%) create mode 100644 src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRealEntity.java create mode 100644 src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRealRepository.java diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepository.java index ab51663d..a62d1c42 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepository.java @@ -36,7 +36,7 @@ public interface HsOfficeDebitorRepository extends Repository ofNullable(p.getPartnerRel()) .map(HsOfficeRelation::getHolder) - .map(HsOfficePersonEntity::toShortString) + .map(HsOfficePerson::toShortString) .orElse(null)) .withProp(p -> ofNullable(p.getPartnerRel()) .map(HsOfficeRelation::getContact) diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepository.java index 5a804d40..282d3db3 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepository.java @@ -20,7 +20,7 @@ public interface HsOfficePartnerRepository extends Repository, Stringifyable { - - private static Stringify toString = stringify(HsOfficePersonEntity.class, "person") - .withProp(Fields.personType, HsOfficePersonEntity::getPersonType) - .withProp(Fields.tradeName, HsOfficePersonEntity::getTradeName) - .withProp(Fields.salutation, HsOfficePersonEntity::getSalutation) - .withProp(Fields.title, HsOfficePersonEntity::getTitle) - .withProp(Fields.familyName, HsOfficePersonEntity::getFamilyName) - .withProp(Fields.givenName, HsOfficePersonEntity::getGivenName); - - @Id - @GeneratedValue - private UUID uuid; - - @Version - private int version; - - @Column(name = "persontype") - private HsOfficePersonType personType; - - @Column(name = "tradename") - private String tradeName; - - @Column(name = "salutation") - private String salutation; - - @Column(name = "title") - private String title; - - @Column(name = "familyname") - private String familyName; - - @Column(name = "givenname") - private String givenName; - - @Override - public String toString() { - return toString.apply(this); - } - - @Override - public String toShortString() { - return personType + " " + - (!StringUtils.isEmpty(tradeName) ? tradeName : (familyName + ", " + givenName)); - } - - public static RbacView rbac() { - return rbacViewFor("person", HsOfficePersonEntity.class) - .withIdentityView(SQL.projection("concat(tradeName, familyName, givenName)")) - .withUpdatableColumns("personType", "title", "salutation", "tradeName", "givenName", "familyName") - .toRole(GLOBAL, GUEST).grantPermission(INSERT) - - .createRole(OWNER, (with) -> { - with.permission(DELETE); - with.owningUser(CREATOR); - with.incomingSuperRole(GLOBAL, ADMIN); - }) - .createSubRole(ADMIN, (with) -> { - with.permission(UPDATE); - }) - .createSubRole(REFERRER, (with) -> { - with.permission(SELECT); - }); - } - - - public static void main(String[] args) throws IOException { - rbac().generateWithBaseFileName("5-hs-office/502-person/5023-hs-office-person-rbac"); - } -} 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 ede3fc03..77cd16aa 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 @@ -9,9 +9,9 @@ import java.util.Optional; class HsOfficePersonEntityPatcher implements EntityPatcher { - private final HsOfficePersonEntity entity; + private final HsOfficePersonRbacEntity entity; - HsOfficePersonEntityPatcher(final HsOfficePersonEntity entity) { + HsOfficePersonEntityPatcher(final HsOfficePersonRbacEntity entity) { this.entity = entity; } diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRbacEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRbacEntity.java new file mode 100644 index 00000000..a9011558 --- /dev/null +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRbacEntity.java @@ -0,0 +1,52 @@ +package net.hostsharing.hsadminng.hs.office.person; + +import lombok.*; +import lombok.experimental.FieldNameConstants; +import lombok.experimental.SuperBuilder; +import net.hostsharing.hsadminng.errors.DisplayAs; +import net.hostsharing.hsadminng.rbac.generator.RbacView; +import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL; + +import jakarta.persistence.*; +import java.io.IOException; + +import static net.hostsharing.hsadminng.rbac.generator.RbacView.GLOBAL; +import static net.hostsharing.hsadminng.rbac.generator.RbacView.Permission.*; +import static net.hostsharing.hsadminng.rbac.generator.RbacView.RbacSubjectReference.UserRole.CREATOR; +import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*; +import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor; + +@Entity +@Table(schema = "hs_office", name = "person_rv") +@Getter +@Setter +@NoArgsConstructor +@SuperBuilder(toBuilder = true) +@FieldNameConstants +@DisplayAs("RbacPerson") +public class HsOfficePersonRbacEntity extends HsOfficePerson { + + public static RbacView rbac() { + return rbacViewFor("person", HsOfficePersonRbacEntity.class) + .withIdentityView(SQL.projection("concat(tradeName, familyName, givenName)")) + .withUpdatableColumns("personType", "title", "salutation", "tradeName", "givenName", "familyName") + .toRole(GLOBAL, GUEST).grantPermission(INSERT) + + .createRole(OWNER, (with) -> { + with.permission(DELETE); + with.owningUser(CREATOR); + with.incomingSuperRole(GLOBAL, ADMIN); + }) + .createSubRole(ADMIN, (with) -> { + with.permission(UPDATE); + }) + .createSubRole(REFERRER, (with) -> { + with.permission(SELECT); + }); + } + + + public static void main(String[] args) throws IOException { + rbac().generateWithBaseFileName("5-hs-office/502-person/5023-hs-office-person-rbac"); + } +} diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRbacRepository.java similarity index 71% rename from src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepository.java rename to src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRbacRepository.java index 91a2c2b3..a6b2a436 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRbacRepository.java @@ -8,23 +8,23 @@ import java.util.List; import java.util.Optional; import java.util.UUID; -public interface HsOfficePersonRepository extends Repository { +public interface HsOfficePersonRbacRepository extends Repository { @Timed("app.office.persons.repo.findByUuid.rbac") - Optional findByUuid(UUID personUuid); + Optional findByUuid(UUID personUuid); @Query(""" - SELECT p FROM HsOfficePersonEntity p + SELECT p FROM HsOfficePersonRbacEntity p WHERE :name is null OR p.tradeName like concat(cast(:name as text), '%') OR p.givenName like concat(cast(:name as text), '%') OR p.familyName like concat(cast(:name as text), '%') """) @Timed("app.office.persons.repo.findPersonByOptionalNameLike.rbac") - List findPersonByOptionalNameLike(String name); + List findPersonByOptionalNameLike(String name); @Timed("app.office.persons.repo.save.rbac") - HsOfficePersonEntity save(final HsOfficePersonEntity entity); + HsOfficePersonRbacEntity save(final HsOfficePersonRbacEntity entity); @Timed("app.office.persons.repo.deleteByUuid.rbac") int deleteByUuid(final UUID personUuid); diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRealEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRealEntity.java new file mode 100644 index 00000000..766785a0 --- /dev/null +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRealEntity.java @@ -0,0 +1,23 @@ +package net.hostsharing.hsadminng.hs.office.person; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.FieldNameConstants; +import lombok.experimental.SuperBuilder; +import net.hostsharing.hsadminng.errors.DisplayAs; + +import jakarta.persistence.Entity; +import jakarta.persistence.Table; + + +@Entity +@Table(schema = "hs_office", name = "person") +@Getter +@Setter +@NoArgsConstructor +@SuperBuilder(toBuilder = true) +@FieldNameConstants +@DisplayAs("RealPerson") +public class HsOfficePersonRealEntity extends HsOfficePerson { +} diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRealRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRealRepository.java new file mode 100644 index 00000000..5041b702 --- /dev/null +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRealRepository.java @@ -0,0 +1,34 @@ +package net.hostsharing.hsadminng.hs.office.person; + +import io.micrometer.core.annotation.Timed; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.Repository; + +import java.util.List; +import java.util.Optional; +import java.util.UUID; + +public interface HsOfficePersonRealRepository extends Repository { + + @Timed("app.office.persons.repo.findByUuid.rbac") + Optional findByUuid(UUID personUuid); + + @Query(""" + SELECT p FROM HsOfficePersonRbacEntity p + WHERE :name is null + OR p.tradeName like concat(cast(:name as text), '%') + OR p.givenName like concat(cast(:name as text), '%') + OR p.familyName like concat(cast(:name as text), '%') + """) + @Timed("app.office.persons.repo.findPersonByOptionalNameLike.rbac") + List findPersonByOptionalNameLike(String name); + + @Timed("app.office.persons.repo.save.rbac") + HsOfficePersonRealEntity save(final HsOfficePersonRealEntity entity); + + @Timed("app.office.persons.repo.deleteByUuid.rbac") + int deleteByUuid(final UUID personUuid); + + @Timed("app.office.persons.repo.count.rbac") + long count(); +} diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelation.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelation.java index c1b4ad8c..7a687a3b 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelation.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelation.java @@ -4,7 +4,7 @@ import lombok.*; import lombok.experimental.FieldNameConstants; import lombok.experimental.SuperBuilder; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealEntity; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealEntity; import net.hostsharing.hsadminng.persistence.BaseEntity; import net.hostsharing.hsadminng.repr.Stringify; import net.hostsharing.hsadminng.repr.Stringifyable; @@ -45,11 +45,11 @@ public class HsOfficeRelation implements BaseEntity, Stringify @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "anchoruuid") - private HsOfficePersonEntity anchor; + private HsOfficePersonRealEntity anchor; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "holderuuid") - private HsOfficePersonEntity holder; + private HsOfficePersonRealEntity holder; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "contactuuid") diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationController.java index b8b8cd61..d543e81e 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationController.java @@ -5,7 +5,7 @@ import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealRepository; import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficeRelationsApi; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.*; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealRepository; import net.hostsharing.hsadminng.mapper.StandardMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; @@ -34,7 +34,7 @@ public class HsOfficeRelationController implements HsOfficeRelationsApi { private HsOfficeRelationRbacRepository relationRbacRepo; @Autowired - private HsOfficePersonRepository holderRepo; + private HsOfficePersonRealRepository personRepo; @Autowired private HsOfficeContactRealRepository realContactRepo; @@ -78,10 +78,10 @@ public class HsOfficeRelationController implements HsOfficeRelationsApi { final var entityToSave = new HsOfficeRelationRbacEntity(); entityToSave.setType(HsOfficeRelationType.valueOf(body.getType())); entityToSave.setMark(body.getMark()); - entityToSave.setAnchor(holderRepo.findByUuid(body.getAnchorUuid()).orElseThrow( + entityToSave.setAnchor(personRepo.findByUuid(body.getAnchorUuid()).orElseThrow( () -> new NoSuchElementException("cannot find Person by anchorUuid: " + body.getAnchorUuid()) )); - entityToSave.setHolder(holderRepo.findByUuid(body.getHolderUuid()).orElseThrow( + entityToSave.setHolder(personRepo.findByUuid(body.getHolderUuid()).orElseThrow( () -> new NoSuchElementException("cannot find Person by holderUuid: " + body.getHolderUuid()) )); entityToSave.setContact(realContactRepo.findByUuid(body.getContactUuid()).orElseThrow( diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRbacEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRbacEntity.java index e6e1beea..062c3702 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRbacEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRbacEntity.java @@ -6,7 +6,7 @@ import lombok.Setter; import lombok.experimental.SuperBuilder; import net.hostsharing.hsadminng.errors.DisplayAs; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRbacEntity; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRbacEntity; import net.hostsharing.hsadminng.rbac.generator.RbacView; import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL; @@ -52,11 +52,11 @@ public class HsOfficeRelationRbacEntity extends HsOfficeRelation { .withRestrictedViewOrderBy(SQL.expression( "(select idName from hs_office.person_iv p where p.uuid = target.holderUuid)")) .withUpdatableColumns("contactUuid") - .importEntityAlias("anchorPerson", HsOfficePersonEntity.class, usingDefaultCase(), + .importEntityAlias("anchorPerson", HsOfficePersonRbacEntity.class, usingDefaultCase(), dependsOnColumn("anchorUuid"), directlyFetchedByDependsOnColumn(), NOT_NULL) - .importEntityAlias("holderPerson", HsOfficePersonEntity.class, usingDefaultCase(), + .importEntityAlias("holderPerson", HsOfficePersonRbacEntity.class, usingDefaultCase(), dependsOnColumn("holderUuid"), directlyFetchedByDependsOnColumn(), NOT_NULL) 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 311ce4ad..7e9bd3c3 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java @@ -11,7 +11,7 @@ import net.hostsharing.hsadminng.hs.office.membership.HsOfficeMembershipEntity; import net.hostsharing.hsadminng.hs.office.membership.HsOfficeMembershipStatus; import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerDetailsEntity; import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonType; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelation; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; @@ -81,7 +81,7 @@ public abstract class BaseOfficeDataImport extends CsvDataImport { ); static Map contacts = new WriteOnceMap<>(); - static Map persons = new WriteOnceMap<>(); + static Map persons = new WriteOnceMap<>(); static Map partners = new WriteOnceMap<>(); static Map debitors = new WriteOnceMap<>(); static Map memberships = new WriteOnceMap<>(); @@ -731,7 +731,7 @@ public abstract class BaseOfficeDataImport extends CsvDataImport { return; } - final var person = HsOfficePersonEntity.builder().build(); + final var person = HsOfficePersonRealEntity.builder().build(); final var partnerRel = addRelation( HsOfficeRelationType.PARTNER, @@ -994,14 +994,14 @@ public abstract class BaseOfficeDataImport extends CsvDataImport { addPerson(partnerPerson, rec); } - HsOfficePersonEntity contactPerson = partnerPerson; + HsOfficePersonRealEntity contactPerson = partnerPerson; if (!StringUtils.equals(rec.getString("firma"), partnerPerson.getTradeName()) || partnerPerson.getPersonType() != determinePersonType(rec) || !StringUtils.equals(rec.getString("title"), partnerPerson.getTitle()) || !StringUtils.equals(rec.getString("salut"), partnerPerson.getSalutation()) || !StringUtils.equals(rec.getString("first_name"), partnerPerson.getGivenName()) || !StringUtils.equals(rec.getString("last_name"), partnerPerson.getFamilyName())) { - contactPerson = addPerson(HsOfficePersonEntity.builder().build(), rec); + contactPerson = addPerson(HsOfficePersonRealEntity.builder().build(), rec); } final var contact = HsOfficeContactRealEntity.builder().build(); @@ -1084,8 +1084,8 @@ public abstract class BaseOfficeDataImport extends CsvDataImport { private static HsOfficeRelationRealEntity addRelation( final HsOfficeRelationType type, - final HsOfficePersonEntity anchor, - final HsOfficePersonEntity holder, + final HsOfficePersonRealEntity anchor, + final HsOfficePersonRealEntity holder, final HsOfficeContactRealEntity contact) { final var rel = HsOfficeRelationRealEntity.builder() .anchor(anchor) @@ -1097,7 +1097,7 @@ public abstract class BaseOfficeDataImport extends CsvDataImport { return rel; } - private HsOfficePersonEntity addPerson(final HsOfficePersonEntity person, final Record contactRecord) { + private HsOfficePersonRealEntity addPerson(final HsOfficePersonRealEntity person, final Record contactRecord) { person.setSalutation(contactRecord.getString("salut")); person.setTitle(contactRecord.getString("title")); person.setGivenName(contactRecord.getString("first_name")); 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 65cfa7f5..d0b56745 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 @@ -7,7 +7,7 @@ import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountRepository; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealRepository; import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerRepository; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealRepository; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealRepository; import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup; @@ -57,16 +57,16 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu HsOfficePartnerRepository partnerRepo; @Autowired - HsOfficeContactRealRepository contactrealRepo; + HsOfficeContactRealRepository contactRealRepo; @Autowired HsOfficeBankAccountRepository bankAccountRepo; @Autowired - HsOfficePersonRepository personRepo; + HsOfficePersonRealRepository personRealRepo; @Autowired - HsOfficeRelationRealRepository relrealRepo; + HsOfficeRelationRealRepository relationRealRepo; @Autowired JpaAttempt jpaAttempt; @@ -270,13 +270,13 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu context.define("superuser-alex@hostsharing.net"); final var givenPartner = partnerRepo.findPartnerByOptionalNameLike("Third").get(0); - final var givenContact = contactrealRepo.findContactByOptionalCaptionLike("fourth").get(0); + final var givenContact = contactRealRepo.findContactByOptionalCaptionLike("fourth").get(0); final var givenBankAccount = bankAccountRepo.findByOptionalHolderLike("Fourth").get(0); - final var givenBillingPerson = personRepo.findPersonByOptionalNameLike("Fourth").get(0); + final var givenBillingPerson = personRealRepo.findPersonByOptionalNameLike("Fourth").get(0); final var givenDebitorRelUUid = jpaAttempt.transacted(() -> { context.define("superuser-alex@hostsharing.net"); - return relrealRepo.save(HsOfficeRelationRealEntity.builder() + return relationRealRepo.save(HsOfficeRelationRealEntity.builder() .type(DEBITOR) .anchor(givenPartner.getPartnerRel().getHolder()) .holder(givenBillingPerson) @@ -327,7 +327,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu context.define("superuser-alex@hostsharing.net"); final var givenPartner = partnerRepo.findPartnerByOptionalNameLike("Third").get(0); - final var givenContact = contactrealRepo.findContactByOptionalCaptionLike("fourth").get(0); + final var givenContact = contactRealRepo.findContactByOptionalCaptionLike("fourth").get(0); final var location = RestAssured // @formatter:off .given() @@ -554,7 +554,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu context.define("superuser-alex@hostsharing.net"); final var givenDebitor = givenSomeTemporaryDebitor(); - final var givenContact = contactrealRepo.findContactByOptionalCaptionLike("fourth").get(0); + final var givenContact = contactRealRepo.findContactByOptionalCaptionLike("fourth").get(0); final var location = RestAssured // @formatter:off .given() @@ -724,7 +724,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu return jpaAttempt.transacted(() -> { context.define("superuser-alex@hostsharing.net"); final var givenPartner = partnerRepo.findPartnerByOptionalNameLike("Fourth").get(0).load(); - final var givenContact = contactrealRepo.findContactByOptionalCaptionLike("fourth contact").get(0); + final var givenContact = contactRealRepo.findContactByOptionalCaptionLike("fourth contact").get(0); final var newDebitor = HsOfficeDebitorEntity.builder() .debitorNumberSuffix(nextDebitorSuffix()) .billable(true) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityUnitTest.java index a1c5ea0e..57351efe 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityUnitTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.debitor; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealEntity; import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonType; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; import net.hostsharing.hsadminng.rbac.generator.RbacViewMermaidFlowchartGenerator; @@ -13,11 +13,11 @@ import static org.assertj.core.api.Assertions.assertThat; class HsOfficeDebitorEntityUnitTest { private final HsOfficeRelationRealEntity givenDebitorRel = HsOfficeRelationRealEntity.builder() - .anchor(HsOfficePersonEntity.builder() + .anchor(HsOfficePersonRealEntity.builder() .personType(HsOfficePersonType.LEGAL_PERSON) .tradeName("some partner trade name") .build()) - .holder(HsOfficePersonEntity.builder() + .holder(HsOfficePersonRealEntity.builder() .personType(HsOfficePersonType.LEGAL_PERSON) .tradeName("some billing trade name") .build()) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepositoryIntegrationTest.java index 16cca312..781077cb 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepositoryIntegrationTest.java @@ -4,7 +4,7 @@ import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountRepository; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealRepository; import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerRepository; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealRepository; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelation; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationType; @@ -53,7 +53,7 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean HsOfficeContactRealRepository contactrealRepo; @Autowired - HsOfficePersonRepository personRepo; + HsOfficePersonRealRepository personRepo; @Autowired HsOfficeBankAccountRepository bankAccountRepo; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/TestHsOfficeDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/TestHsOfficeDebitor.java index a3df1026..cd6233dc 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/TestHsOfficeDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/TestHsOfficeDebitor.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.debitor; import lombok.experimental.UtilityClass; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; import static net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealTestEntity.TEST_REAL_CONTACT; @@ -15,8 +15,8 @@ public class TestHsOfficeDebitor { public static final HsOfficeDebitorEntity TEST_DEBITOR = HsOfficeDebitorEntity.builder() .debitorNumberSuffix(DEFAULT_DEBITOR_SUFFIX) .debitorRel(HsOfficeRelationRealEntity.builder() - .holder(HsOfficePersonEntity.builder().build()) - .anchor(HsOfficePersonEntity.builder().build()) + .holder(HsOfficePersonRealEntity.builder().build()) + .anchor(HsOfficePersonRealEntity.builder().build()) .contact(TEST_REAL_CONTACT) .build()) .partner(TEST_PARTNER) 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 5f82a9d3..14be1371 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 @@ -5,8 +5,8 @@ import io.restassured.http.ContentType; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealEntity; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealRepository; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRbacEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealRepository; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelation; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealRepository; @@ -48,7 +48,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu HsOfficeRelationRealRepository relationRepo; @Autowired - HsOfficePersonRepository personRepo; + HsOfficePersonRealRepository personRepo; @Autowired HsOfficeContactRealRepository contactrealRepo; @@ -224,7 +224,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu // TODO.impl: we want this error message: // .body("message", is("ERROR: [400] Unable to find Person by uuid: " + GIVEN_NON_EXISTING_UUID)); // but ModelMapper creates this error message: - .body("message", is("ERROR: [400] Unable to find " + HsOfficePersonEntity.class.getName() + " with id " + GIVEN_NON_EXISTING_UUID)); + .body("message", is("ERROR: [400] Unable to find " + HsOfficePersonRbacEntity.class.getName() + " with id " + GIVEN_NON_EXISTING_UUID)); // @formatter:on } } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerRestTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerRestTest.java index 31e0786d..7757366f 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerRestTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerControllerRestTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.partner; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRbacEntity; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRbacEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealRepository; import net.hostsharing.hsadminng.mapper.StandardMapper; @@ -66,10 +66,10 @@ class HsOfficePartnerControllerRestTest { EntityManagerFactory emf; @Mock - HsOfficePersonEntity mandateMock; + HsOfficePersonRbacEntity mandateMock; @Mock - HsOfficePersonEntity personMock; + HsOfficePersonRbacEntity personMock; @Mock HsOfficeContactRbacEntity contactMock; @@ -84,8 +84,8 @@ class HsOfficePartnerControllerRestTest { when(emf.createEntityManager(any(SynchronizationType.class))).thenReturn(em); when(emf.createEntityManager(any(SynchronizationType.class), any(Map.class))).thenReturn(em); - lenient().when(em.getReference(HsOfficePersonEntity.class, GIVEN_MANDANTE_UUID)).thenReturn(mandateMock); - lenient().when(em.getReference(HsOfficePersonEntity.class, GIVEN_PERSON_UUID)).thenReturn(personMock); + lenient().when(em.getReference(HsOfficePersonRbacEntity.class, GIVEN_MANDANTE_UUID)).thenReturn(mandateMock); + lenient().when(em.getReference(HsOfficePersonRbacEntity.class, GIVEN_PERSON_UUID)).thenReturn(personMock); lenient().when(em.getReference(HsOfficeContactRbacEntity.class, GIVEN_CONTACT_UUID)).thenReturn(contactMock); lenient().when(em.getReference(any(), eq(GIVEN_INVALID_UUID))).thenThrow(EntityNotFoundException.class); } 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 8a3c0084..71923e01 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 @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.partner; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRbacEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePartnerDetailsPatchResource; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRbacEntity; import net.hostsharing.hsadminng.rbac.test.PatchUnitTestBase; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.TestInstance; @@ -45,8 +45,8 @@ class HsOfficePartnerDetailsEntityPatcherUnitTest extends PatchUnitTestBase< void initMocks() { lenient().when(em.getReference(eq(HsOfficeContactRbacEntity.class), any())).thenAnswer(invocation -> HsOfficeContactRbacEntity.builder().uuid(invocation.getArgument(1)).build()); - lenient().when(em.getReference(eq(HsOfficePersonEntity.class), any())).thenAnswer(invocation -> - HsOfficePersonEntity.builder().uuid(invocation.getArgument(1)).build()); + lenient().when(em.getReference(eq(HsOfficePersonRbacEntity.class), any())).thenAnswer(invocation -> + HsOfficePersonRbacEntity.builder().uuid(invocation.getArgument(1)).build()); } @Override 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 a2ed7ca5..102b54e5 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 @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.partner; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficePartnerPatchResource; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; import net.hostsharing.hsadminng.rbac.test.PatchUnitTestBase; import org.junit.jupiter.api.BeforeEach; @@ -33,7 +33,7 @@ class HsOfficePartnerEntityPatcherUnitTest extends PatchUnitTestBase< private static final UUID INITIAL_DETAILS_UUID = UUID.randomUUID(); private static final UUID PATCHED_PARTNER_ROLE_UUID = UUID.randomUUID(); - private final HsOfficePersonEntity givenInitialPerson = HsOfficePersonEntity.builder() + private final HsOfficePersonRealEntity givenInitialPerson = HsOfficePersonRealEntity.builder() .uuid(INITIAL_PERSON_UUID) .build(); private final HsOfficeContactRealEntity givenInitialContact = HsOfficeContactRealEntity.builder() diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityUnitTest.java index 33c83df7..93ca0315 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntityUnitTest.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.partner; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealEntity; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonType; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationType; @@ -15,12 +15,12 @@ class HsOfficePartnerEntityUnitTest { private final HsOfficePartnerEntity givenPartner = HsOfficePartnerEntity.builder() .partnerNumber(12345) .partnerRel(HsOfficeRelationRealEntity.builder() - .anchor(HsOfficePersonEntity.builder() + .anchor(HsOfficePersonRealEntity.builder() .personType(HsOfficePersonType.LEGAL_PERSON) .tradeName("Hostsharing eG") .build()) .type(HsOfficeRelationType.PARTNER) - .holder(HsOfficePersonEntity.builder() + .holder(HsOfficePersonRealEntity.builder() .personType(HsOfficePersonType.LEGAL_PERSON) .tradeName("some trade name") .build()) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepositoryIntegrationTest.java index 90c79490..79ff449d 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepositoryIntegrationTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.partner; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealRepository; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealRepository; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealRepository; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationType; @@ -45,7 +45,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTestWithClean HsOfficeRelationRealRepository relationRepo; @Autowired - HsOfficePersonRepository personRepo; + HsOfficePersonRealRepository personRepo; @Autowired HsOfficeContactRealRepository contactrealRepo; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/TestHsOfficePartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/TestHsOfficePartner.java index 1d3b8164..02358e28 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/TestHsOfficePartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/TestHsOfficePartner.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.partner; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealEntity; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRealEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationType; @@ -16,12 +16,12 @@ public class TestHsOfficePartner { .partnerNumber(10001) .partnerRel( HsOfficeRelationRealEntity.builder() - .holder(HsOfficePersonEntity.builder() + .holder(HsOfficePersonRealEntity.builder() .personType(LEGAL_PERSON) .tradeName("Hostsharing eG") .build()) .type(HsOfficeRelationType.PARTNER) - .holder(HsOfficePersonEntity.builder() + .holder(HsOfficePersonRealEntity.builder() .personType(LEGAL_PERSON) .tradeName(tradeName) .build()) 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 d0228ad2..15307e4e 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 @@ -43,7 +43,7 @@ class HsOfficePersonControllerAcceptanceTest extends ContextBasedTestWithCleanup Context contextMock; @Autowired - HsOfficePersonRepository personRepo; + HsOfficePersonRealRepository personRepo; @Autowired JpaAttempt jpaAttempt; @@ -327,10 +327,10 @@ class HsOfficePersonControllerAcceptanceTest extends ContextBasedTestWithCleanup } } - private HsOfficePersonEntity givenSomeTemporaryPersonCreatedBy(final String creatingUser) { + private HsOfficePersonRealEntity givenSomeTemporaryPersonCreatedBy(final String creatingUser) { return jpaAttempt.transacted(() -> { context.define(creatingUser); - final var newPerson = HsOfficePersonEntity.builder() + final var newPerson = HsOfficePersonRealEntity.builder() .uuid(UUID.randomUUID()) .personType(HsOfficePersonType.LEGAL_PERSON) .tradeName("Temp " + Context.getCallerMethodNameFromStackFrame(2)) @@ -347,7 +347,7 @@ class HsOfficePersonControllerAcceptanceTest extends ContextBasedTestWithCleanup jpaAttempt.transacted(() -> { context.define("superuser-alex@hostsharing.net", null); em.createQuery(""" - DELETE FROM HsOfficePersonEntity p + DELETE FROM HsOfficePersonRealEntity p WHERE p.tradeName LIKE 'Temp %' OR p.givenName LIKE 'Temp %' """).executeUpdate(); }).assertSuccessful(); 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 39dabaa7..c38e4153 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 @@ -13,14 +13,14 @@ import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; @TestInstance(PER_CLASS) class HsOfficePersonEntityPatcherUnitTest extends PatchUnitTestBase< HsOfficePersonPatchResource, - HsOfficePersonEntity + HsOfficePersonRbacEntity > { private static final UUID INITIAL_PERSON_UUID = UUID.randomUUID(); @Override - protected HsOfficePersonEntity newInitialEntity() { - final var entity = new HsOfficePersonEntity(); + protected HsOfficePersonRbacEntity newInitialEntity() { + final var entity = new HsOfficePersonRbacEntity(); entity.setUuid(INITIAL_PERSON_UUID); entity.setPersonType(HsOfficePersonType.LEGAL_PERSON); entity.setTradeName("initial trade name"); @@ -37,7 +37,7 @@ class HsOfficePersonEntityPatcherUnitTest extends PatchUnitTestBase< } @Override - protected HsOfficePersonEntityPatcher createPatcher(final HsOfficePersonEntity entity) { + protected HsOfficePersonEntityPatcher createPatcher(final HsOfficePersonRbacEntity entity) { return new HsOfficePersonEntityPatcher(entity); } @@ -48,34 +48,34 @@ class HsOfficePersonEntityPatcherUnitTest extends PatchUnitTestBase< "personType", HsOfficePersonPatchResource::setPersonType, HsOfficePersonTypeResource.INCORPORATED_FIRM, - HsOfficePersonEntity::setPersonType, + HsOfficePersonRbacEntity::setPersonType, HsOfficePersonType.INCORPORATED_FIRM) .notNullable(), new JsonNullableProperty<>( "tradeName", HsOfficePersonPatchResource::setTradeName, "patched trade name", - HsOfficePersonEntity::setTradeName), + HsOfficePersonRbacEntity::setTradeName), new JsonNullableProperty<>( "title", HsOfficePersonPatchResource::setTitle, "Dr. Patch.", - HsOfficePersonEntity::setTitle), + HsOfficePersonRbacEntity::setTitle), new JsonNullableProperty<>( "salutation", HsOfficePersonPatchResource::setSalutation, "Hallo Ini", - HsOfficePersonEntity::setSalutation), + HsOfficePersonRbacEntity::setSalutation), new JsonNullableProperty<>( "familyName", HsOfficePersonPatchResource::setFamilyName, "patched family name", - HsOfficePersonEntity::setFamilyName), + HsOfficePersonRbacEntity::setFamilyName), new JsonNullableProperty<>( "patched given name", HsOfficePersonPatchResource::setGivenName, "patched given name", - HsOfficePersonEntity::setGivenName) + HsOfficePersonRbacEntity::setGivenName) ); } } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityUnitTest.java index 36c4b870..40b52ae1 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntityUnitTest.java @@ -11,7 +11,7 @@ class HsOfficePersonEntityUnitTest { @Test void getDisplayReturnsTradeNameIfAvailable() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .personType(HsOfficePersonType.LEGAL_PERSON) .tradeName("some trade name") .build(); @@ -23,7 +23,7 @@ class HsOfficePersonEntityUnitTest { @Test void getDisplayReturnsFamilyAndGivenNameIfNoTradeNameAvailable() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .personType(HsOfficePersonType.NATURAL_PERSON) .familyName("some family name") .givenName("some given name") @@ -36,7 +36,7 @@ class HsOfficePersonEntityUnitTest { @Test void toShortStringWithTradeNameReturnsTradeName() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .personType(HsOfficePersonType.LEGAL_PERSON) .tradeName("some trade name") .familyName("some family name") @@ -50,7 +50,7 @@ class HsOfficePersonEntityUnitTest { @Test void toShortStringWithoutTradeNameReturnsFamilyAndGivenName() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .personType(HsOfficePersonType.NATURAL_PERSON) .familyName("some family name") .givenName("some given name") @@ -63,7 +63,7 @@ class HsOfficePersonEntityUnitTest { @Test void toShortStringWithSalutationAndTitleReturnsSalutationAndTitle() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .personType(HsOfficePersonType.NATURAL_PERSON) .salutation("Frau") .title("Dr.") @@ -78,7 +78,7 @@ class HsOfficePersonEntityUnitTest { @Test void toShortStringWithSalutationAndWithoutTitleReturnsSalutation() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .personType(HsOfficePersonType.NATURAL_PERSON) .salutation("Frau") .familyName("some family name") @@ -92,7 +92,7 @@ class HsOfficePersonEntityUnitTest { @Test void toShortStringWithoutSalutationAndWithTitleReturnsTitle() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .personType(HsOfficePersonType.NATURAL_PERSON) .title("Dr. Dr.") .familyName("some family name") @@ -106,7 +106,7 @@ class HsOfficePersonEntityUnitTest { @Test void toStringWithAllFieldsReturnsAllButUuid() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .uuid(UUID.randomUUID()) .personType(HsOfficePersonType.NATURAL_PERSON) .tradeName("some trade name") @@ -122,7 +122,7 @@ class HsOfficePersonEntityUnitTest { @Test void toStringSkipsNullFields() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .familyName("some family name") .givenName("some given name") .build(); @@ -133,7 +133,7 @@ class HsOfficePersonEntityUnitTest { } @Test void toStringWithSalutationAndTitleRetursSalutationAndTitle() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .salutation("Herr") .title("Prof. Dr.") .familyName("some family name") @@ -146,7 +146,7 @@ class HsOfficePersonEntityUnitTest { } @Test void toStringWithSalutationAndWithoutTitleSkipsTitle() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .salutation("Herr") .familyName("some family name") .givenName("some given name") @@ -159,7 +159,7 @@ class HsOfficePersonEntityUnitTest { @Test void toStringWithoutSalutationAndWithTitleSkipsSalutation() { - final var givenPersonEntity = HsOfficePersonEntity.builder() + final var givenPersonEntity = HsOfficePersonRbacEntity.builder() .title("some title") .familyName("some family name") .givenName("some given name") @@ -172,7 +172,7 @@ class HsOfficePersonEntityUnitTest { @Test void definesRbac() { - final var rbacFlowchart = new RbacViewMermaidFlowchartGenerator(HsOfficePersonEntity.rbac()).toString(); + final var rbacFlowchart = new RbacViewMermaidFlowchartGenerator(HsOfficePersonRbacEntity.rbac()).toString(); assertThat(rbacFlowchart).isEqualTo(""" %%{init:{'flowchart':{'htmlLabels':false}}}%% flowchart TB diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepositoryIntegrationTest.java index 595c732a..34b02379 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepositoryIntegrationTest.java @@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat; class HsOfficePersonRepositoryIntegrationTest extends ContextBasedTestWithCleanup { @Autowired - HsOfficePersonRepository personRepo; + HsOfficePersonRbacRepository personRepo; @Autowired RawRbacRoleRepository rawRoleRepo; @@ -64,7 +64,7 @@ class HsOfficePersonRepositoryIntegrationTest extends ContextBasedTestWithCleanu // then result.assertSuccessful(); - assertThat(result.returnedValue()).isNotNull().extracting(HsOfficePersonEntity::getUuid).isNotNull(); + assertThat(result.returnedValue()).isNotNull().extracting(HsOfficePersonRbacEntity::getUuid).isNotNull(); assertThatPersonIsPersisted(result.returnedValue()); assertThat(personRepo.count()).isEqualTo(count + 1); } @@ -81,7 +81,7 @@ class HsOfficePersonRepositoryIntegrationTest extends ContextBasedTestWithCleanu // then result.assertSuccessful(); - assertThat(result.returnedValue()).isNotNull().extracting(HsOfficePersonEntity::getUuid).isNotNull(); + assertThat(result.returnedValue()).isNotNull().extracting(HsOfficePersonRbacEntity::getUuid).isNotNull(); assertThatPersonIsPersisted(result.returnedValue()); assertThat(personRepo.count()).isEqualTo(count + 1); } @@ -122,7 +122,7 @@ class HsOfficePersonRepositoryIntegrationTest extends ContextBasedTestWithCleanu )); } - private void assertThatPersonIsPersisted(final HsOfficePersonEntity saved) { + private void assertThatPersonIsPersisted(final HsOfficePersonRbacEntity saved) { final var found = personRepo.findByUuid(saved.getUuid()); assertThat(found).isNotEmpty().get().extracting(Object::toString).isEqualTo(saved.toString()); } @@ -276,27 +276,27 @@ class HsOfficePersonRepositoryIntegrationTest extends ContextBasedTestWithCleanu "[creating person test-data, hs_office.person, INSERT, Third OHG, null]"); } - private HsOfficePersonEntity givenSomeTemporaryPerson( + private HsOfficePersonRbacEntity givenSomeTemporaryPerson( final String createdByUser, - Supplier entitySupplier) { + Supplier entitySupplier) { return jpaAttempt.transacted(() -> { context(createdByUser); return toCleanup(personRepo.save(entitySupplier.get())); }).assumeSuccessful().returnedValue(); } - private HsOfficePersonEntity givenSomeTemporaryPerson(final String createdByUser) { + private HsOfficePersonRbacEntity givenSomeTemporaryPerson(final String createdByUser) { return givenSomeTemporaryPerson(createdByUser, () -> hsOfficePerson("some temporary person #" + RandomStringUtils.random(12))); } - void exactlyThesePersonsAreReturned(final List actualResult, final String... personCaptions) { + void exactlyThesePersonsAreReturned(final List actualResult, final String... personCaptions) { assertThat(actualResult) - .extracting(HsOfficePersonEntity::getTradeName) + .extracting(HsOfficePersonRbacEntity::getTradeName) .containsExactlyInAnyOrder(personCaptions); } - void allThesePersonsAreReturned(final List actualResult, final String... personCaptions) { + void allThesePersonsAreReturned(final List actualResult, final String... personCaptions) { assertThat(actualResult) .extracting(hsOfficePersonEntity -> hsOfficePersonEntity.toShortString()) .contains(personCaptions); diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/person/TestHsOfficePerson.java b/src/test/java/net/hostsharing/hsadminng/hs/office/person/TestHsOfficePerson.java index f8e8bafe..b0612ba0 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/person/TestHsOfficePerson.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/person/TestHsOfficePerson.java @@ -3,10 +3,10 @@ package net.hostsharing.hsadminng.hs.office.person; public class TestHsOfficePerson { - public static final HsOfficePersonEntity somePerson = hsOfficePerson("some person"); + public static final HsOfficePersonRbacEntity somePerson = hsOfficePerson("some person"); - static public HsOfficePersonEntity hsOfficePerson(final String tradeName) { - return HsOfficePersonEntity.builder() + static public HsOfficePersonRbacEntity hsOfficePerson(final String tradeName) { + return HsOfficePersonRbacEntity.builder() .personType(HsOfficePersonType.NATURAL_PERSON) .tradeName(tradeName) .build(); diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRealRelationRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRealRelationRepositoryIntegrationTest.java index 5c912263..0b51abf9 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRealRelationRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRealRelationRepositoryIntegrationTest.java @@ -1,7 +1,7 @@ package net.hostsharing.hsadminng.hs.office.relation; import net.hostsharing.hsadminng.context.Context; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRbacRepository; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonType; import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup; import net.hostsharing.hsadminng.rbac.test.JpaAttempt; @@ -30,7 +30,7 @@ class HsOfficeRealRelationRepositoryIntegrationTest extends ContextBasedTestWith HsOfficeRelationRealRepository relationRealRepo; @Autowired - HsOfficePersonRepository personRepo; + HsOfficePersonRbacRepository personRepo; @PersistenceContext EntityManager em; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationControllerAcceptanceTest.java index 02a228f5..53e1f591 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationControllerAcceptanceTest.java @@ -3,11 +3,11 @@ package net.hostsharing.hsadminng.hs.office.relation; import io.restassured.RestAssured; import io.restassured.http.ContentType; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealRepository; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealRepository; import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup; import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeRelationTypeResource; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.test.DisableSecurityConfig; import org.junit.jupiter.api.Nested; @@ -45,7 +45,7 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean HsOfficeRelationRealRepository relationrealRepo; @Autowired - HsOfficePersonRepository personRepo; + HsOfficePersonRealRepository personRepo; @Autowired HsOfficeContactRealRepository contactrealRepo; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationPatcherUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationPatcherUnitTest.java index 2fc9b95e..343fcd90 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationPatcherUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationPatcherUnitTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.relation; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealEntity; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeRelationPatchResource; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealEntity; import net.hostsharing.hsadminng.rbac.test.PatchUnitTestBase; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.TestInstance; @@ -38,10 +38,10 @@ class HsOfficeRelationPatcherUnitTest extends PatchUnitTestBase< HsOfficeContactRealEntity.builder().uuid(invocation.getArgument(1)).build()); } - final HsOfficePersonEntity givenInitialAnchorPerson = HsOfficePersonEntity.builder() + final HsOfficePersonRealEntity givenInitialAnchorPerson = HsOfficePersonRealEntity.builder() .uuid(UUID.randomUUID()) .build(); - final HsOfficePersonEntity givenInitialHolderPerson = HsOfficePersonEntity.builder() + final HsOfficePersonRealEntity givenInitialHolderPerson = HsOfficePersonRealEntity.builder() .uuid(UUID.randomUUID()) .build(); final HsOfficeContactRealEntity givenInitialContact = HsOfficeContactRealEntity.builder() diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRepositoryIntegrationTest.java index 2bf26ee0..b2f50977 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRepositoryIntegrationTest.java @@ -2,7 +2,7 @@ package net.hostsharing.hsadminng.hs.office.relation; import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealRepository; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealRepository; import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup; import net.hostsharing.hsadminng.rbac.grant.RawRbacGrantRepository; import net.hostsharing.hsadminng.rbac.role.RawRbacRoleRepository; @@ -37,7 +37,7 @@ class HsOfficeRelationRepositoryIntegrationTest extends ContextBasedTestWithClea HsOfficeRelationRbacRepository relationRbacRepo; @Autowired - HsOfficePersonRepository personRepo; + HsOfficePersonRealRepository personRepo; @Autowired HsOfficeContactRealRepository contactrealRepo; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationUnitTest.java index 96ebc37c..5ae594b0 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationUnitTest.java @@ -1,6 +1,6 @@ package net.hostsharing.hsadminng.hs.office.relation; -import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRealEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonType; import net.hostsharing.hsadminng.rbac.generator.RbacViewMermaidFlowchartGenerator; import org.junit.jupiter.api.Test; @@ -9,11 +9,11 @@ import static org.assertj.core.api.Assertions.assertThat; class HsOfficeRelationUnitTest { - private HsOfficePersonEntity anchor = HsOfficePersonEntity.builder() + private HsOfficePersonRealEntity anchor = HsOfficePersonRealEntity.builder() .personType(HsOfficePersonType.LEGAL_PERSON) .tradeName("some trade name") .build(); - private HsOfficePersonEntity holder = HsOfficePersonEntity.builder() + private HsOfficePersonRealEntity holder = HsOfficePersonRealEntity.builder() .personType(HsOfficePersonType.NATURAL_PERSON) .familyName("Meier") .givenName("Mellie") diff --git a/src/test/java/net/hostsharing/hsadminng/hs/scenarios/ScenarioTest.java b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/ScenarioTest.java index d1da4bb1..75ea20e7 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/scenarios/ScenarioTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/scenarios/ScenarioTest.java @@ -1,8 +1,8 @@ package net.hostsharing.hsadminng.hs.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.person.HsOfficePersonRbacEntity; +import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRbacRepository; import net.hostsharing.hsadminng.lambda.Reducer; import net.hostsharing.hsadminng.rbac.context.ContextBasedTest; import net.hostsharing.hsadminng.rbac.test.JpaAttempt; @@ -68,7 +68,7 @@ public abstract class ScenarioTest extends ContextBasedTest { Integer port; @Autowired - HsOfficePersonRepository personRepo; + HsOfficePersonRbacRepository personRepo; @Autowired JpaAttempt jpaAttempt; @@ -117,7 +117,7 @@ public abstract class ScenarioTest extends ContextBasedTest { null, personRepo.findPersonByOptionalNameLike("Hostsharing eG") .stream() - .map(HsOfficePersonEntity::getUuid) + .map(HsOfficePersonRbacEntity::getUuid) .reduce(Reducer::toSingleElement).orElseThrow()) ); }