JUnit 5.8.1 Java 17.0.1 IntelliJ IDEA 2021.2.3 JUnit5での @MethodSource のおさらい JUnit5にはパラメタライズドテスト用の @ParameterizedTest があり、様々な方法でパラメーターを与えられます。 その中でもパラメーターにある程度柔軟性が欲しい場合によく使うのが @MethodSource で、テストメソッドのパラメーターを生成できます。 import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import java.util.stream.Stream; import static org.junit.jupiter.api.Assertions.a
![JUnitのNestedなMethodSourceの注意点 - 日々常々](https://cdn-ak-scissors.b.st-hatena.com/image/square/243d97ad1c665b8286d85132fa1a198086f52220/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fi%2Firof%2F20211118%2F20211118203830.png)