Search in sources :

Example 1 with PropertyPojo

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);
}
Also used : BeanQueryMapEncoder(feign.querymap.BeanQueryMapEncoder) MockResponse(okhttp3.mockwebserver.MockResponse) PropertyPojo(feign.PropertyPojo) Test(org.junit.Test)

Example 2 with PropertyPojo

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);
}
Also used : BeanQueryMapEncoder(feign.querymap.BeanQueryMapEncoder) MockResponse(okhttp3.mockwebserver.MockResponse) PropertyPojo(feign.PropertyPojo) Test(org.junit.Test)

Example 3 with PropertyPojo

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);
}
Also used : BeanQueryMapEncoder(feign.querymap.BeanQueryMapEncoder) MockResponse(okhttp3.mockwebserver.MockResponse) PropertyPojo(feign.PropertyPojo) Test(org.junit.Test)

Aggregations

PropertyPojo (feign.PropertyPojo)3 BeanQueryMapEncoder (feign.querymap.BeanQueryMapEncoder)3 MockResponse (okhttp3.mockwebserver.MockResponse)3 Test (org.junit.Test)3