Package com.fasterxml.jackson.jaxrs.json

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


    public void testEchoGenericSuperBookCollectionProxy2() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/genericstore2";
        GenericBookStoreSpring2 proxy = JAXRSClientFactory.create(endpointAddress,
            GenericBookStoreSpring2.class, Collections.singletonList(new JacksonJsonProvider()));
        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


    public void testEchoGenericSuperBookWebClient() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/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/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/genericstore/books/superbooks2";
        WebClient wc = WebClient.create(endpointAddress,
                                        Collections.singletonList(new JacksonJsonProvider()));
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(100000000L);
        wc.accept(MediaType.APPLICATION_JSON);
        Collection<? extends SuperBook> books = wc.getCollection(SuperBook.class);
       
        SuperBook book = books.iterator().next();
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

    }

    protected static abstract class JsonApplicationWithJackson extends JsonApplication
    {
        public JsonApplicationWithJackson(Object resource) {
            super(new JacksonJsonProvider(), resource);
        }
View Full Code Here

    }

    @Before
    public void before() {
        List<Object> providers = new ArrayList<Object>();
        providers.add(new JacksonJsonProvider());
        configClient = WebClient.create("http://localhost:" + PORT + "/config", providers);
    }
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

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.