From 6ef34f08eddf90f579296fb50feac5d58d80748a Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Tue, 30 Jan 2024 17:53:26 +0100 Subject: [PATCH] use distinct partnerNumbers in test cases --- ...HsOfficePartnerRepositoryIntegrationTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 743a0ce5..b5975d83 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 @@ -287,11 +287,11 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTestWithClean @Test public void hostsharingAdmin_withoutAssumedRole_canUpdateArbitraryPartner() { // given - context("superuser-alex@hostsharing.net"); - final var givenPartner = givenSomeTemporaryPartnerBessler(20032, "Erben Bessler", "fifth contact"); + context("superuser-alex@hostsharing.net", "hs_office_partner#20033:ErbenBesslerMelBessler.admin"); + final var givenPartner = givenSomeTemporaryPartnerBessler(20036, "Erben Bessler", "fifth contact"); assertThatPartnerIsVisibleForUserWithRole( givenPartner, - "hs_office_partner#20032:ErbenBesslerMelBessler-fifthcontact.admin"); + "hs_office_partner#20033:ErbenBesslerMelBessler-fifthcontact.admin"); assertThatPartnerActuallyInDatabase(givenPartner); context("superuser-alex@hostsharing.net"); final var givenNewPerson = personRepo.findPersonByOptionalNameLike("Third OHG").get(0); @@ -324,20 +324,20 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTestWithClean public void partnerAgent_canNotUpdateRelatedPartner() { // given context("superuser-alex@hostsharing.net"); - final var givenPartner = givenSomeTemporaryPartnerBessler(20032, "Erben Bessler", "ninth"); + final var givenPartner = givenSomeTemporaryPartnerBessler(20037, "Erben Bessler", "ninth"); final var newPartnerRole = em.createNativeQuery( "select uuid from hs_office_relationship where uuid=:partnerRoleUuid") .setParameter("partnerRoleUuid", givenPartner.getPartnerRole().getUuid()) .getSingleResult(); assertThatPartnerIsVisibleForUserWithRole( givenPartner, - "hs_office_partner#20032:ErbenBesslerMelBessler-ninthcontact.agent"); + "hs_office_partner#20033:ErbenBesslerMelBessler-ninthcontact.agent"); assertThatPartnerActuallyInDatabase(givenPartner); // when final var result = jpaAttempt.transacted(() -> { context("superuser-alex@hostsharing.net", - "hs_office_partner#20032:ErbenBesslerMelBessler-ninthcontact.agent"); + "hs_office_partner#20033:ErbenBesslerMelBessler-ninthcontact.agent"); givenPartner.getDetails().setBirthName("new birthname"); return partnerRepo.save(givenPartner); }); @@ -425,7 +425,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTestWithClean context("superuser-alex@hostsharing.net"); final var initialRoleNames = Array.from(roleNamesOf(rawRoleRepo.findAll())); final var initialGrantNames = Array.from(grantDisplaysOf(rawGrantRepo.findAll())); - final var givenPartner = givenSomeTemporaryPartnerBessler(20032, "Erben Bessler", "twelfth"); + final var givenPartner = givenSomeTemporaryPartnerBessler(20034, "Erben Bessler", "twelfth"); // when final var result = jpaAttempt.transacted(() -> { @@ -506,7 +506,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTestWithClean @AfterEach void cleanup() { cleanupAllNew(HsOfficePartnerEntity.class); - cleanupAllNew(HsOfficePartnerDetailsEntity.class); + cleanupAllNew(HsOfficePartnerDetailsEntity.class); // TODO: should not be necessary cleanupAllNew(HsOfficeRelationshipEntity.class); } }