Files
spring-boot-rest/testing-modules/junit5-migration/src/test/java/com/baeldung/junit4/AssumeUnitTest.java
Carlo Corti b7355cbab0 BAEL-1843 - JUnit4 -> JUnit5 migration guide (#4816)
* Added code for the migration from JUnit 4 to JUnit 5

* Add example for Rule migration support

* Add fix to access modifiers to test methods

* Remove wrong header

* Add junit5-migration module and its code snippets

* Add module configuration to pom

* Remove test classes that were added for the migration from JUnit 4 to JUnit 5 article (moved under correct module)
2018-08-06 23:38:54 +02:00

24 lines
486 B
Java

package com.baeldung.junit4;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
public class AssumeUnitTest {
@Test
public void trueAssumption() {
assumeTrue("5 is greater the 1", 5 > 1);
assertEquals(5 + 2, 7);
}
@Test
public void falseAssumption() {
assumeFalse("5 is less then 1", 5 < 1);
assertEquals(5 + 2, 7);
}
}