Verify test execution control using assumptions in JUnit
Preconditions (2)
Step 1: Write a test method that uses an assumption to check if a system property 'env' equals 'dev'
Step 2: If the assumption is true, proceed to assert that 2 + 2 equals 4
Step 3: If the assumption is false, the test should be skipped and not fail
Step 4: Run the test with system property 'env' set to 'dev' and verify the test passes
Step 5: Run the test with system property 'env' set to 'prod' and verify the test is skipped
✅ Expected Result: The test runs and passes when the assumption is true. The test is skipped (not failed) when the assumption is false.