I am using Junit5, and my IDE (IntelijIdea) is not recognize Assumptions. I am actually do not know why, but may be there is some dependecy on Maven I do not connect into project. Below I will show you the sample of my code.
This is my Assumptions import.
import org.junit.jupiter.api.Assumptions;
And this is wrong code (I can not compile it, compiler does not know what is assumeTrue() )
@Test
@EnabledOnOs(OS.MAC)
void testInsertion() {
assumeTrue(isServerUp); //That place is crashing
assertThrows(NullPointerException.class, () -> Connection.insertTheInstance(person),
"");
If you are familiar with this case then, please, share you knowledge) Many thanks!
It's a import problem probably. Try:
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.2</version>
<scope>test</scope>
</dependency>
If it's not ok yet, try the junit 4.12. Its have Assumptions too.