Reputation: 25778
Just add some Junit4 test cases,
import static org.junit.Assert.*;
but it prompts some errors until I changed to
@org.junit.Test
from @Test
What should I do if I would like to just use @Test
?
Upvotes: 0
Views: 44
Reputation: 147
If there is @Test
annotations defined in the code from testng i.e. org.testng.annotations.Test
package then the for defining @Test annotation of junit you will have to write @org.junit.Test
unless you delete the import statement of the testng package org.testng.annotations.Test
Upvotes: 0
Reputation: 5291
@Test
is an annotation class, and you need to import it as such. Including the package, it's name is org.junit.Test
Thus, you need to add this to your imports:
import org.junit.Test;
Upvotes: 0
Reputation: 23352
Test
is not part of org.junit.Assert
. It is rather part of org.junit
.
So it should suffice to do:
import org.junit.Test;
Upvotes: 0