这是我尝试添加的jackson数据绑定神器
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.1</version>
</dependency>
下面是我编写的用于从 json 文件导入数据的代码
public List<HashMap<String, String>> getJsonData(String JsonFilePath)
{
String JsonContent=FileUtils.readFileToString(new File(System.getProperty("user.dir")+"\\src\\test\\java\\org\\mobileRecharge\\testData\\Requirements.json"),StandardCharsets.UTF_8);
ObjectMapper mapper = new ObjectMapper();
List<HashMap<String, String>> data=mapper.readValue(JsonContent,
new TypeReference<List<HashMap<String, String>>>(){
});
return data;
}
这是我尝试添加的jackson数据绑定神器
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.1</version>
</dependency>