我寫這個測試nosqlunit註釋@UsingDataSet位置
@Test
@UsingDataSet(locations = {"dataset.json"}, loadStrategy= LoadStrategyEnum.CLEAN_INSERT)
public void readAndupdateTemplate(){
..............
}
我的根項目具有以下結構上面寫
app
|
|_ _ src
|_ _ main
| |_ _ java
| | ......(my packages)
| |_ _ resources
|
|_ _ test
|_ _java
| .....(my test packages)
|_ _resources
類的測試是在app/src/test/java
和我dataset.json
在app/src/test/resource
當我嘗試運行此測試時,出現此錯誤
java.lang.IllegalArgumentException: File specified in locations property are not present in classpath, or no files matching default name are found. Valid default locations are: /xx/xxxxxxxxx/xxxxxxxxxx/service/TemplateServiceTest.json or /xx/xxxxxxxxx/xxxxxxxxxx/service/TemplateServiceTest#readAndupdateTemplate.json