Home > database >  Why do I get this exception in JUnit4?
Why do I get this exception in JUnit4?

Time:09-17

I'm new to JUnit testing and Gradle, I tried to make my first simple tests and they don't work.

This is my test code:

import org.junit.Test;
import static org.junit.Assert.*;

public class BoxTest {
    @Test
    public void testBox(){
        Box box1 = new Box(20);
        Box box2 = new Box(10);
        assertEquals(30, (int)box1.getObject() (int)box2.getObject());
    }
}

And this is an exception: exception screenshot

I tried to google, but nothing helped me.

CodePudding user response:

Try to change your import org.junit.Test; to import org.junit.jupiter.api.Test.

  • Related