use of feign.querymap.BeanQueryMapEncoder in project feign by OpenFeign.
the class AsyncApacheHttp5ClientTest method beanQueryMapEncoderWithEmptyParams.
@Test
public void beanQueryMapEncoderWithEmptyParams() throws Exception {
final TestInterfaceAsync api = new TestInterfaceAsyncBuilder().queryMapEndcoder(new BeanQueryMapEncoder()).target("http://localhost:" + server.getPort());
final PropertyPojo.ChildPojoClass propertyPojo = new PropertyPojo.ChildPojoClass();
server.enqueue(new MockResponse());
final CompletableFuture<?> cf = api.queryMapPropertyPojo(propertyPojo);
assertThat(server.takeRequest()).hasQueryParams("/");
checkCFCompletedSoon(cf);
}
use of feign.querymap.BeanQueryMapEncoder in project feign by OpenFeign.
the class AsyncFeignTest method beanQueryMapEncoderWithEmptyParams.
@Test
public void beanQueryMapEncoderWithEmptyParams() throws Exception {
TestInterfaceAsync api = new TestInterfaceAsyncBuilder().queryMapEndcoder(new BeanQueryMapEncoder()).target("http://localhost:" + server.getPort());
PropertyPojo.ChildPojoClass propertyPojo = new PropertyPojo.ChildPojoClass();
server.enqueue(new MockResponse());
CompletableFuture<?> cf = api.queryMapPropertyPojo(propertyPojo);
assertThat(server.takeRequest()).hasQueryParams("/");
checkCFCompletedSoon(cf);
}
use of feign.querymap.BeanQueryMapEncoder in project feign by OpenFeign.
the class FeignUnderAsyncTest method beanQueryMapEncoderWithNullValueIgnored.
@Test
public void beanQueryMapEncoderWithNullValueIgnored() throws Exception {
TestInterface api = new TestInterfaceBuilder().queryMapEndcoder(new BeanQueryMapEncoder()).target("http://localhost:" + server.getPort());
PropertyPojo.ChildPojoClass propertyPojo = new PropertyPojo.ChildPojoClass();
propertyPojo.setName(null);
propertyPojo.setNumber(1);
server.enqueue(new MockResponse());
api.queryMapPropertyPojo(propertyPojo);
assertThat(server.takeRequest()).hasQueryParams("number=1");
}
use of feign.querymap.BeanQueryMapEncoder in project feign by OpenFeign.
the class FeignUnderAsyncTest method beanQueryMapEncoderWithEmptyParams.
@Test
public void beanQueryMapEncoderWithEmptyParams() throws Exception {
TestInterface api = new TestInterfaceBuilder().queryMapEndcoder(new BeanQueryMapEncoder()).target("http://localhost:" + server.getPort());
PropertyPojo.ChildPojoClass propertyPojo = new PropertyPojo.ChildPojoClass();
server.enqueue(new MockResponse());
api.queryMapPropertyPojo(propertyPojo);
assertThat(server.takeRequest()).hasQueryParams("/");
}
use of feign.querymap.BeanQueryMapEncoder in project feign by OpenFeign.
the class FeignUnderAsyncTest method beanQueryMapEncoderWithPrivateGetterIgnored.
@Test
public void beanQueryMapEncoderWithPrivateGetterIgnored() throws Exception {
TestInterface api = new TestInterfaceBuilder().queryMapEndcoder(new BeanQueryMapEncoder()).target("http://localhost:" + server.getPort());
PropertyPojo.ChildPojoClass propertyPojo = new PropertyPojo.ChildPojoClass();
propertyPojo.setPrivateGetterProperty("privateGetterProperty");
propertyPojo.setName("Name");
propertyPojo.setNumber(1);
server.enqueue(new MockResponse());
api.queryMapPropertyPojo(propertyPojo);
assertThat(server.takeRequest()).hasQueryParams(Arrays.asList("name=Name", "number=1"));
}
Aggregations