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