rbac-optimization (#80)
Co-authored-by: Michael Hoennig <michael@hoennig.de> Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/80 Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
+4
-1
@@ -287,7 +287,10 @@ class HsOfficeBankAccountControllerAcceptanceTest extends ContextBasedTestWithCl
|
||||
.statusCode(204); // @formatter:on
|
||||
|
||||
// then the given bankaccount is still there
|
||||
assertThat(bankAccountRepo.findByUuid(givenBankAccount.getUuid())).isEmpty();
|
||||
jpaAttempt.transacted(() -> {
|
||||
context("superuser-alex@hostsharing.net", null);
|
||||
assertThat(bankAccountRepo.findByUuid(givenBankAccount.getUuid())).isEmpty();
|
||||
}).assertSuccessful();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ class HsOfficeBankAccountRepositoryIntegrationTest extends ContextBasedTestWithC
|
||||
|
||||
private void assertThatBankAccountIsPersisted(final HsOfficeBankAccountEntity saved) {
|
||||
final var found = bankAccountRepo.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get().usingRecursiveComparison().isEqualTo(saved);
|
||||
assertThat(found).isNotEmpty().get().extracting(Object::toString).isEqualTo(saved.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-2
@@ -309,7 +309,10 @@ class HsOfficeContactControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
||||
.statusCode(204); // @formatter:on
|
||||
|
||||
// then the given contact is gone
|
||||
assertThat(contactRepo.findByUuid(givenContact.getUuid())).isEmpty();
|
||||
jpaAttempt.transacted(() -> {
|
||||
context("superuser-alex@hostsharing.net", null);
|
||||
assertThat(contactRepo.findByUuid(givenContact.getUuid())).isEmpty();
|
||||
}).assertSuccessful();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -326,7 +329,10 @@ class HsOfficeContactControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
||||
.statusCode(204); // @formatter:on
|
||||
|
||||
// then the given contact is still there
|
||||
assertThat(contactRepo.findByUuid(givenContact.getUuid())).isEmpty();
|
||||
jpaAttempt.transacted(() -> {
|
||||
context("superuser-alex@hostsharing.net", null);
|
||||
assertThat(contactRepo.findByUuid(givenContact.getUuid())).isEmpty();
|
||||
}).assertSuccessful();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ class HsOfficeContactRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
|
||||
private void assertThatContactIsPersisted(final HsOfficeContactEntity saved) {
|
||||
final var found = contactRepo.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get().usingRecursiveComparison().isEqualTo(saved);
|
||||
assertThat(found).isNotEmpty().get().extracting(Object::toString).isEqualTo(saved.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -62,7 +62,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase
|
||||
// given
|
||||
context("superuser-alex@hostsharing.net");
|
||||
final var count = coopAssetsTransactionRepo.count();
|
||||
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000101);
|
||||
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000101).load();
|
||||
|
||||
// when
|
||||
final var result = attempt(em, () -> {
|
||||
@@ -119,7 +119,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase
|
||||
|
||||
private void assertThatCoopAssetsTransactionIsPersisted(final HsOfficeCoopAssetsTransactionEntity saved) {
|
||||
final var found = coopAssetsTransactionRepo.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get().usingRecursiveComparison().isEqualTo(saved);
|
||||
assertThat(found).isNotEmpty().get().extracting(HsOfficeCoopAssetsTransactionEntity::toString).isEqualTo(saved.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ class HsOfficeCoopSharesTransactionRepositoryIntegrationTest extends ContextBase
|
||||
// given
|
||||
context("superuser-alex@hostsharing.net");
|
||||
final var count = coopSharesTransactionRepo.count();
|
||||
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000101);
|
||||
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000101).load();
|
||||
|
||||
// when
|
||||
final var result = attempt(em, () -> {
|
||||
@@ -118,7 +118,7 @@ class HsOfficeCoopSharesTransactionRepositoryIntegrationTest extends ContextBase
|
||||
|
||||
private void assertThatCoopSharesTransactionIsPersisted(final HsOfficeCoopSharesTransactionEntity saved) {
|
||||
final var found = coopSharesTransactionRepo.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get().usingRecursiveComparison().isEqualTo(saved);
|
||||
assertThat(found).isNotEmpty().get().extracting(HsOfficeCoopSharesTransactionEntity::toString).isEqualTo(saved.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
-14
@@ -609,22 +609,24 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
||||
"defaultPrefix": "for"
|
||||
}
|
||||
"""
|
||||
.replace("${debitorNumberSuffix}", givenDebitor.getDebitorNumberSuffix().toString()))
|
||||
.replace("${debitorNumberSuffix}", givenDebitor.getDebitorNumberSuffix()))
|
||||
);
|
||||
// @formatter:on
|
||||
|
||||
// finally, the debitor is actually updated
|
||||
context.define("superuser-alex@hostsharing.net");
|
||||
assertThat(debitorRepo.findByUuid(givenDebitor.getUuid())).isPresent().get()
|
||||
.matches(debitor -> {
|
||||
assertThat(debitor.getDebitorRel().getHolder().getTradeName())
|
||||
.isEqualTo(givenDebitor.getDebitorRel().getHolder().getTradeName());
|
||||
assertThat(debitor.getDebitorRel().getContact().getCaption()).isEqualTo("fourth contact");
|
||||
assertThat(debitor.getVatId()).isEqualTo("VAT222222");
|
||||
assertThat(debitor.getVatCountryCode()).isEqualTo("AA");
|
||||
assertThat(debitor.isVatBusiness()).isEqualTo(true);
|
||||
return true;
|
||||
});
|
||||
jpaAttempt.transacted(() -> {
|
||||
context.define("superuser-alex@hostsharing.net");
|
||||
assertThat(debitorRepo.findByUuid(givenDebitor.getUuid())).isPresent().get()
|
||||
.matches(debitor -> {
|
||||
assertThat(debitor.getDebitorRel().getHolder().getTradeName())
|
||||
.isEqualTo(givenDebitor.getDebitorRel().getHolder().getTradeName());
|
||||
assertThat(debitor.getDebitorRel().getContact().getCaption()).isEqualTo("fourth contact");
|
||||
assertThat(debitor.getVatId()).isEqualTo("VAT222222");
|
||||
assertThat(debitor.getVatCountryCode()).isEqualTo("AA");
|
||||
assertThat(debitor.isVatBusiness()).isEqualTo(true);
|
||||
return true;
|
||||
});
|
||||
}).assertSuccessful();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -718,7 +720,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
||||
private HsOfficeDebitorEntity givenSomeTemporaryDebitor() {
|
||||
return jpaAttempt.transacted(() -> {
|
||||
context.define("superuser-alex@hostsharing.net");
|
||||
final var givenPartner = partnerRepo.findPartnerByOptionalNameLike("Fourth").get(0);
|
||||
final var givenPartner = partnerRepo.findPartnerByOptionalNameLike("Fourth").get(0).load();
|
||||
final var givenContact = contactRepo.findContactByOptionalCaptionLike("fourth contact").get(0);
|
||||
final var newDebitor = HsOfficeDebitorEntity.builder()
|
||||
.debitorNumberSuffix(nextDebitorSuffix())
|
||||
@@ -735,7 +737,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
||||
.vatReverseCharge(false)
|
||||
.build();
|
||||
|
||||
return debitorRepo.save(newDebitor);
|
||||
return debitorRepo.save(newDebitor).load();
|
||||
}).assertSuccessful().returnedValue();
|
||||
}
|
||||
|
||||
|
||||
+20
-17
@@ -23,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -83,12 +82,14 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
// given
|
||||
context("superuser-alex@hostsharing.net");
|
||||
final var count = debitorRepo.count();
|
||||
final var givenPartner = partnerRepo.findPartnerByPartnerNumber(10001);
|
||||
final var givenPartnerPerson = one(personRepo.findPersonByOptionalNameLike("First GmbH"));
|
||||
final var givenContact = one(contactRepo.findContactByOptionalCaptionLike("first contact"));
|
||||
|
||||
// when
|
||||
final var result = attempt(em, () -> {
|
||||
final var newDebitor = HsOfficeDebitorEntity.builder()
|
||||
.partner(givenPartner)
|
||||
.debitorNumberSuffix("21")
|
||||
.debitorRel(HsOfficeRelationEntity.builder()
|
||||
.type(HsOfficeRelationType.DEBITOR)
|
||||
@@ -99,7 +100,8 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
.defaultPrefix("abc")
|
||||
.billable(false)
|
||||
.build();
|
||||
return toCleanup(debitorRepo.save(newDebitor));
|
||||
final HsOfficeDebitorEntity entity = debitorRepo.save(newDebitor);
|
||||
return toCleanup(entity.load());
|
||||
});
|
||||
|
||||
// then
|
||||
@@ -339,14 +341,13 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
givenDebitor.setVatId(givenNewVatId);
|
||||
givenDebitor.setVatCountryCode(givenNewVatCountryCode);
|
||||
givenDebitor.setVatBusiness(givenNewVatBusiness);
|
||||
return toCleanup(debitorRepo.save(givenDebitor));
|
||||
final HsOfficeDebitorEntity entity = debitorRepo.save(givenDebitor);
|
||||
return toCleanup(entity.load());
|
||||
});
|
||||
|
||||
// then
|
||||
result.assertSuccessful();
|
||||
assertThatDebitorIsVisibleForUserWithRole(
|
||||
result.returnedValue(),
|
||||
"global#global:ADMIN", true);
|
||||
assertThatDebitorIsVisibleForUserWithRole(result.returnedValue(), "global#global:ADMIN", true);
|
||||
|
||||
// ... partner role was reassigned:
|
||||
assertThatDebitorIsNotVisibleForUserWithRole(
|
||||
@@ -388,7 +389,7 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
final var result = jpaAttempt.transacted(() -> {
|
||||
context("superuser-alex@hostsharing.net");
|
||||
givenDebitor.setRefundBankAccount(givenNewBankAccount);
|
||||
return toCleanup(debitorRepo.save(givenDebitor));
|
||||
return toCleanup(debitorRepo.save(givenDebitor).load());
|
||||
});
|
||||
|
||||
// then
|
||||
@@ -417,7 +418,7 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
final var result = jpaAttempt.transacted(() -> {
|
||||
context("superuser-alex@hostsharing.net");
|
||||
givenDebitor.setRefundBankAccount(null);
|
||||
return toCleanup(debitorRepo.save(givenDebitor));
|
||||
return toCleanup(debitorRepo.save(givenDebitor).load());
|
||||
});
|
||||
|
||||
// then
|
||||
@@ -460,22 +461,21 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
context("superuser-alex@hostsharing.net");
|
||||
final var givenDebitor = givenSomeTemporaryDebitor("Fourth", "ninth", "Fourth", "nin");
|
||||
assertThatDebitorActuallyInDatabase(givenDebitor, true);
|
||||
assertThatDebitorIsVisibleForUserWithRole(
|
||||
givenDebitor,
|
||||
"hs_office_contact#ninthcontact:ADMIN", false);
|
||||
assertThatDebitorIsVisibleForUserWithRole(givenDebitor, "hs_office_contact#ninthcontact:ADMIN", false);
|
||||
|
||||
// when
|
||||
final var result = jpaAttempt.transacted(() -> {
|
||||
context("superuser-alex@hostsharing.net", "hs_office_contact#ninthcontact:ADMIN");
|
||||
givenDebitor.setVatId("NEW-VAT-ID");
|
||||
return toCleanup(debitorRepo.save(givenDebitor));
|
||||
final HsOfficeDebitorEntity entity = debitorRepo.save(givenDebitor);
|
||||
return toCleanup(entity.load());
|
||||
});
|
||||
|
||||
// then
|
||||
result.assertExceptionWithRootCauseMessage(
|
||||
JpaObjectRetrievalFailureException.class,
|
||||
// this technical error message gets translated to a [403] error at the controller level
|
||||
"Unable to find net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountEntity with id ");
|
||||
JpaSystemException.class,
|
||||
"ERROR: [403]",
|
||||
"is not allowed to update hs_office_debitor uuid");
|
||||
}
|
||||
|
||||
private void assertThatDebitorActuallyInDatabase(final HsOfficeDebitorEntity saved, final boolean withPartner) {
|
||||
@@ -608,11 +608,13 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
final String defaultPrefix) {
|
||||
return jpaAttempt.transacted(() -> {
|
||||
context("superuser-alex@hostsharing.net");
|
||||
final var givenPartnerPerson = one(personRepo.findPersonByOptionalNameLike(partnerName));
|
||||
final var givenPartner = one(partnerRepo.findPartnerByOptionalNameLike(partnerName));
|
||||
final var givenPartnerPerson = givenPartner.getPartnerRel().getHolder();
|
||||
final var givenContact = one(contactRepo.findContactByOptionalCaptionLike(contactCaption));
|
||||
final var givenBankAccount =
|
||||
bankAccountHolder != null ? one(bankAccountRepo.findByOptionalHolderLike(bankAccountHolder)) : null;
|
||||
final var newDebitor = HsOfficeDebitorEntity.builder()
|
||||
.partner(givenPartner)
|
||||
.debitorNumberSuffix("20")
|
||||
.debitorRel(HsOfficeRelationEntity.builder()
|
||||
.type(HsOfficeRelationType.DEBITOR)
|
||||
@@ -625,7 +627,8 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
.billable(true)
|
||||
.build();
|
||||
|
||||
return toCleanup(debitorRepo.save(newDebitor));
|
||||
final HsOfficeDebitorEntity entity = debitorRepo.save(newDebitor);
|
||||
return toCleanup(entity.load());
|
||||
}).assertSuccessful().returnedValue();
|
||||
}
|
||||
|
||||
|
||||
+6
-7
@@ -75,7 +75,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTestWithCl
|
||||
.validity(Range.closedInfinite(LocalDate.parse("2020-01-01")))
|
||||
.membershipFeeBillable(true)
|
||||
.build();
|
||||
return toCleanup(membershipRepo.save(newMembership));
|
||||
return toCleanup(membershipRepo.save(newMembership).load());
|
||||
});
|
||||
|
||||
// then
|
||||
@@ -143,7 +143,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTestWithCl
|
||||
|
||||
private void assertThatMembershipIsPersisted(final HsOfficeMembershipEntity saved) {
|
||||
final var found = membershipRepo.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get().usingRecursiveComparison().isEqualTo(saved);
|
||||
assertThat(found).isNotEmpty().get().extracting(Object::toString).isEqualTo(saved.toString()) ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTestWithCl
|
||||
public void globalAdmin_canUpdateValidityOfArbitraryMembership() {
|
||||
// given
|
||||
context("superuser-alex@hostsharing.net");
|
||||
final var givenMembership = givenSomeTemporaryMembership("First", "11");
|
||||
final var givenMembership = givenSomeTemporaryMembership("First", "11");
|
||||
assertThatMembershipExistsAndIsAccessibleToCurrentContext(givenMembership);
|
||||
final var newValidityEnd = LocalDate.now();
|
||||
|
||||
@@ -214,13 +214,12 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTestWithCl
|
||||
givenMembership.setValidity(Range.closedOpen(
|
||||
givenMembership.getValidity().lower(), newValidityEnd));
|
||||
givenMembership.setStatus(HsOfficeMembershipStatus.CANCELLED);
|
||||
return toCleanup(membershipRepo.save(givenMembership));
|
||||
final HsOfficeMembershipEntity entity = membershipRepo.save(givenMembership);
|
||||
return toCleanup(entity.load());
|
||||
});
|
||||
|
||||
// then
|
||||
result.assertSuccessful();
|
||||
|
||||
membershipRepo.deleteByUuid(givenMembership.getUuid());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -363,7 +362,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTestWithCl
|
||||
.membershipFeeBillable(true)
|
||||
.build();
|
||||
|
||||
return toCleanup(membershipRepo.save(newMembership));
|
||||
return toCleanup(membershipRepo.save(newMembership).load());
|
||||
}).assertSuccessful().returnedValue();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -548,7 +548,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
||||
.build())
|
||||
.build();
|
||||
|
||||
return partnerRepo.save(newPartner);
|
||||
return partnerRepo.save(newPartner).load();
|
||||
}).assertSuccessful().returnedValue();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -180,7 +180,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
|
||||
private void assertThatPartnerIsPersisted(final HsOfficePartnerEntity saved) {
|
||||
final var found = partnerRepo.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get().usingRecursiveComparison().isEqualTo(saved);
|
||||
assertThat(found).isNotEmpty().get().extracting(Object::toString).isEqualTo(saved.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,7 +473,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTestWithClean
|
||||
.anchor(givenMandantorPerson)
|
||||
.contact(givenContact)
|
||||
.build();
|
||||
relationRepo.save(partnerRel);
|
||||
relationRepo.save(partnerRel).load();
|
||||
return partnerRel;
|
||||
}
|
||||
|
||||
|
||||
+5
-2
@@ -298,7 +298,10 @@ class HsOfficePersonControllerAcceptanceTest extends ContextBasedTestWithCleanup
|
||||
.statusCode(204); // @formatter:on
|
||||
|
||||
// then the given person is still there
|
||||
assertThat(personRepo.findByUuid(givenPerson.getUuid())).isEmpty();
|
||||
jpaAttempt.transacted(() -> {
|
||||
context.define("superuser-alex@hostsharing.net");
|
||||
assertThat(personRepo.findByUuid(givenPerson.getUuid())).isEmpty();
|
||||
}).assertSuccessful();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -332,7 +335,7 @@ class HsOfficePersonControllerAcceptanceTest extends ContextBasedTestWithCleanup
|
||||
.givenName("Temp Given Name " + RandomStringUtils.randomAlphabetic(10))
|
||||
.build();
|
||||
|
||||
return personRepo.save(newPerson);
|
||||
return personRepo.save(newPerson).load();
|
||||
}).assertSuccessful().returnedValue();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ class HsOfficePersonRepositoryIntegrationTest extends ContextBasedTestWithCleanu
|
||||
|
||||
private void assertThatPersonIsPersisted(final HsOfficePersonEntity saved) {
|
||||
final var found = personRepo.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get().usingRecursiveComparison().isEqualTo(saved);
|
||||
assertThat(found).isNotEmpty().get().extracting(Object::toString).isEqualTo(saved.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -158,7 +158,7 @@ class HsOfficeRelationRepositoryIntegrationTest extends ContextBasedTestWithClea
|
||||
|
||||
private void assertThatRelationIsPersisted(final HsOfficeRelationEntity saved) {
|
||||
final var found = relationRepo.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get().usingRecursiveComparison().isEqualTo(saved);
|
||||
assertThat(found).isNotEmpty().get().extracting(Object::toString).isEqualTo(saved.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ class HsOfficeRelationRepositoryIntegrationTest extends ContextBasedTestWithClea
|
||||
final var result = jpaAttempt.transacted(() -> {
|
||||
context("superuser-alex@hostsharing.net");
|
||||
givenRelation.setContact(givenContact);
|
||||
return toCleanup(relationRepo.save(givenRelation));
|
||||
return toCleanup(relationRepo.save(givenRelation).load());
|
||||
});
|
||||
|
||||
// then
|
||||
@@ -295,7 +295,8 @@ class HsOfficeRelationRepositoryIntegrationTest extends ContextBasedTestWithClea
|
||||
final var found = relationRepo.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get()
|
||||
.isNotSameAs(saved)
|
||||
.usingRecursiveComparison().ignoringFields("version").isEqualTo(saved);
|
||||
.extracting(HsOfficeRelationEntity::toString)
|
||||
.isEqualTo(saved.toString());
|
||||
}
|
||||
|
||||
private void assertThatRelationIsVisibleForUserWithRole(
|
||||
|
||||
+2
-2
@@ -152,7 +152,7 @@ class HsOfficeSepaMandateRepositoryIntegrationTest extends ContextBasedTestWithC
|
||||
|
||||
private void assertThatSepaMandateIsPersisted(final HsOfficeSepaMandateEntity saved) {
|
||||
final var found = sepaMandateRepo.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get().usingRecursiveComparison().isEqualTo(saved);
|
||||
assertThat(found).isNotEmpty().get().extracting(Object::toString).isEqualTo(saved.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ class HsOfficeSepaMandateRepositoryIntegrationTest extends ContextBasedTestWithC
|
||||
jpaAttempt.transacted(() -> {
|
||||
context("superuser-alex@hostsharing.net");
|
||||
assertThat(sepaMandateRepo.findByUuid(givenSepaMandate.getUuid())).isNotEmpty().get()
|
||||
.usingRecursiveComparison().isEqualTo(givenSepaMandate);
|
||||
.extracting(Object::toString).isEqualTo(givenSepaMandate.toString());
|
||||
}).assertSuccessful();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ class TestCustomerRepositoryIntegrationTest extends ContextBasedTest {
|
||||
|
||||
private void assertThatCustomerIsPersisted(final TestCustomerEntity saved) {
|
||||
final var found = testCustomerRepository.findByUuid(saved.getUuid());
|
||||
assertThat(found).isNotEmpty().get().usingRecursiveComparison().isEqualTo(saved);
|
||||
assertThat(found).isNotEmpty().get().extracting(Object::toString).isEqualTo(saved.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ spring:
|
||||
|
||||
liquibase:
|
||||
change-log: classpath:/db/changelog/db.changelog-master.yaml
|
||||
contexts: tc,test,dev
|
||||
contexts: tc,test,dev,pg_stat_statements
|
||||
|
||||
logging:
|
||||
level:
|
||||
|
||||
Reference in New Issue
Block a user