如何使用Spring Boot和Mockito模拟JSON文档进行测试

发布于 2025-02-09 04:19:02 字数 74 浏览 0 评论 0原文

在Spring Boot测试中,如何测试一种消耗JSON文档(JSON对象列表)的方法,对数据进行处理,对数据进行处理并返回对象列表。

In spring boot test, How to test a method that consumes a JSON Document (list of json object) parses it, does a processing on the data and return a list of objects.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

﹏雨一样淡蓝的深情 2025-02-16 04:19:03

您可以将JSON对象保存在SRC/Test/Resources目录中,并且可以在测试案例中阅读并将其传递给测试案例的输入

You can keep the Json object in your src/test/resources directory and than you can read it inside your test case and pass it as an input to your test case

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文