From ecff38abf64bf603db9564f0640e705d847cd2d7 Mon Sep 17 00:00:00 2001 From: Daniel Garrett Date: Tue, 7 Jul 2020 16:14:30 +0100 Subject: [PATCH] feat: add test for assumeFalse --- .../assume/ConditionallyIgnoreTestsUnitTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/testing-modules/junit-4/src/test/java/com/baeldung/assume/ConditionallyIgnoreTestsUnitTest.java b/testing-modules/junit-4/src/test/java/com/baeldung/assume/ConditionallyIgnoreTestsUnitTest.java index 0a95ed4522..b5cc82d79d 100644 --- a/testing-modules/junit-4/src/test/java/com/baeldung/assume/ConditionallyIgnoreTestsUnitTest.java +++ b/testing-modules/junit-4/src/test/java/com/baeldung/assume/ConditionallyIgnoreTestsUnitTest.java @@ -2,8 +2,7 @@ package com.baeldung.assume; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; -import static org.junit.Assume.assumeThat; -import static org.junit.Assume.assumeTrue; +import static org.junit.Assume.*; import org.junit.Test; @@ -26,6 +25,14 @@ public class ConditionallyIgnoreTestsUnitTest { assertEquals("hello", "HELLO".toLowerCase()); } + @Test + public void whenAssumeFalseOnCondition_thenIgnore() { + final int codeVersion = 2; + assumeFalse(isCodeVersion2(codeVersion)); + + assertEquals("hello", "HELLO".toLowerCase()); + } + private boolean isCodeVersion2(final int codeVersion) { return codeVersion == 2; }