Use assumingThat to run assertions conditionally in JUnit
Preconditions (2)
Step 1: Create a test method
Step 2: Define a boolean condition (e.g., isWindows = true if OS is Windows)
Step 3: Use assumingThat with the condition and a lambda containing assertions
Step 4: Run the test
Step 5: Verify that assertions inside assumingThat run only if the condition is true
Step 6: Verify that if the condition is false, the assertions inside assumingThat are skipped but the test does not fail
✅ Expected Result: Assertions inside assumingThat run only when the condition is true. If the condition is false, those assertions are skipped without failing the test.