JUnit 5 テスト内の junit.framework.Assertorg.junit.Assertorg.junit.Assume クラスにあるメソッドの呼び出しを報告します。

このようなテストは適切に機能しますが、org.junit.jupiter.api.Assertions/org.junit.jupiter.api.Assumptions に移行すると、古い JUnit バージョンへの依存を避けることができます。

例:


  import org.junit.Assert;
  import org.junit.jupiter.api.Test;

  public class MyTest {
    @Test
    public void simpleTest() {
      Assert.assertEquals(4, 2 + 2);
    }
  }

クイックフィックス適用後:


  import org.junit.jupiter.api.Assertions;
  import org.junit.jupiter.api.Test;

  public class MyTest {
    @Test
    public void simpleTest() {
      Assertions.assertEquals(4, 2 + 2);
    }
  }