From 73f147c5572459fc649f868f71d91d4831aee8cd Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 4 Jan 2024 08:43:52 +0100 Subject: [PATCH] fix most unit tests and improve usage of assumeThat --- ...HsOfficeBankAccountControllerRestTest.java | 2 +- ...fficeContactRepositoryIntegrationTest.java | 5 ----- ...OfficeDebitorControllerAcceptanceTest.java | 5 ++--- ...ceMembershipRepositoryIntegrationTest.java | 3 +-- ...OfficePartnerControllerAcceptanceTest.java | 5 ++--- ...fficePartnerRepositoryIntegrationTest.java | 7 +------ ...OfficePersonRepositoryIntegrationTest.java | 5 ----- ...eRelationshipControllerAcceptanceTest.java | 1 - ...eSepaMandateRepositoryIntegrationTest.java | 3 +-- .../RbacGrantControllerAcceptanceTest.java | 5 ++--- .../RbacGrantRepositoryIntegrationTest.java | 20 ++++++++----------- .../RbacUserRepositoryIntegrationTest.java | 8 -------- .../TestPackageControllerAcceptanceTest.java | 11 ++++++---- .../java/net/hostsharing/test/JpaAttempt.java | 3 +-- 14 files changed, 26 insertions(+), 57 deletions(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountControllerRestTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountControllerRestTest.java index a54ca5c6..d870ca1a 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountControllerRestTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/HsOfficeBankAccountControllerRestTest.java @@ -83,7 +83,7 @@ class HsOfficeBankAccountControllerRestTest { enum InvalidBicTestCase { TOO_SHORT("BEVODEB", "Bic length must be 8 or 11"), TOO_LONG("BEVODEBBX", "Bic length must be 8 or 11"), - INVALID_CHARACTER("BEV-ODEB", "Bank code must contain only letters."); + INVALID_CHARACTER("BEV-ODEB", "Bank code must contain only alphanumeric."); private final String givenBic; private final String expectedErrorMessage; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactRepositoryIntegrationTest.java index a58aa824..0308c31d 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactRepositoryIntegrationTest.java @@ -28,7 +28,6 @@ import static net.hostsharing.hsadminng.rbac.rbacgrant.RawRbacGrantEntity.grantD import static net.hostsharing.hsadminng.rbac.rbacrole.RawRbacRoleEntity.roleNamesOf; import static net.hostsharing.test.JpaAttempt.attempt; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; @DataJpaTest @Import( { Context.class, JpaAttempt.class }) @@ -237,10 +236,6 @@ class HsOfficeContactRepositoryIntegrationTest extends ContextBasedTest { final var initialRoleNames = roleNamesOf(rawRoleRepo.findAll()); final var initialGrantNames = grantDisplaysOf(rawGrantRepo.findAll()); final var givenContact = givenSomeTemporaryContact("selfregistered-user-drew@hostsharing.org"); - assumeThat(rawRoleRepo.findAll().size()).as("unexpected number of roles created") - .isEqualTo(initialRoleNames.size() + 3); - assumeThat(rawGrantRepo.findAll().size()).as("unexpected number of grants created") - .isEqualTo(initialGrantNames.size() + 7); // when final var result = jpaAttempt.transacted(() -> { 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 22001cb2..76d6758f 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 @@ -26,7 +26,6 @@ import java.util.UUID; import static net.hostsharing.test.IsValidUuidMatcher.isUuidValid; import static net.hostsharing.test.JsonMatcher.lenientlyEquals; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; import static org.hamcrest.Matchers.*; @SpringBootTest( @@ -481,7 +480,7 @@ class HsOfficeDebitorControllerAcceptanceTest { void contactAdminUser_canNotDeleteRelatedDebitor() { context.define("superuser-alex@hostsharing.net"); final var givenDebitor = givenSomeTemporaryDebitor(); - assumeThat(givenDebitor.getBillingContact().getLabel()).isEqualTo("forth contact"); + assertThat(givenDebitor.getBillingContact().getLabel()).isEqualTo("forth contact"); RestAssured // @formatter:off .given() @@ -501,7 +500,7 @@ class HsOfficeDebitorControllerAcceptanceTest { void normalUser_canNotDeleteUnrelatedDebitor() { context.define("superuser-alex@hostsharing.net"); final var givenDebitor = givenSomeTemporaryDebitor(); - assumeThat(givenDebitor.getBillingContact().getLabel()).isEqualTo("forth contact"); + assertThat(givenDebitor.getBillingContact().getLabel()).isEqualTo("forth contact"); RestAssured // @formatter:off .given() diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepositoryIntegrationTest.java index 42f61495..c85a9b13 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepositoryIntegrationTest.java @@ -32,7 +32,6 @@ import static net.hostsharing.hsadminng.rbac.rbacgrant.RawRbacGrantEntity.grantD import static net.hostsharing.hsadminng.rbac.rbacrole.RawRbacRoleEntity.roleNamesOf; import static net.hostsharing.test.JpaAttempt.attempt; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; @DataJpaTest @Import( { Context.class, JpaAttempt.class }) @@ -327,7 +326,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest { // when final var result = jpaAttempt.transacted(() -> { context("superuser-alex@hostsharing.net", "hs_office_debitor#10003ThirdOHG-thirdcontact.admin"); - assumeThat(membershipRepo.findByUuid(givenMembership.getUuid())).isPresent(); + assertThat(membershipRepo.findByUuid(givenMembership.getUuid())).isPresent(); membershipRepo.deleteByUuid(givenMembership.getUuid()); }); 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 899b151d..053b03e1 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 @@ -24,7 +24,6 @@ import java.util.UUID; import static net.hostsharing.test.IsValidUuidMatcher.isUuidValid; import static net.hostsharing.test.JsonMatcher.lenientlyEquals; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.startsWith; @@ -408,7 +407,7 @@ class HsOfficePartnerControllerAcceptanceTest { void contactAdminUser_canNotDeleteRelatedPartner() { context.define("superuser-alex@hostsharing.net"); final var givenPartner = givenSomeTemporaryPartnerBessler(); - assumeThat(givenPartner.getContact().getLabel()).isEqualTo("forth contact"); + assertThat(givenPartner.getContact().getLabel()).isEqualTo("forth contact"); RestAssured // @formatter:off .given() @@ -428,7 +427,7 @@ class HsOfficePartnerControllerAcceptanceTest { void normalUser_canNotDeleteUnrelatedPartner() { context.define("superuser-alex@hostsharing.net"); final var givenPartner = givenSomeTemporaryPartnerBessler(); - assumeThat(givenPartner.getContact().getLabel()).isEqualTo("forth contact"); + assertThat(givenPartner.getContact().getLabel()).isEqualTo("forth contact"); RestAssured // @formatter:off .given() 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 6b035f5b..e03d8cbe 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 @@ -29,7 +29,6 @@ import static net.hostsharing.hsadminng.rbac.rbacgrant.RawRbacGrantEntity.grantD import static net.hostsharing.hsadminng.rbac.rbacrole.RawRbacRoleEntity.roleNamesOf; import static net.hostsharing.test.JpaAttempt.attempt; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; @DataJpaTest @Import( { Context.class, JpaAttempt.class }) @@ -330,7 +329,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTest { // when final var result = jpaAttempt.transacted(() -> { context("person-ErbenBesslerMelBessler@example.com"); - assumeThat(partnerRepo.findByUuid(givenPartner.getUuid())).isPresent(); + assertThat(partnerRepo.findByUuid(givenPartner.getUuid())).isPresent(); partnerRepo.deleteByUuid(givenPartner.getUuid()); }); @@ -352,10 +351,6 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTest { final var initialRoleNames = Array.from(roleNamesOf(rawRoleRepo.findAll())); final var initialGrantNames = Array.from(grantDisplaysOf(rawGrantRepo.findAll())); final var givenPartner = givenSomeTemporaryPartnerBessler("twelfth"); - assumeThat(rawRoleRepo.findAll().size()).as("unexpected number of roles created") - .isEqualTo(initialRoleNames.length + 3); - assumeThat(rawGrantRepo.findAll().size()).as("unexpected number of grants created") - .isEqualTo(initialGrantNames.length + 10); // when final var result = jpaAttempt.transacted(() -> { 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 6c75434e..2405b237 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 @@ -27,7 +27,6 @@ import static net.hostsharing.hsadminng.rbac.rbacgrant.RawRbacGrantEntity.grantD import static net.hostsharing.hsadminng.rbac.rbacrole.RawRbacRoleEntity.roleNamesOf; import static net.hostsharing.test.JpaAttempt.attempt; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; @DataJpaTest @Import( { Context.class, JpaAttempt.class }) @@ -244,10 +243,6 @@ class HsOfficePersonRepositoryIntegrationTest extends ContextBasedTest { final var initialRoleNames = roleNamesOf(rawRoleRepo.findAll()); final var initialGrantNames = grantDisplaysOf(rawGrantRepo.findAll()); final var givenPerson = givenSomeTemporaryPerson("selfregistered-user-drew@hostsharing.org"); - assumeThat(rawRoleRepo.findAll().size()).as("unexpected number of roles created") - .isEqualTo(initialRoleNames.size() + 3); - assumeThat(rawGrantRepo.findAll().size()).as("unexpected number of grants created") - .isEqualTo(initialGrantNames.size() + 7); // when final var result = jpaAttempt.transacted(() -> { 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 6288bb4c..f090295b 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 @@ -25,7 +25,6 @@ import java.util.UUID; import static net.hostsharing.test.IsValidUuidMatcher.isUuidValid; import static net.hostsharing.test.JsonMatcher.lenientlyEquals; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.startsWith; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateRepositoryIntegrationTest.java index cbc8bfbc..8e5f5c79 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateRepositoryIntegrationTest.java @@ -31,7 +31,6 @@ import static net.hostsharing.hsadminng.rbac.rbacgrant.RawRbacGrantEntity.grantD import static net.hostsharing.hsadminng.rbac.rbacrole.RawRbacRoleEntity.roleNamesOf; import static net.hostsharing.test.JpaAttempt.attempt; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; @DataJpaTest @Import({ Context.class, JpaAttempt.class }) @@ -346,7 +345,7 @@ class HsOfficeSepaMandateRepositoryIntegrationTest extends ContextBasedTest { // when final var result = jpaAttempt.transacted(() -> { context("bankaccount-admin@ThirdOHG.example.com"); - assumeThat(sepaMandateRepo.findByUuid(givenSepaMandate.getUuid())).isPresent(); + assertThat(sepaMandateRepo.findByUuid(givenSepaMandate.getUuid())).isPresent(); sepaMandateRepo.deleteByUuid(givenSepaMandate.getUuid()); }); diff --git a/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantControllerAcceptanceTest.java index 0402dbfe..6f0abc93 100644 --- a/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantControllerAcceptanceTest.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.*; @@ -343,7 +342,7 @@ class RbacGrantControllerAcceptanceTest extends ContextBasedTest { } private void assumeCreated(final ValidatableResponse response) { - assumeThat(response.extract().response().statusCode()).isEqualTo(201); + assertThat(response.extract().response().statusCode()).isEqualTo(201); } class Subject { @@ -479,7 +478,7 @@ class RbacGrantControllerAcceptanceTest extends ContextBasedTest { } private void assumeGrantExists(final Subject grantingSubject, final String expectedGrant) { - assumeThat(findAllGrantsOf(grantingSubject)) + assertThat(findAllGrantsOf(grantingSubject)) .extracting(RbacGrantEntity::toDisplay) .contains(expectedGrant); } diff --git a/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantRepositoryIntegrationTest.java index 3ff9eda0..8c439a31 100644 --- a/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/rbac/rbacgrant/RbacGrantRepositoryIntegrationTest.java @@ -25,7 +25,6 @@ import java.util.UUID; import static net.hostsharing.test.JpaAttempt.attempt; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; @DataJpaTest @Import( { Context.class, JpaAttempt.class }) @@ -186,9 +185,8 @@ class RbacGrantRepositoryIntegrationTest extends ContextBasedTest { // when context("customer-admin@xxx.example.com", "test_customer#xxx.admin"); - final var revokeAttempt = attempt(em, () -> { - rbacGrantRepository.deleteByRbacGrantId(grant.getRbacGrantId()); - }); + final var revokeAttempt = attempt(em, () -> + rbacGrantRepository.deleteByRbacGrantId(grant.getRbacGrantId())); // then context("customer-admin@xxx.example.com", "test_customer#xxx.admin"); @@ -208,9 +206,8 @@ class RbacGrantRepositoryIntegrationTest extends ContextBasedTest { // when context("pac-admin-xxx00@xxx.example.com", "test_package#xxx00.admin"); - final var revokeAttempt = attempt(em, () -> { - rbacGrantRepository.deleteByRbacGrantId(grant.getRbacGrantId()); - }); + final var revokeAttempt = attempt(em, () -> + rbacGrantRepository.deleteByRbacGrantId(grant.getRbacGrantId())); // then assertThat(revokeAttempt.caughtExceptionsRootCause()).isNull(); @@ -230,9 +227,8 @@ class RbacGrantRepositoryIntegrationTest extends ContextBasedTest { // when context("pac-admin-xxx00@xxx.example.com", "test_package#xxx00.admin"); - final var revokeAttempt = attempt(em, () -> { - rbacGrantRepository.deleteByRbacGrantId(grant.getRbacGrantId()); - }); + final var revokeAttempt = attempt(em, () -> + rbacGrantRepository.deleteByRbacGrantId(grant.getRbacGrantId())); // then revokeAttempt.assertExceptionWithRootCauseMessage( @@ -255,8 +251,8 @@ class RbacGrantRepositoryIntegrationTest extends ContextBasedTest { rbacGrantRepository.save(grant) ); - assumeThat(grantAttempt.caughtException()).isNull(); - assumeThat(rawRbacGrantRepository.findAll()) + assertThat(grantAttempt.caughtException()).isNull(); + assertThat(rawRbacGrantRepository.findAll()) .extracting(RawRbacGrantEntity::toDisplay) .contains("{ grant role %s to user %s by role %s and assume }".formatted( with.grantedRole, with.granteeUserName, with.assumedRole diff --git a/src/test/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserRepositoryIntegrationTest.java index bd2257ef..ea0a3109 100644 --- a/src/test/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserRepositoryIntegrationTest.java @@ -61,11 +61,6 @@ class RbacUserRepositoryIntegrationTest extends ContextBasedTest { assertThat(result.returnedValue()).isNotNull() .extracting(RbacUserEntity::getUuid).isEqualTo(givenUuid); assertThat(rbacUserRepository.findByName(result.returnedValue().getName())).isNotNull(); - // jpaAttempt.transacted(() -> { - // context(givenUser.getName()); - // assertThat(em.find(RbacUserEntity.class, givenUser.getUuid())) - // .isNotNull().extracting(RbacUserEntity::getName).isEqualTo(givenUser.getName()); - // }).assertSuccessful(); } } @@ -87,9 +82,6 @@ class RbacUserRepositoryIntegrationTest extends ContextBasedTest { // then the user is deleted result.assertSuccessful(); assertThat(rbacUserRepository.findByName(givenUser.getName())).isNull(); - // jpaAttempt.transacted(() -> { - // assertThat(rbacUserRepository.findByName(givenUser.getName())).isNull(); - // }).assertSuccessful(); } } diff --git a/src/test/java/net/hostsharing/hsadminng/test/pac/TestPackageControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/test/pac/TestPackageControllerAcceptanceTest.java index e8cfc5bb..fd51ebf8 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/pac/TestPackageControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/test/pac/TestPackageControllerAcceptanceTest.java @@ -16,7 +16,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.UUID; import static java.lang.String.format; -import static org.assertj.core.api.Assumptions.assumeThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; @@ -85,7 +85,8 @@ class TestPackageControllerAcceptanceTest { @Test void withDescriptionUpdatesDescription() { - assumeThat(getDescriptionOfPackage("xxx00")) + assertThat(getDescriptionOfPackage("xxx00")) + .as("precondition failed") .isEqualTo("Here you can add your own description of package xxx00."); final var randomDescription = RandomStringUtils.randomAlphanumeric(80); @@ -117,7 +118,8 @@ class TestPackageControllerAcceptanceTest { @Test void withNullDescriptionUpdatesDescriptionToNull() { - assumeThat(getDescriptionOfPackage("xxx01")) + assertThat(getDescriptionOfPackage("xxx01")) + .as("precondition failed") .isEqualTo("Here you can add your own description of package xxx01."); // @formatter:off @@ -146,7 +148,8 @@ class TestPackageControllerAcceptanceTest { @Test void withoutDescriptionDoesNothing() { - assumeThat(getDescriptionOfPackage("xxx02")) + assertThat(getDescriptionOfPackage("xxx02")) + .as("precondition failed") .isEqualTo("Here you can add your own description of package xxx02."); // @formatter:off diff --git a/src/test/java/net/hostsharing/test/JpaAttempt.java b/src/test/java/net/hostsharing/test/JpaAttempt.java index a7244e37..589049bb 100644 --- a/src/test/java/net/hostsharing/test/JpaAttempt.java +++ b/src/test/java/net/hostsharing/test/JpaAttempt.java @@ -12,7 +12,6 @@ import java.util.Optional; import java.util.function.Supplier; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; /** * Wraps the 'when' part of a DataJpaTest to improve readability of tests. @@ -138,7 +137,7 @@ public class JpaAttempt { } public JpaResult assumeSuccessful() { - assumeThat(exception).as(firstRootCauseMessageLineOf(exception)).isNull(); + assertThat(exception).as(firstRootCauseMessageLineOf(exception)).isNull(); return this; }