Package com.fasterxml.jackson.jaxrs.json

Examples of com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider


    public void testGetGenericSuperBookCollectionWebClient() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/genericstore/books/superbooks2";
        WebClient wc = WebClient.create(endpointAddress,
                                        Collections.singletonList(new JacksonJsonProvider()));
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(100000000L);
        wc.accept(MediaType.APPLICATION_JSON);
        List<SuperBook> books = wc.get(new GenericType<List<SuperBook>>() {
        });
       
View Full Code Here


    public void testGetCollectionOfBooks() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/store1/bookstore/collections";
        WebClient wc = WebClient.create(endpointAddress,
            Collections.singletonList(new JacksonJsonProvider()));
        wc.accept("application/json");
        Collection<? extends Book> collection = wc.getCollection(Book.class);
        assertEquals(1, collection.size());
        Book book = collection.iterator().next();
        assertEquals(123L, book.getId());
View Full Code Here

    public void testGetCollectionOfSuperBooks() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/store2/books/superbooks";
        WebClient wc = WebClient.create(endpointAddress,
            Collections.singletonList(new JacksonJsonProvider()));
        wc.accept("application/json");
        Collection<? extends Book> collection = wc.getCollection(Book.class);
        assertEquals(1, collection.size());
        Book book = collection.iterator().next();
        assertEquals(999L, book.getId());
View Full Code Here

    public void testGetCollectionOfBooks() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/bookstore/collections";
        WebClient wc = WebClient.create(endpointAddress,
            Collections.singletonList(new JacksonJsonProvider()));
        wc.accept("application/json");
        Collection<? extends Book> collection = wc.getCollection(Book.class);
        assertEquals(1, collection.size());
        Book book = collection.iterator().next();
        assertEquals(123L, book.getId());
View Full Code Here

  @Provides
  @Singleton
  public JacksonJsonProvider getJacksonJsonProvider(@Json ObjectMapper objectMapper)
  {
    final JacksonJsonProvider provider = new JacksonJsonProvider();
    provider.setMapper(objectMapper);
    return provider;
  }
View Full Code Here

  }

  private Client createRESTClient(final DNSAPIClientConfig config,
      final ObjectMapper mapper, final SSLContextFactory sslContextFactory)
      throws Exception {
    final JacksonJsonProvider jacksonJsonProvider = new ErrorHandlingJacksonJsonProvider(
        mapper);

    final SSLContext sslContext = sslContextFactory.createSSLContext();
    final SSLSocketFactory sslSocketFactory = new SSLSocketFactory(
        sslContext);
View Full Code Here

    RestUtils.scanForDomainClasses(coreClasses);
    setApplicationName(Config.APP_NAME_NS);

//    register(JsonParseExceptionMapper.class);
//    register(JsonMappingExceptionMapper.class);
    register(new JacksonJsonProvider(Utils.getJsonMapper()));
    register(GenericExceptionMapper.class);
    register(ForbiddenExceptionMapper.class);
    register(NotFoundExceptionMapper.class);
    register(InternalExceptionMapper.class);
    register(UnavailableExceptionMapper.class);
View Full Code Here

            //If the Jackson XC bundle is installed we can use JAXB annotations.
            Class.forName("org.codehaus.jackson.xc.JaxbAnnotationIntrospector");
            s.add(new JacksonJaxbJsonProvider());
            m_logService.log(LogService.LOG_INFO, "Jackson JAX-RS provider configured with JAXB annotation support");
        } catch (Exception e) {
            JacksonJsonProvider jaxbProvider = new JacksonJsonProvider();
            s.add(jaxbProvider);

            m_logService.log(LogService.LOG_INFO, "Jackson JAX-RS provider configured");
        }
View Full Code Here

    }
    if (enableLogging) {
      bean.setFeatures(Arrays.<AbstractFeature>asList(new LoggingFeature()));
    }
    bean.setResourceClass(proxyType);
    bean.setProvider(new JacksonJsonProvider(new ApiObjectMapper()));

    T rootResource = bean.create(proxyType);
    ClientConfiguration config = WebClient.getConfig(rootResource);
    HTTPConduit conduit = (HTTPConduit) config.getConduit();
    if (isTlsEnabled) {
View Full Code Here

    public void testGetSuperBookProxy() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/store2";
        BookStoreSpring proxy = JAXRSClientFactory.create(endpointAddress, BookStoreSpring.class,
            Collections.singletonList(new JacksonJsonProvider()));
        SuperBook book = proxy.getSuperBookJson();
        assertEquals(999L, book.getId());
    }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider

Copyright © 2018 www.massapicom. 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.