* PDF to X * PDF to X * Remove created doc * Code fixes and cleanup for PDF module * Fix web.xml in spring-mvc-web-vs-initializer project * Rollback web.xml * Fixes to PDF article * Merge with main eugen branch * Junit 5 * Fix name of test and modifier
33 lines
766 B
Java
33 lines
766 B
Java
package com.baeldung;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
import static org.junit.jupiter.api.Assumptions.assumeFalse;
|
|
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
|
import static org.junit.jupiter.api.Assumptions.assumingThat;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
public class AssumptionTest {
|
|
|
|
@Test
|
|
void trueAssumption() {
|
|
assumeTrue(5 > 1);
|
|
assertEquals(5 + 2, 7);
|
|
}
|
|
|
|
@Test
|
|
void falseAssumption() {
|
|
assumeFalse(5 < 1);
|
|
assertEquals(5 + 2, 7);
|
|
}
|
|
|
|
@Test
|
|
void assumptionThat() {
|
|
String someString = "Just a string";
|
|
assumingThat(
|
|
someString.equals("Just a string"),
|
|
() -> assertEquals(2 + 2, 4)
|
|
);
|
|
}
|
|
}
|