Complete the code to skip the test if the condition is false using assumeTrue.
import static org.junit.jupiter.api.Assumptions.assumeTrue; @Test void testOnlyOnWindows() { assumeTrue(System.getProperty("os.name").startsWith([1])); // test code here }
Complete the code to skip the test if the condition is true using assumeFalse.
import static org.junit.jupiter.api.Assumptions.assumeFalse; @Test void testSkipOnCI() { assumeFalse("CI".equals(System.getenv([1]))); // test code here }
Fix the error in the assumption to skip the test if the user is not admin.
import static org.junit.jupiter.api.Assumptions.assumeTrue; @Test void testAdminOnly() { assumeTrue(System.getProperty("user.role").equals([1])); // test code here }
Fill both blanks to skip the test if the Java version is less than 11.
import static org.junit.jupiter.api.Assumptions.assumeTrue; @Test void testJava11OrHigher() { String version = System.getProperty("java.version"); assumeTrue(Integer.parseInt(version.split("\\.")[[1]]) [2] 11); // test code here }
Fill all three blanks to skip the test if the environment is not "dev" or the user is not "tester".
import static org.junit.jupiter.api.Assumptions.assumeTrue; @Test void testDevTesterOnly() { String env = System.getenv([1]); String user = System.getProperty([2]); assumeTrue(env.equals([3]) && user.equals("tester")); // test code here }
