Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种简单的方法可以从 org.mockserver 加载响应正文的文件内容(如 Json 文件)?
还是我必须以通常的方式进行?
您可以使用读取 json 文件内容
public <T> T conversion(File jsonFile, Class<T> pClass) throws IOException { return objectMapper.readValue(FileUtils.readFileToString(<your file>,"UTF-8"),<your class>); }
希望这可以帮助。