use of feign.querymap.BeanQueryMapEncoder in project feign by OpenFeign.
the class FeignTest 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 FeignTest 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"));
}
use of feign.querymap.BeanQueryMapEncoder 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.querymap.BeanQueryMapEncoder 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);
}
use of feign.querymap.BeanQueryMapEncoder in project feign by OpenFeign.
the class AsyncApacheHttp5ClientTest method beanQueryMapEncoderWithPrivateGetterIgnored.
@Test
public void beanQueryMapEncoderWithPrivateGetterIgnored() throws Exception {
final TestInterfaceAsync api = new TestInterfaceAsyncBuilder().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