Package com.fasterxml.jackson.jaxrs.json

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


    public void testEchoGenericSuperBookWebClient() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/custombus/genericstore/books/superbook";
        WebClient wc = WebClient.create(endpointAddress,
                                        Collections.singletonList(new JacksonJsonProvider()));
        wc.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON);
        SuperBook book = wc.post(new SuperBook("Super", 124L, true), SuperBook.class);
        assertEquals(124L, book.getId());
        assertTrue(book.isSuperBook());
    }
View Full Code Here


    public void testEchoGenericSuperBookCollectionWebClient() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/custombus/genericstore/books/superbooks";
        WebClient wc = WebClient.create(endpointAddress,
                                        Collections.singletonList(new JacksonJsonProvider()));
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(100000000L);
        wc.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON);
        Collection<? extends SuperBook> books =
            wc.postAndGetCollection(Collections.singletonList(new SuperBook("Super", 124L, true)),
                                    SuperBook.class,
View Full Code Here

    public void testGetGenericSuperBookCollectionWebClient() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/custombus/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

    }
   
    @SuppressWarnings("unchecked")
    private WebClient createWebClient(final String url) {
        WebClient wc = WebClient.create("http://localhost:" + PORT + url,
            Arrays.asList(new MultipartProvider(), new JacksonJsonProvider()));
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000L);
        return wc;
    }
View Full Code Here

            sf.setResourceProvider(BookCatalog.class, new SingletonResourceProvider(new BookCatalog()));
            sf.setAddress("http://localhost:" + PORT + "/");
            sf.setProperties(properties);
            sf.setProvider(new MultipartProvider());
            sf.setProvider(new SearchContextProvider());
            sf.setProvider(new JacksonJsonProvider());
           
            sf.create();
        }
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

    public void testGetSuperBookCollectionProxy() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/store2";
        BookStoreSpring proxy = JAXRSClientFactory.create(endpointAddress, BookStoreSpring.class,
            Collections.singletonList(new JacksonJsonProvider()));
        List<SuperBook> books = proxy.getSuperBookCollectionJson();
        assertEquals(999L, books.get(0).getId());
    }
View Full Code Here

    public void testEchoSuperBookCollectionProxy() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/store2";
        BookStoreSpring proxy = JAXRSClientFactory.create(endpointAddress, BookStoreSpring.class,
            Collections.singletonList(new JacksonJsonProvider()));
        WebClient.getConfig(proxy).getHttpConduit().getClient().setReceiveTimeout(10000000L);
        List<SuperBook> books =
            proxy.echoSuperBookCollectionJson(Collections.singletonList(new SuperBook("Super", 124L, true)));
        assertEquals(124L, books.get(0).getId());
        assertTrue(books.get(0).isSuperBook());
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.