Junit static import assertTrue failing but Assert.assertTrue passing?

743 Views Asked by At

I have a unit test method as below:

 @Test
 public void someTest() throws Exception {
        /* Some code here*/

        List <SomeClass> someClassList = someRepository.findBySomething(param);
        assertTrue("List should not be empty", !someClassList.isEmpty());
//      Assert.assertTrue("List should not be empty", !someClassList.isEmpty());
 }

The above test fails. But if I comment the static import assertion assertTrue and un-comment the normal assertion Assert.assertTrue, it passes.

I have only added relevant piece of code. Please let me know if more information is needed.

What might be the reason for above behavior?

EDIT

Below are the imports I have:

 import org.junit.Assert;

 import static org.junit.Assert.assertTrue;
0

There are 0 best solutions below