-
AssertJ's assumptions don't work with This doesn't work: package com.example;
import org.junit.jupiter.api.Test;
import java.util.Optional;
import static org.assertj.core.api.Assumptions.assumeThat;
import static org.assertj.core.api.InstanceOfAssertFactories.OPTIONAL;
public class AssumptionTest {
@Test
void testAssumptions() {
assumeThat(Optional.of("something"))
.asInstanceOf(OPTIONAL)
.isPresent();
}
}
but this does: package com.example;
import org.junit.jupiter.api.Test;
import java.util.Optional;
import static org.assertj.core.api.Assumptions.assumeThat;
public class AssumptionTest {
@Test
void testAssumptions() {
assumeThat(Optional.of("something").isPresent())
.isTrue();
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
scordio
Nov 30, 2023
Replies: 1 comment 2 replies
-
What version are you using? I couldn't reproduce the issue with 3.24.2. Also, the intermediate |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please upgrade to the latest available considering that 3.21.0 is already two years old 🙂