use of feign.querymap.FieldQueryMapEncoder in project feign by OpenFeign.
the class FeignUnderAsyncTest method queryMap_with_child_pojo.
@Test
public void queryMap_with_child_pojo() throws Exception {
TestInterface api = new TestInterfaceBuilder().queryMapEndcoder(new FieldQueryMapEncoder()).target("http://localhost:" + server.getPort());
ChildPojo childPojo = new ChildPojo();
childPojo.setChildPrivateProperty("first");
childPojo.setParentProtectedProperty("second");
childPojo.setParentPublicProperty("third");
server.enqueue(new MockResponse());
api.queryMapPropertyInheritence(childPojo);
assertThat(server.takeRequest()).hasQueryParams("parentPublicProperty=third", "parentProtectedProperty=second", "childPrivateProperty=first");
}
use of feign.querymap.FieldQueryMapEncoder in project feign by OpenFeign.
the class AsyncFeignTest method queryMap_with_child_pojo.
@Test
public void queryMap_with_child_pojo() throws Exception {
TestInterfaceAsync api = new TestInterfaceAsyncBuilder().queryMapEndcoder(new FieldQueryMapEncoder()).target("http://localhost:" + server.getPort());
ChildPojo childPojo = new ChildPojo();
childPojo.setChildPrivateProperty("first");
childPojo.setParentProtectedProperty("second");
childPojo.setParentPublicProperty("third");
server.enqueue(new MockResponse());
CompletableFuture<?> cf = api.queryMapPropertyInheritence(childPojo);
assertThat(server.takeRequest()).hasQueryParams("parentPublicProperty=third", "parentProtectedProperty=second", "childPrivateProperty=first");
checkCFCompletedSoon(cf);
}
use of feign.querymap.FieldQueryMapEncoder 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);
}
use of feign.querymap.FieldQueryMapEncoder in project feign by OpenFeign.
the class AsyncApacheHttp5ClientTest method queryMap_with_child_pojo.
@Test
public void queryMap_with_child_pojo() throws Exception {
final TestInterfaceAsync api = new TestInterfaceAsyncBuilder().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);
}
use of feign.querymap.FieldQueryMapEncoder in project feign by OpenFeign.
the class FeignTest method queryMap_with_child_pojo.
@Test
public void queryMap_with_child_pojo() throws Exception {
TestInterface api = new TestInterfaceBuilder().queryMapEndcoder(new FieldQueryMapEncoder()).target("http://localhost:" + server.getPort());
ChildPojo childPojo = new ChildPojo();
childPojo.setChildPrivateProperty("first");
childPojo.setParentProtectedProperty("second");
childPojo.setParentPublicProperty("third");
server.enqueue(new MockResponse());
api.queryMapPropertyInheritence(childPojo);
assertThat(server.takeRequest()).hasQueryParams("parentPublicProperty=third", "parentProtectedProperty=second", "childPrivateProperty=first");
}
Aggregations