From 16d1372d41c02ba356675e12487893324dfeec7c Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 30 Sep 2022 13:11:34 +0200 Subject: [PATCH] shorter person names to make tests easier to read --- .../218-hs-office-person-test-data.sql | 6 +++--- .../228-hs-office-partner-test-data.sql | 6 +++--- .../238-hs-office-relationship-test-data.sql | 6 +++--- ...sOfficePartnerControllerAcceptanceTest.java | 18 +++++++++--------- ...OfficePartnerRepositoryIntegrationTest.java | 18 +++++++++--------- ...HsOfficePersonControllerAcceptanceTest.java | 6 +++--- ...sOfficePersonRepositoryIntegrationTest.java | 8 ++++---- ...ceRelationshipControllerAcceptanceTest.java | 18 +++++++++--------- ...eRelationshipRepositoryIntegrationTest.java | 10 +++++----- 9 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/main/resources/db/changelog/218-hs-office-person-test-data.sql b/src/main/resources/db/changelog/218-hs-office-person-test-data.sql index 382c5f0e..f761d528 100644 --- a/src/main/resources/db/changelog/218-hs-office-person-test-data.sql +++ b/src/main/resources/db/changelog/218-hs-office-person-test-data.sql @@ -59,10 +59,10 @@ end; $$; do language plpgsql $$ begin - call createHsOfficePersonTestData('LEGAL', 'First Impressions GmbH'); + call createHsOfficePersonTestData('LEGAL', 'First GmbH'); call createHsOfficePersonTestData('NATURAL', null, 'Smith', 'Peter'); - call createHsOfficePersonTestData('LEGAL', 'Rockshop e.K.', 'Sandra', 'Miller'); - call createHsOfficePersonTestData('SOLE_REPRESENTATION', 'Ostfriesische Kuhhandel OHG'); + call createHsOfficePersonTestData('LEGAL', 'Second e.K.', 'Sandra', 'Miller'); + call createHsOfficePersonTestData('SOLE_REPRESENTATION', 'Third OHG'); call createHsOfficePersonTestData('JOINT_REPRESENTATION', 'Erben Bessler', 'Mel', 'Bessler'); call createHsOfficePersonTestData('NATURAL', null, 'Bessler', 'Anita'); call createHsOfficePersonTestData('NATURAL', null, 'Winkler', 'Paul'); diff --git a/src/main/resources/db/changelog/228-hs-office-partner-test-data.sql b/src/main/resources/db/changelog/228-hs-office-partner-test-data.sql index c2f88411..60a5de4e 100644 --- a/src/main/resources/db/changelog/228-hs-office-partner-test-data.sql +++ b/src/main/resources/db/changelog/228-hs-office-partner-test-data.sql @@ -63,11 +63,11 @@ end; $$; do language plpgsql $$ begin - call createHsOfficePartnerTestData('First Impressions GmbH', 'first contact'); + call createHsOfficePartnerTestData('First GmbH', 'first contact'); - call createHsOfficePartnerTestData('Rockshop e.K.', 'second contact'); + call createHsOfficePartnerTestData('Second e.K.', 'second contact'); - call createHsOfficePartnerTestData('Ostfriesische Kuhhandel OHG', 'third contact'); + call createHsOfficePartnerTestData('Third OHG', 'third contact'); end; $$; --// diff --git a/src/main/resources/db/changelog/238-hs-office-relationship-test-data.sql b/src/main/resources/db/changelog/238-hs-office-relationship-test-data.sql index a2b71ccc..64e7be12 100644 --- a/src/main/resources/db/changelog/238-hs-office-relationship-test-data.sql +++ b/src/main/resources/db/changelog/238-hs-office-relationship-test-data.sql @@ -71,11 +71,11 @@ end; $$; do language plpgsql $$ begin - call createHsOfficeRelationshipTestData('First Impressions GmbH', 'Smith', 'SOLE_AGENT', 'first contact'); + call createHsOfficeRelationshipTestData('First GmbH', 'Smith', 'SOLE_AGENT', 'first contact'); - call createHsOfficeRelationshipTestData('Rockshop e.K.', 'Smith', 'SOLE_AGENT', 'second contact'); + call createHsOfficeRelationshipTestData('Second e.K.', 'Smith', 'SOLE_AGENT', 'second contact'); - call createHsOfficeRelationshipTestData('Ostfriesische Kuhhandel OHG', 'Smith', 'SOLE_AGENT', 'third contact'); + call createHsOfficeRelationshipTestData('Third OHG', 'Smith', 'SOLE_AGENT', 'third contact'); end; $$; --// 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 73a6d0c5..d4355ab9 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 @@ -77,15 +77,15 @@ class HsOfficePartnerControllerAcceptanceTest { .body("", lenientlyEquals(""" [ { - "person": { "tradeName": "First Impressions GmbH" }, + "person": { "tradeName": "First GmbH" }, "contact": { "label": "first contact" } }, { - "person": { "tradeName": "Ostfriesische Kuhhandel OHG" }, + "person": { "tradeName": "Third OHG" }, "contact": { "label": "third contact" } }, { - "person": { "tradeName": "Rockshop e.K." }, + "person": { "tradeName": "Second e.K." }, "contact": { "label": "second contact" } } ] @@ -102,7 +102,7 @@ class HsOfficePartnerControllerAcceptanceTest { void globalAdmin_withoutAssumedRole_canAddPartner() { context.define("superuser-alex@hostsharing.net"); - final var givenPerson = personRepo.findPersonByOptionalNameLike("Ostfriesische").get(0); + final var givenPerson = personRepo.findPersonByOptionalNameLike("Third").get(0); final var givenContact = contactRepo.findContactByOptionalLabelLike("forth").get(0); final var location = RestAssured // @formatter:off @@ -140,7 +140,7 @@ class HsOfficePartnerControllerAcceptanceTest { void globalAdmin_canNotAddPartner_ifContactDoesNotExist() { context.define("superuser-alex@hostsharing.net"); - final var givenPerson = personRepo.findPersonByOptionalNameLike("Ostfriesische").get(0); + final var givenPerson = personRepo.findPersonByOptionalNameLike("Third").get(0); final var givenContactUuid = UUID.fromString("3fa85f64-5717-4562-b3fc-2c963f66afa6"); final var location = RestAssured // @formatter:off @@ -214,7 +214,7 @@ class HsOfficePartnerControllerAcceptanceTest { .contentType("application/json") .body("", lenientlyEquals(""" { - "person": { "tradeName": "First Impressions GmbH" }, + "person": { "tradeName": "First GmbH" }, "contact": { "label": "first contact" } } """)); // @formatter:on @@ -253,7 +253,7 @@ class HsOfficePartnerControllerAcceptanceTest { .contentType("application/json") .body("", lenientlyEquals(""" { - "person": { "tradeName": "First Impressions GmbH" }, + "person": { "tradeName": "First GmbH" }, "contact": { "label": "first contact" } } """)); // @formatter:on @@ -269,7 +269,7 @@ class HsOfficePartnerControllerAcceptanceTest { context.define("superuser-alex@hostsharing.net"); final var givenPartner = givenSomeTemporaryPartnerBessler(); - final var givenPerson = personRepo.findPersonByOptionalNameLike("Ostfriesische").get(0); + final var givenPerson = personRepo.findPersonByOptionalNameLike("Third").get(0); final var givenContact = contactRepo.findContactByOptionalLabelLike("forth").get(0); final var location = RestAssured // @formatter:off @@ -303,7 +303,7 @@ class HsOfficePartnerControllerAcceptanceTest { context.define("superuser-alex@hostsharing.net"); assertThat(partnerRepo.findByUuid(givenPartner.getUuid())).isPresent().get() .matches(person -> { - assertThat(person.getPerson().getTradeName()).isEqualTo("Ostfriesische Kuhhandel OHG"); + assertThat(person.getPerson().getTradeName()).isEqualTo("Third OHG"); assertThat(person.getContact().getLabel()).isEqualTo("forth contact"); assertThat(person.getRegistrationOffice()).isEqualTo("Registergericht Hamburg"); assertThat(person.getRegistrationNumber()).isEqualTo("222222"); 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 9917e9d5..e66b05f4 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 @@ -71,7 +71,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTest { // given context("superuser-alex@hostsharing.net"); final var count = partnerRepo.count(); - final var givenPerson = personRepo.findPersonByOptionalNameLike("First Impressions GmbH").get(0); + final var givenPerson = personRepo.findPersonByOptionalNameLike("First GmbH").get(0); final var givenContact = contactRepo.findContactByOptionalLabelLike("first contact").get(0); // when @@ -150,21 +150,21 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTest { // then allThesePartnersAreReturned( result, - "partner(Ostfriesische Kuhhandel OHG, third contact)", - "partner(Rockshop e.K., second contact)", - "partner(First Impressions GmbH, first contact)"); + "partner(Third OHG, third contact)", + "partner(Second e.K., second contact)", + "partner(First GmbH, first contact)"); } @Test public void normalUser_canViewOnlyRelatedPartners() { // given: - context("person-FirstImpressionsGmbH@example.com"); + context("person-FirstGmbH@example.com"); // when: final var result = partnerRepo.findPartnerByOptionalNameLike(null); // then: - exactlyThesePartnersAreReturned(result, "partner(First Impressions GmbH, first contact)"); + exactlyThesePartnersAreReturned(result, "partner(First GmbH, first contact)"); } } @@ -180,7 +180,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTest { final var result = partnerRepo.findPartnerByOptionalNameLike("third contact"); // then - exactlyThesePartnersAreReturned(result, "partner(Ostfriesische Kuhhandel OHG, third contact)"); + exactlyThesePartnersAreReturned(result, "partner(Third OHG, third contact)"); } } @@ -197,7 +197,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTest { "hs_office_person#ErbenBesslerMelBessler.admin"); assertThatPartnerActuallyInDatabase(givenPartner); context("superuser-alex@hostsharing.net"); - final var givenNewPerson = personRepo.findPersonByOptionalNameLike("Ostfriesische Kuhhandel OHG").get(0); + final var givenNewPerson = personRepo.findPersonByOptionalNameLike("Third OHG").get(0); final var givenNewContact = contactRepo.findContactByOptionalLabelLike("sixth contact").get(0); // when @@ -216,7 +216,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTest { "global#global.admin"); assertThatPartnerIsVisibleForUserWithRole( result.returnedValue(), - "hs_office_person#OstfriesischeKuhhandelOHG.admin"); + "hs_office_person#ThirdOHG.admin"); assertThatPartnerIsNotVisibleForUserWithRole( result.returnedValue(), "hs_office_person#ErbenBesslerMelBessler.admin"); 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 4c56dde4..dd85d8fa 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 @@ -83,19 +83,19 @@ class HsOfficePersonControllerAcceptanceTest { }, { "personType": "LEGAL", - "tradeName": "First Impressions GmbH", + "tradeName": "First GmbH", "givenName": null, "familyName": null }, { "personType": "SOLE_REPRESENTATION", - "tradeName": "Ostfriesische Kuhhandel OHG", + "tradeName": "Third OHG", "givenName": null, "familyName": null }, { "personType": "LEGAL", - "tradeName": "Rockshop e.K.", + "tradeName": "Second e.K.", "givenName": "Miller", "familyName": "Sandra" }, 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 1280f595..50a3c10b 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 @@ -144,8 +144,8 @@ class HsOfficePersonRepositoryIntegrationTest extends ContextBasedTest { allThesePersonsAreReturned( result, "Smith, Peter", - "Rockshop e.K.", - "Ostfriesische Kuhhandel OHG", + "Second e.K.", + "Third OHG", "Erben Bessler"); } @@ -172,10 +172,10 @@ class HsOfficePersonRepositoryIntegrationTest extends ContextBasedTest { context("superuser-alex@hostsharing.net", null); // when - final var result = personRepo.findPersonByOptionalNameLike("Rockshop"); + final var result = personRepo.findPersonByOptionalNameLike("Second"); // then - exactlyThesePersonsAreReturned(result, "Rockshop e.K."); + exactlyThesePersonsAreReturned(result, "Second e.K."); } @Test 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 79ccbc71..4e4d0ff2 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 @@ -85,7 +85,7 @@ class HsOfficeRelationshipControllerAcceptanceTest { { "relAnchor": { "personType": "SOLE_REPRESENTATION", - "tradeName": "Ostfriesische Kuhhandel OHG" + "tradeName": "Third OHG" }, "relHolder": { "personType": "NATURAL", @@ -98,7 +98,7 @@ class HsOfficeRelationshipControllerAcceptanceTest { { "relAnchor": { "personType": "LEGAL", - "tradeName": "Rockshop e.K.", + "tradeName": "Second e.K.", "givenName": "Miller", "familyName": "Sandra" }, @@ -113,7 +113,7 @@ class HsOfficeRelationshipControllerAcceptanceTest { { "relAnchor": { "personType": "LEGAL", - "tradeName": "First Impressions GmbH" + "tradeName": "First GmbH" }, "relHolder": { "personType": "NATURAL", @@ -138,7 +138,7 @@ class HsOfficeRelationshipControllerAcceptanceTest { void globalAdmin_withoutAssumedRole_canAddRelationship() { context.define("superuser-alex@hostsharing.net"); - final var givenAnchorPerson = personRepo.findPersonByOptionalNameLike("Ostfriesische").get(0); + final var givenAnchorPerson = personRepo.findPersonByOptionalNameLike("Third").get(0); final var givenHolderPerson = personRepo.findPersonByOptionalNameLike("Paul").get(0); final var givenContact = contactRepo.findContactByOptionalLabelLike("forth").get(0); @@ -166,7 +166,7 @@ class HsOfficeRelationshipControllerAcceptanceTest { .contentType(ContentType.JSON) .body("uuid", isUuidValid()) .body("relType", is("ACCOUNTING_CONTACT")) - .body("relAnchor.tradeName", is("Ostfriesische Kuhhandel OHG")) + .body("relAnchor.tradeName", is("Third OHG")) .body("relHolder.givenName", is("Paul")) .body("contact.label", is("forth contact")) .header("Location", startsWith("http://localhost")) @@ -215,7 +215,7 @@ class HsOfficeRelationshipControllerAcceptanceTest { void globalAdmin_canNotAddRelationship_ifHolderPersonDoesNotExist() { context.define("superuser-alex@hostsharing.net"); - final var givenAnchorPerson = personRepo.findPersonByOptionalNameLike("Ostfriesische").get(0); + final var givenAnchorPerson = personRepo.findPersonByOptionalNameLike("Third").get(0); final var givenHolderPersonUuid = UUID.fromString("3fa85f64-5717-4562-b3fc-2c963f66afa6"); final var givenContact = contactRepo.findContactByOptionalLabelLike("forth").get(0); @@ -248,7 +248,7 @@ class HsOfficeRelationshipControllerAcceptanceTest { void globalAdmin_canNotAddRelationship_ifContactDoesNotExist() { context.define("superuser-alex@hostsharing.net"); - final var givenAnchorPerson = personRepo.findPersonByOptionalNameLike("Ostfriesische").get(0); + final var givenAnchorPerson = personRepo.findPersonByOptionalNameLike("Third").get(0); final var givenHolderPerson = personRepo.findPersonByOptionalNameLike("Paul").get(0); final var givenContactUuid = UUID.fromString("3fa85f64-5717-4562-b3fc-2c963f66afa6"); @@ -298,7 +298,7 @@ class HsOfficeRelationshipControllerAcceptanceTest { .contentType("application/json") .body("", lenientlyEquals(""" { - "relAnchor": { "tradeName": "First Impressions GmbH" }, + "relAnchor": { "tradeName": "First GmbH" }, "relHolder": { "familyName": "Smith" }, "contact": { "label": "first contact" } } @@ -339,7 +339,7 @@ class HsOfficeRelationshipControllerAcceptanceTest { .contentType("application/json") .body("", lenientlyEquals(""" { - "relAnchor": { "tradeName": "First Impressions GmbH" }, + "relAnchor": { "tradeName": "First GmbH" }, "relHolder": { "familyName": "Smith" }, "contact": { "label": "first contact" } } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipRepositoryIntegrationTest.java index bfbfd4ff..7ea0986b 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipRepositoryIntegrationTest.java @@ -162,15 +162,15 @@ class HsOfficeRelationshipRepositoryIntegrationTest extends ContextBasedTest { // then allTheseRelationshipsAreReturned( result, - "rel(relAnchor='First Impressions GmbH', relType='SOLE_AGENT', relHolder='Smith, Peter', contact='first contact')", - "rel(relAnchor='Ostfriesische Kuhhandel OHG', relType='SOLE_AGENT', relHolder='Smith, Peter', contact='third contact')", - "rel(relAnchor='Rockshop e.K.', relType='SOLE_AGENT', relHolder='Smith, Peter', contact='second contact')"); + "rel(relAnchor='First GmbH', relType='SOLE_AGENT', relHolder='Smith, Peter', contact='first contact')", + "rel(relAnchor='Third OHG', relType='SOLE_AGENT', relHolder='Smith, Peter', contact='third contact')", + "rel(relAnchor='Second e.K.', relType='SOLE_AGENT', relHolder='Smith, Peter', contact='second contact')"); } @Test public void normalUser_canViewRelationshipsOfOwnedPersons() { // given: - context("person-FirstImpressionsGmbH@example.com"); + context("person-FirstGmbH@example.com"); final var person = personRepo.findPersonByOptionalNameLike("First").stream().findFirst().orElseThrow(); // when: @@ -179,7 +179,7 @@ class HsOfficeRelationshipRepositoryIntegrationTest extends ContextBasedTest { // then: exactlyTheseRelationshipsAreReturned( result, - "rel(relAnchor='First Impressions GmbH', relType='SOLE_AGENT', relHolder='Smith, Peter', contact='first contact')"); + "rel(relAnchor='First GmbH', relType='SOLE_AGENT', relHolder='Smith, Peter', contact='first contact')"); } }