Reputation: 3128
I have some problem with In intellij
. I try to import the following library:
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
But I get the following error:
cannot resolve symbol 'assertDoesNotThrow'
But I don't get errors for assertEquals
.
The use:
assertDoesNotThrow(() -> r1.rate(new Pro(1, "xyz"), 0));
assertDoesNotThrow(() -> r1.rate(new Pro(1, "xyz"), 5));
I guess this is some problem with JUInt
, but I can't seem to find the solution. I have tried some previous threads but without success.
Upvotes: 5
Views: 16966
Reputation: 402265
When you add JUnit library in IntelliJ IDEA via the intention action, there is a choice which library version to add:
If you add 5.3 version, you will see the following in the Module Dependencies:
In case you have some older version there, delete these libraries and add the correct version again.
Refer to the Configuring Testing Libraries help section.
Upvotes: 1