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.
我在为流运行 munit 测试用例时将 xml 文件作为输出,但是为了确保输出正确与否,我想在 munit 中使用断言有效负载选项。
请帮助我如何确保代码功能正常工作并且输出符合预期。
如果您正在获取 XML 有效负载,您可以将整个 XML 输出与测试资源文件进行比较,#[getResource('output.xml').asString()]或者您可以使用 XPath 表达式检查输出 XML 中的特定字段。
#[getResource('output.xml').asString()]
HTH。