Package com.fasterxml.jackson.jaxrs.json

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


  private String secretKey;

  public ParaClient(String accessKey, String secretKey) {
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.register(GenericExceptionMapper.class);
    clientConfig.register(new JacksonJsonProvider(Utils.getJsonMapper()));
    clientConfig.connectorProvider(new JettyConnectorProvider());
    this.client = ClientBuilder.newClient(clientConfig);
    this.accessKey = accessKey;
    this.secretKey = secretKey;
  }
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

    @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

    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()));
        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 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

    public void testEchoGenericSuperBookCollectionProxy() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/genericstore";
        GenericBookStoreSpring proxy = JAXRSClientFactory.create(endpointAddress,
            GenericBookStoreSpring.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 testEchoGenericSuperBookProxy() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/genericstore";
        GenericBookStoreSpring proxy = JAXRSClientFactory.create(endpointAddress,
            GenericBookStoreSpring.class, Collections.singletonList(new JacksonJsonProvider()));
        WebClient.getConfig(proxy).getHttpConduit().getClient().setReceiveTimeout(1000000000L);
        SuperBook book = proxy.echoSuperBookJson(new SuperBook("Super", 124L, true));
        assertEquals(124L, book.getId());
        assertTrue(book.isSuperBook());
    }
View Full Code Here

    public void testEchoGenericSuperBookProxy2() throws Exception {
       
        String endpointAddress =
            "http://localhost:" + PORT + "/webapp/genericstore2";
        GenericBookStoreSpring2 proxy = JAXRSClientFactory.create(endpointAddress,
            GenericBookStoreSpring2.class, Collections.singletonList(new JacksonJsonProvider()));
        WebClient.getConfig(proxy).getHttpConduit().getClient().setReceiveTimeout(1000000000L);
        SuperBook book = proxy.echoSuperBookJson(new SuperBook("Super", 124L, true));
        assertEquals(124L, book.getId());
        assertTrue(book.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.