ClientRequest extends OutboundMessageContext implements ClientRequestContext, InjectionManagerSupplier { public <T> T resolveProperty(final String name, final Class<T> type) { return resolveProperty(name, null, type); } protected  ClientRequest(
            final URI requestUri, final ClientConfig clientConfig, final PropertiesDelegate propertiesDelegate);  ClientRequest(final ClientRequest original); T resolveProperty(final String name, final Class<T> type); @SuppressWarnings("unchecked") T resolveProperty(final String name, final T defaultValue); @Override Object getProperty(final String name); @Override Collection<String> getPropertyNames(); @Override void setProperty(final String name, final Object object); @Override void removeProperty(final String name); @Override URI getUri(); @Override void setUri(final URI uri); @Override String getMethod(); @Override void setMethod(final String method); @Override JerseyClient getClient(); @Override void abortWith(final Response response); Response getAbortResponse(); @Override Configuration getConfiguration(); @Override Map<String, Cookie> getCookies(); MessageBodyWorkers getWorkers(); void setWorkers(final MessageBodyWorkers workers); void accept(final MediaType... types); void accept(final String... types); void acceptLanguage(final Locale... locales); void acceptLanguage(final String... locales); void cookie(final Cookie cookie); void cacheControl(final CacheControl cacheControl); void encoding(final String encoding); void language(final String language); void language(final Locale language); void type(final MediaType type); void type(final String type); void variant(final Variant variant); boolean isAsynchronous(); void enableBuffering(); void writeEntity(); Iterable<WriterInterceptor> getWriterInterceptors(); Iterable<ReaderInterceptor> getReaderInterceptors(); @Override InjectionManager getInjectionManager(); boolean ignoreUserAgent(); void ignoreUserAgent(final boolean ignore);  }
@Test public void testResolveProperty() { JerseyClient client; ClientRequest request; client = new JerseyClientBuilder().build(); request = new ClientRequest( URI.create("http: client.getConfiguration(), new MapPropertiesDelegate()); assertFalse(request.getConfiguration().getPropertyNames().contains("name")); assertFalse(request.getPropertyNames().contains("name")); assertNull(request.getConfiguration().getProperty("name")); assertNull(request.getProperty("name")); assertNull(request.resolveProperty("name", String.class)); assertEquals("value-default", request.resolveProperty("name", "value-default")); client = new JerseyClientBuilder().property("name", "value-global").build(); request = new ClientRequest( URI.create("http: client.getConfiguration(), new MapPropertiesDelegate()); assertTrue(request.getConfiguration().getPropertyNames().contains("name")); assertFalse(request.getPropertyNames().contains("name")); assertEquals("value-global", request.getConfiguration().getProperty("name")); assertNull(request.getProperty("name")); assertEquals("value-global", request.resolveProperty("name", String.class)); assertEquals("value-global", request.resolveProperty("name", "value-default")); client = new JerseyClientBuilder().build(); request = new ClientRequest( URI.create("http: client.getConfiguration(), new MapPropertiesDelegate()); request.setProperty("name", "value-request"); assertFalse(request.getConfiguration().getPropertyNames().contains("name")); assertTrue(request.getPropertyNames().contains("name")); assertNull(request.getConfiguration().getProperty("name")); assertEquals("value-request", request.getProperty("name")); assertEquals("value-request", request.resolveProperty("name", String.class)); assertEquals("value-request", request.resolveProperty("name", "value-default")); client = new JerseyClientBuilder().property("name", "value-global").build(); request = new ClientRequest( URI.create("http: client.getConfiguration(), new MapPropertiesDelegate()); request.setProperty("name", "value-request"); assertTrue(request.getConfiguration().getPropertyNames().contains("name")); assertTrue(request.getPropertyNames().contains("name")); assertEquals("value-global", request.getConfiguration().getProperty("name")); assertEquals("value-request", request.getProperty("name")); assertEquals("value-request", request.resolveProperty("name", String.class)); assertEquals("value-request", request.resolveProperty("name", "value-default")); }