Examples of JacksonJsonProvider


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

    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

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

    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

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

    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

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

   
    @Override
    public Set< Object > getSingletons() {
        return Sets.< Object >newHashSet(
            bookStore,
            new JacksonJsonProvider(),
            new ValidationExceptionMapper(),
            new JAXRSBeanValidationFeature());
    }
View Full Code Here

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

    protected WebClient createWebClient(final String url) {
        return createWebClient(url, MediaType.APPLICATION_JSON);
    }
   
    protected WebClient createWebClient(final String url, final String mediaType) {
        final List< ? > providers = Arrays.asList(new JacksonJsonProvider());
       
        final WebClient wc = WebClient
            .create("http://localhost:" + getPort() + url, providers)
            .accept(mediaType);
       
View Full Code Here

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

    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

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

    @Test
    public void testMultipart() throws Exception {
       
        String endpointAddress = "http://localhost:" + PORT + "/webapp/multipart";
        MultipartStore proxy = JAXRSClientFactory.create(endpointAddress, MultipartStore.class,
            Collections.singletonList(new JacksonJsonProvider()));
        Book json = new Book("json", 1L);
        InputStream is1 =  getClass().getResourceAsStream("/org/apache/cxf/systest/jaxrs/resources/java.jpg");
       
        Map<String, Object> attachments = proxy.addBookJsonImageStream(json, is1);
        assertEquals(2, attachments.size());
View Full Code Here

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

    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

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

    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

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

    public void testEchoSuperBookProxy() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/store2";
        BookStoreSpring proxy = JAXRSClientFactory.create(endpointAddress, BookStoreSpring.class,
            Collections.singletonList(new JacksonJsonProvider()));
        SuperBook book = proxy.echoSuperBookJson(new SuperBook("Super", 124L, true));
        assertEquals(124L, book.getId());
        assertTrue(book.isSuperBook());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.