Search in sources :

Example 1 with ChildPojo

use of feign.ChildPojo in project feign by OpenFeign.

the class Http2ClientAsyncTest method queryMap_with_child_pojo.

@Test
public void queryMap_with_child_pojo() throws Exception {
    final TestInterfaceAsync api = newAsyncBuilder().queryMapEndcoder(new FieldQueryMapEncoder()).target("http://localhost:" + server.getPort());
    final ChildPojo childPojo = new ChildPojo();
    childPojo.setChildPrivateProperty("first");
    childPojo.setParentProtectedProperty("second");
    childPojo.setParentPublicProperty("third");
    server.enqueue(new MockResponse());
    final CompletableFuture<?> cf = api.queryMapPropertyInheritence(childPojo);
    assertThat(server.takeRequest()).hasQueryParams("parentPublicProperty=third", "parentProtectedProperty=second", "childPrivateProperty=first");
    checkCFCompletedSoon(cf);
}
Also used : MockResponse(okhttp3.mockwebserver.MockResponse) ChildPojo(feign.ChildPojo) FieldQueryMapEncoder(feign.querymap.FieldQueryMapEncoder) Test(org.junit.Test)

Aggregations

ChildPojo (feign.ChildPojo)1 FieldQueryMapEncoder (feign.querymap.FieldQueryMapEncoder)1 MockResponse (okhttp3.mockwebserver.MockResponse)1 Test (org.junit.Test)1