@Test public void customUserAgentTest() { final Client customClient = ClientBuilder.newClient(new ClientConfig().connectorProvider(new TestConnector())); try { customClient.target("test").request().header(HttpHeaders.USER_AGENT, null).get(); } catch (Exception e) { assertEquals("[null]", e.getMessage()); } try { customClient.target("test").request().header(HttpHeaders.USER_AGENT, null).async().get(); } catch (Exception e) { assertEquals("[null]", e.getCause().getMessage()); } try { customClient.target("test").request().header(HttpHeaders.USER_AGENT, "custom").get(); } catch (Exception e) { assertEquals("custom", e.getMessage()); } try { customClient.target("test").request().header(HttpHeaders.USER_AGENT, "custom").async().get(); } catch (Exception e) { assertEquals("custom", e.getCause().getMessage()); } }
@Override public JerseyWebTarget target(final String uri) { checkNotClosed(); checkNotNull(uri, LocalizationMessages.CLIENT_URI_TEMPLATE_NULL()); return new JerseyWebTarget(uri, this); }
JerseyClient implements javax.ws.rs.client.Client, Initializable<JerseyClient> { @Override public JerseyWebTarget target(final String uri) { checkNotClosed(); checkNotNull(uri, LocalizationMessages.CLIENT_URI_TEMPLATE_NULL()); return new JerseyWebTarget(uri, this); } }
JerseyClient implements javax.ws.rs.client.Client, Initializable<JerseyClient> { @Override public JerseyWebTarget target(final String uri) { checkNotClosed(); checkNotNull(uri, LocalizationMessages.CLIENT_URI_TEMPLATE_NULL()); return new JerseyWebTarget(uri, this); } protected  JerseyClient(); protected  JerseyClient(final Configuration config,
                           final SSLContext sslContext,
                           final HostnameVerifier verifier); protected  JerseyClient(final Configuration config,
                           final SSLContext sslContext,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier); protected  JerseyClient(final Configuration config,
                           final SSLContext sslContext,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider,
                           ExecutorService executorService,
                           ScheduledExecutorService scheduledExecutorService); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier,
                           ExecutorService executorService,
                           ScheduledExecutorService scheduledExecutorService); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider,
                           ExecutorService executorService,
                           ScheduledExecutorService scheduledExecutorService); }
JerseyClient implements javax.ws.rs.client.Client, Initializable<JerseyClient> { @Override public JerseyWebTarget target(final String uri) { checkNotClosed(); checkNotNull(uri, LocalizationMessages.CLIENT_URI_TEMPLATE_NULL()); return new JerseyWebTarget(uri, this); } protected  JerseyClient(); protected  JerseyClient(final Configuration config,
                           final SSLContext sslContext,
                           final HostnameVerifier verifier); protected  JerseyClient(final Configuration config,
                           final SSLContext sslContext,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier); protected  JerseyClient(final Configuration config,
                           final SSLContext sslContext,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider,
                           ExecutorService executorService,
                           ScheduledExecutorService scheduledExecutorService); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier,
                           ExecutorService executorService,
                           ScheduledExecutorService scheduledExecutorService); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider,
                           ExecutorService executorService,
                           ScheduledExecutorService scheduledExecutorService); @Override void close(); boolean isClosed(); boolean isDefaultSslContext(); @Override JerseyWebTarget target(final String uri); @Override JerseyWebTarget target(final URI uri); @Override JerseyWebTarget target(final UriBuilder uriBuilder); @Override JerseyWebTarget target(final Link link); @Override JerseyInvocation.Builder invocation(final Link link); @Override JerseyClient register(final Class<?> providerClass); @Override JerseyClient register(final Object provider); @Override JerseyClient register(final Class<?> providerClass, final int bindingPriority); @Override JerseyClient register(final Class<?> providerClass, final Class<?>... contracts); @Override JerseyClient register(final Class<?> providerClass, final Map<Class<?>, Integer> contracts); @Override JerseyClient register(final Object provider, final int bindingPriority); @Override JerseyClient register(final Object provider, final Class<?>... contracts); @Override JerseyClient register(final Object provider, final Map<Class<?>, Integer> contracts); @Override JerseyClient property(final String name, final Object value); @Override ClientConfig getConfiguration(); @Override SSLContext getSslContext(); @Override HostnameVerifier getHostnameVerifier(); ExecutorService getExecutorService(); ScheduledExecutorService getScheduledExecutorService(); @Override JerseyClient preInitialize(); }
JerseyClient implements javax.ws.rs.client.Client, Initializable<JerseyClient> { @Override public JerseyWebTarget target(final String uri) { checkNotClosed(); checkNotNull(uri, LocalizationMessages.CLIENT_URI_TEMPLATE_NULL()); return new JerseyWebTarget(uri, this); } protected  JerseyClient(); protected  JerseyClient(final Configuration config,
                           final SSLContext sslContext,
                           final HostnameVerifier verifier); protected  JerseyClient(final Configuration config,
                           final SSLContext sslContext,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier); protected  JerseyClient(final Configuration config,
                           final SSLContext sslContext,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider,
                           ExecutorService executorService,
                           ScheduledExecutorService scheduledExecutorService); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier,
                           ExecutorService executorService,
                           ScheduledExecutorService scheduledExecutorService); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider); protected  JerseyClient(final Configuration config,
                           final UnsafeValue<SSLContext, IllegalStateException> sslContextProvider,
                           final HostnameVerifier verifier,
                           final DefaultSslContextProvider defaultSslContextProvider,
                           ExecutorService executorService,
                           ScheduledExecutorService scheduledExecutorService); @Override void close(); boolean isClosed(); boolean isDefaultSslContext(); @Override JerseyWebTarget target(final String uri); @Override JerseyWebTarget target(final URI uri); @Override JerseyWebTarget target(final UriBuilder uriBuilder); @Override JerseyWebTarget target(final Link link); @Override JerseyInvocation.Builder invocation(final Link link); @Override JerseyClient register(final Class<?> providerClass); @Override JerseyClient register(final Object provider); @Override JerseyClient register(final Class<?> providerClass, final int bindingPriority); @Override JerseyClient register(final Class<?> providerClass, final Class<?>... contracts); @Override JerseyClient register(final Class<?> providerClass, final Map<Class<?>, Integer> contracts); @Override JerseyClient register(final Object provider, final int bindingPriority); @Override JerseyClient register(final Object provider, final Class<?>... contracts); @Override JerseyClient register(final Object provider, final Map<Class<?>, Integer> contracts); @Override JerseyClient property(final String name, final Object value); @Override ClientConfig getConfiguration(); @Override SSLContext getSslContext(); @Override HostnameVerifier getHostnameVerifier(); ExecutorService getExecutorService(); ScheduledExecutorService getScheduledExecutorService(); @Override JerseyClient preInitialize();  }