From 0257c83fa532a3bfffa758d7bcbfc62cd2f17486 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Sun, 28 Apr 2019 11:13:55 +0200 Subject: [PATCH] fine-tuning pitest config and increasing threshold --- .../JSonDeserializationWithAccessFilterUnitTest.java | 3 ++- .../hsadminng/service/accessfilter/MockSecurityContext.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/hostsharing/hsadminng/service/accessfilter/JSonDeserializationWithAccessFilterUnitTest.java b/src/test/java/org/hostsharing/hsadminng/service/accessfilter/JSonDeserializationWithAccessFilterUnitTest.java index 604aba3c..501e4d2a 100644 --- a/src/test/java/org/hostsharing/hsadminng/service/accessfilter/JSonDeserializationWithAccessFilterUnitTest.java +++ b/src/test/java/org/hostsharing/hsadminng/service/accessfilter/JSonDeserializationWithAccessFilterUnitTest.java @@ -25,6 +25,7 @@ import java.util.Optional; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; +import static org.assertj.core.api.Assumptions.assumeThat; import static org.hostsharing.hsadminng.service.accessfilter.JSonAccessFilterTestFixture.*; import static org.hostsharing.hsadminng.service.accessfilter.JSonBuilder.asJSon; import static org.hostsharing.hsadminng.service.accessfilter.MockSecurityContext.givenAuthenticatedUser; @@ -142,7 +143,7 @@ public class JSonDeserializationWithAccessFilterUnitTest { @Test public void shouldDeserializeRestrictedBigDecimalFieldIfUnchangedByCompareTo() throws IOException { // given - assertThat(SOME_BIG_DECIMAL_WITH_ANOTHER_SCALE).as("precondition failed").isNotEqualTo(SOME_BIG_DECIMAL); + assumeThat(SOME_BIG_DECIMAL_WITH_ANOTHER_SCALE).isNotEqualTo(SOME_BIG_DECIMAL); givenJSonTree(asJSon( ImmutablePair.of("id", 1234L), ImmutablePair.of("customerId", 888L), diff --git a/src/test/java/org/hostsharing/hsadminng/service/accessfilter/MockSecurityContext.java b/src/test/java/org/hostsharing/hsadminng/service/accessfilter/MockSecurityContext.java index b5f8ce25..da028ca4 100644 --- a/src/test/java/org/hostsharing/hsadminng/service/accessfilter/MockSecurityContext.java +++ b/src/test/java/org/hostsharing/hsadminng/service/accessfilter/MockSecurityContext.java @@ -5,7 +5,7 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assumptions.assumeThat; public class MockSecurityContext { @@ -15,7 +15,7 @@ public class MockSecurityContext { SecurityContextHolder.setContext(securityContext); SecurityUtils.clearUserRoles(); - assertThat(SecurityUtils.getCurrentUserLogin()).describedAs("precondition failed").hasValue("dummyUser"); + assumeThat(SecurityUtils.getCurrentUserLogin()).hasValue("dummyUser"); } public static void givenUserHavingRole(final Class onClass, final Long onId, final Role role) {