dreamhead / moco

Easy Setup Stub Server
MIT License
4.35k stars 1.08k forks source link

added json struct match support in java #301

Closed tian-pengfei closed 2 years ago

tian-pengfei commented 3 years ago
  @Test
    public void should_match_same_structure_json() throws Exception {
        final String jsonText = Jsons.toJson(of("foo", "bar"));
        final String jsonText2 = Jsons.toJson(of("foo", "bar2"));
        server.request(as(json(jsonText))).response("foo");
        running(server, () -> assertThat(helper.postContent(root(), jsonText2), is("foo")));
    }

result:

Results: SUCCESS (1 tests, 1 successes, 0 failures, 0 skipped)
tian-pengfei commented 2 years ago

nice