Package org.apache.cxf.jaxrs.client

Examples of org.apache.cxf.jaxrs.client.WebClient.replaceHeader()


        String baseAddress = "http://localhost:" + PORT + "/the/thebooks8/books";
        WebClient wc = WebClient.create(baseAddress);
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
        Long id = wc.type("application/xml").accept("text/plain").post(new Book("CXF", 1L), Long.class);
        assertEquals(new Long(1), id);
        Book book = wc.replaceHeader("Accept", "application/xml").query("id", 1L).get(Book.class);
        assertEquals("CXF", book.getName());
    }
   
    @Test
    public void testGetBookWebEx() throws Exception {
View Full Code Here


        String baseAddress = "http://localhost:" + PORT + "/the/thebooks8/books";
        WebClient wc = WebClient.create(baseAddress);
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
        Long id = wc.type("application/xml").accept("text/plain").post(new Book("CXF", 1L), Long.class);
        assertEquals(new Long(1), id);
        Book book = wc.replaceHeader("Accept", "application/xml").query("id", 1L).get(Book.class);
        assertEquals("CXF", book.getName());
    }
   
    @Test
    public void testGetBookWebEx() throws Exception {
View Full Code Here

        String baseAddress = "http://localhost:" + PORT + "/the/thebooks8/books";
        WebClient wc = WebClient.create(baseAddress);
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
        Long id = wc.type("application/xml").accept("text/plain").post(new Book("CXF", 1L), Long.class);
        assertEquals(new Long(1), id);
        Book book = wc.replaceHeader("Accept", "application/xml").query("id", 1L).get(Book.class);
        assertEquals("CXF", book.getName());
    }
   
    @Test
    public void testGetBookWebEx() throws Exception {
View Full Code Here

        String baseAddress = "http://localhost:" + PORT + "/the/thebooks8/books";
        WebClient wc = WebClient.create(baseAddress);
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
        Long id = wc.type("application/xml").accept("text/plain").post(new Book("CXF", 1L), Long.class);
        assertEquals(new Long(1), id);
        Book book = wc.replaceHeader("Accept", "application/xml").query("id", 1L).get(Book.class);
        assertEquals("CXF", book.getName());
    }
   
    @Test
    public void testGetBookWebEx() throws Exception {
View Full Code Here

        String baseAddress = "http://localhost:" + PORT + "/the/thebooks8/books";
        WebClient wc = WebClient.create(baseAddress);
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
        Long id = wc.type("application/xml").accept("text/plain").post(new Book("CXF", 1L), Long.class);
        assertEquals(new Long(1), id);
        Book book = wc.replaceHeader("Accept", "application/xml").query("id", 1L).get(Book.class);
        assertEquals("CXF", book.getName());
    }
   
    @Test
    public void testGetBookWebEx() throws Exception {
View Full Code Here

        String baseAddress = "http://localhost:" + PORT + "/the/thebooks8/books";
        WebClient wc = WebClient.create(baseAddress);
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
        Long id = wc.type("application/xml").accept("text/plain").post(new Book("CXF", 1L), Long.class);
        assertEquals(new Long(1), id);
        Book book = wc.replaceHeader("Accept", "application/xml").query("id", 1L).get(Book.class);
        assertEquals("CXF", book.getName());
    }
   
    @Test
    public void testGetBookWebEx() throws Exception {
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.