org.jboss.resteasy.client.jaxrs.internal.LocalResteasyProviderFactory Java Examples
The following examples show how to use
org.jboss.resteasy.client.jaxrs.internal.LocalResteasyProviderFactory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractStoresTest.java From alfresco-simple-content-stores with Apache License 2.0 | 6 votes |
/** * Configures and constructs a Resteasy client to use for calling the Alfresco Public ReST API in the dockerised deployment. * * @return the configured client */ protected static ResteasyClient setupResteasyClient() { final SimpleModule module = new SimpleModule(); module.setDeserializerModifier(new RestAPIBeanDeserializerModifier()); final ResteasyJackson2Provider resteasyJacksonProvider = new ResteasyJackson2Provider(); final ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(Include.NON_EMPTY); mapper.registerModule(module); resteasyJacksonProvider.setMapper(mapper); final LocalResteasyProviderFactory resteasyProviderFactory = new LocalResteasyProviderFactory(new ResteasyProviderFactoryImpl()); resteasyProviderFactory.register(resteasyJacksonProvider); // will cause a warning regarding Jackson provider which is already registered RegisterBuiltin.register(resteasyProviderFactory); resteasyProviderFactory.register(new MultiValuedParamConverterProvider()); final ResteasyClient client = new ResteasyClientBuilderImpl().providerFactory(resteasyProviderFactory).build(); return client; }
Example #2
Source File: NexusITSupport.java From nexus-public with Eclipse Public License 1.0 | 5 votes |
/** * The jax-rs clients require ObjectMapper customizations to work with ComponentXO. */ private Customizer getObjectMapperCustomizer(final TestSuiteObjectMapperResolver testSuiteObjectMapperResolver) { return builder -> { ResteasyProviderFactory providerFactory = new LocalResteasyProviderFactory( ResteasyProviderFactory.newInstance()); providerFactory.registerProviderInstance(testSuiteObjectMapperResolver, null, 1000, false); ResteasyClientBuilder resteasyClientBuilder = (ResteasyClientBuilder) builder; resteasyClientBuilder.providerFactory(providerFactory); RegisterBuiltin.register(providerFactory); }; }
Example #3
Source File: NexusITSupport.java From nexus-public with Eclipse Public License 1.0 | 5 votes |
/** * The jax-rs clients require ObjectMapper customizations to work with ComponentXO. */ private Customizer getObjectMapperCustomizer(final TestSuiteObjectMapperResolver testSuiteObjectMapperResolver) { return builder -> { ResteasyProviderFactory providerFactory = new LocalResteasyProviderFactory( ResteasyProviderFactory.newInstance()); providerFactory.registerProviderInstance(testSuiteObjectMapperResolver, null, 1000, false); ResteasyClientBuilder resteasyClientBuilder = (ResteasyClientBuilder) builder; resteasyClientBuilder.providerFactory(providerFactory); RegisterBuiltin.register(providerFactory); }; }
Example #4
Source File: ClientBuilderReplacement.java From quarkus with Apache License 2.0 | 4 votes |
@Substitute public static ClientBuilder newBuilder() { ResteasyClientBuilder client = new ResteasyClientBuilderImpl(); client.providerFactory(new LocalResteasyProviderFactory(RestClientRecorder.providerFactory)); return client; }