Java 8 使用junit5运行参数化测试时出现异常
我在尝试将参数化测试与spring boot应用程序集成时遇到Junit Vintage初始化错误。对解决这个问题有什么建议吗Java 8 使用junit5运行参数化测试时出现异常,java-8,junit5,parameterized-unit-test,Java 8,Junit5,Parameterized Unit Test,我在尝试将参数化测试与spring boot应用程序集成时遇到Junit Vintage初始化错误。对解决这个问题有什么建议吗 @parameteredtest(name=“Run{index}:loanAmount={0},预付款={1},可用资金={2},expectApproved={3},expectedMessage={4}”) @MethodSource(“testRequestLoan_参数”) 公共作废testRequestLoan(浮动贷款金额、浮动首期付款、浮动可用资金、,
@parameteredtest(name=“Run{index}:loanAmount={0},预付款={1},可用资金={2},expectApproved={3},expectedMessage={4}”)
@MethodSource(“testRequestLoan_参数”)
公共作废testRequestLoan(浮动贷款金额、浮动首期付款、浮动可用资金、,
布尔值expectApproved,字符串expectedMessage)可丢弃
{
}
静态流testRequestLoan_参数()抛出可丢弃的{
回流(
参数。of(1000.0f、200.0f、250.0f、true、null),
参数。of(1000.0f、50.0f、250.0f,false,“错误。不足。首付款”),
参数。of(1000.0f、200.0f、150.0f,false,“错误。不足。资金。用于。首付款”)
);
}
依赖关系
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.3.2</version>
<scope>test</scope>
</dependency>
org.junit.jupiter
JUnitJupiter api
测试
org.junit.jupiter
朱尼特朱庇特酒店
5.3.2
测试
我通过使用
@ExtendWith(SpringExtension.class)
@ExtendWith(SpringExtension.class)