Examples of proxyBuilder()


Examples of org.jboss.resteasy.client.jaxrs.ResteasyWebTarget.proxyBuilder()

 
  @Test
  public void testDefaultValues() throws Exception
  {
    ResteasyWebTarget target = client.target(TestPortProvider.generateURL("/foo"));
      Foo foo = target.proxyBuilder(Foo.class).defaultProduces(MediaType.TEXT_PLAIN_TYPE).defaultConsumes(MediaType.TEXT_PLAIN_TYPE).build();

    assertEquals("[text/plain]", foo.getFoo());
    assertEquals("text/plain", foo.setFoo("SOMETHING"));
  }
View Full Code Here

Examples of org.jboss.resteasy.client.jaxrs.ResteasyWebTarget.proxyBuilder()

  public void testMismatch() throws Exception
  {
    // NOTE: this doesn't fail on the server because the default */* provider matches the
    // requested media type.
    ResteasyWebTarget target = client.target(TestPortProvider.generateURL("/foo"));
      Foo foo = target.proxyBuilder(Foo.class).defaultProduces(MediaType.APPLICATION_JSON_TYPE).defaultConsumes(MediaType.APPLICATION_JSON_TYPE).build();

    assertEquals("[application/json]", foo.getFoo());
    assertEquals("application/json", foo.setFoo("SOMETHING"));
  }
}
View Full Code Here

Examples of org.jboss.resteasy.client.jaxrs.ResteasyWebTarget.proxyBuilder()

//                                This is test method so if it only contains @Test annotation then we don't need to hassel with substitutions
                parameterType = methodDeclaredAnnotations.length <= 1 ? clazz : ClassModifier.getModifiedClass(clazz, methodDeclaredAnnotations);
            } catch (Exception e) {
                throw new RuntimeException("Cannot substitute annotations for method " + method.getName(), e);
            }
            final ProxyBuilder<?> proxyBuilder = resteasyWebTarget.proxyBuilder(parameterType);
            if (null != consumes && consumes.value().length > 0) {
                proxyBuilder.defaultConsumes(consumes.value()[0]);
            }
            if (null != produces && produces.value().length > 0) {
                proxyBuilder.defaultProduces(produces.value()[0]);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.