【发布时间】:2019-04-16 07:25:29
【问题描述】:
我有这个“内容”响应,我需要从中断言一些值。
WebTestClient.BodyContentSpec content = response.expectStatus().isOk()
.expectBody()
.jsonPath("$.path1").isEqualTo(value1);
如果我想用预定义的值断言一些 JSON 路径,一切都很好。
但是当我想检查一个 JSON 路径是否等于另一个 JSON 路径时,棘手的部分就来了。
JsonPathAssertions jsonPath2 = bodyContentSpec.jsonPath("$.path2");
JsonPathAssertions jsonPath3 = bodyContentSpec.jsonPath("$.path3");
所以我的问题是如何使用org.hamcrest.Matchers.greaterThanOrEqualTo 断言jsonPath2 对jsonPath3 的内容?
【问题讨论】:
标签: java junit spring-webflux