我正在尝试使用Maven执行项目的测试,但是Maven不执行ParameterizedTest的测试
测试文件:
public class MapReaderTest {
@ParameterizedTest
@ValueSource(strings = {"A","B","C","D","E","F","G","H","I","J","K","L","M"})
void invalidMapTest(String mapLetter){
String map = "./errorMap" + mapLetter + ".txt";
String path = getClass().getClassLoader().getResource(map).getPath();
assertThrows(MapInvalidLevelException.class, ()->new MapReader(path));
}
}
pom.xml:
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Maven结果:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running es.upm.pproject.sokoban.util.MapReaderTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec