Cannot find symbol assertEquals

后端 未结 6 1613
庸人自扰
庸人自扰 2021-02-02 07:37

I\'m trying to write my first unit tests for a calculator, but NetBeans says it can\'t find the symbol assertEquals and annotation @Test.
Should i

6条回答
  •  庸人自扰
    2021-02-02 08:10

    Using IntelliJ 2019.2.4 with a start.sping.io default setup...

    import static org.junit.jupiter.api.Assertions.assertEquals;
    

    but now instead of

    Assert.assertEquals(expected, actual);
    

    use

    assertEquals(expected, actual);
    

提交回复
热议问题