Package org.apache.camel.component.cxf.jaxrs.simplebinding.testbean

Examples of org.apache.camel.component.cxf.jaxrs.simplebinding.testbean.CustomerList


                from("direct:listVipCustomers").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        assertEquals("gold", exchange.getIn().getHeader("status", String.class));
                        assertEquals(MessageContentsList.class, exchange.getIn().getBody().getClass());
                        assertEquals(0, exchange.getIn().getBody(MessageContentsList.class).size());
                        CustomerList response = new CustomerList();
                        List<Customer> list = new ArrayList<Customer>(2);
                        list.add(new Customer(123, "Raul"));
                        list.add(new Customer(456, "Raul2"));
                        response.setCustomers(list);
                        exchange.getOut().setBody(response);
                    }
                });
               
                from("direct:updateVipCustomer").process(new Processor() {
View Full Code Here


        HttpGet get = new HttpGet("http://localhost:" + PORT_PATH + "/rest/customerservice/customers/vip/gold");
        get.addHeader("Content-Type", "text/xml");
        get.addHeader("Accept", "text/xml");
        HttpResponse response = httpclient.execute(get);
        assertEquals(200, response.getStatusLine().getStatusCode());
        CustomerList cl = (CustomerList) jaxb.createUnmarshaller().unmarshal(new StringReader(EntityUtils.toString(response.getEntity())));
        List<Customer> vips = cl.getCustomers();
        assertEquals(2, vips.size());
        assertEquals(123, vips.get(0).getId());
        assertEquals(456, vips.get(1).getId());
    }
View Full Code Here

                from("direct:listVipCustomers").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        assertEquals("gold", exchange.getIn().getHeader("status", String.class));
                        assertEquals(MessageContentsList.class, exchange.getIn().getBody().getClass());
                        assertEquals(0, exchange.getIn().getBody(MessageContentsList.class).size());
                        CustomerList response = new CustomerList();
                        List<Customer> list = new ArrayList<Customer>(2);
                        list.add(new Customer(123, "Raul"));
                        list.add(new Customer(456, "Raul2"));
                        response.setCustomers(list);
                        exchange.getOut().setBody(response);
                    }
                });
               
                from("direct:updateVipCustomer").process(new Processor() {
View Full Code Here

        HttpGet get = new HttpGet("http://localhost:" + PORT_PATH + "/rest/customerservice/customers/vip/gold");
        get.addHeader("Content-Type", "text/xml");
        get.addHeader("Accept", "text/xml");
        HttpResponse response = httpclient.execute(get);
        assertEquals(200, response.getStatusLine().getStatusCode());
        CustomerList cl = (CustomerList) jaxb.createUnmarshaller().unmarshal(new StringReader(EntityUtils.toString(response.getEntity())));
        List<Customer> vips = (List<Customer>) cl.getCustomers();
        assertEquals(2, vips.size());
        assertEquals(123, vips.get(0).getId());
        assertEquals(456, vips.get(1).getId());
    }
View Full Code Here

                from("direct:listVipCustomers").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        assertEquals("gold", exchange.getIn().getHeader("status", String.class));
                        assertEquals(MessageContentsList.class, exchange.getIn().getBody().getClass());
                        assertEquals(0, exchange.getIn().getBody(MessageContentsList.class).size());
                        CustomerList response = new CustomerList();
                        List<Customer> list = new ArrayList<Customer>(2);
                        list.add(new Customer(123, "Raul"));
                        list.add(new Customer(456, "Raul2"));
                        response.setCustomers(list);
                        exchange.getOut().setBody(response);
                    }
                });
               
                from("direct:updateVipCustomer").process(new Processor() {
View Full Code Here

        HttpGet get = new HttpGet("http://localhost:" + PORT_PATH + "/rest/customerservice/customers/vip/gold");
        get.addHeader("Content-Type", "text/xml");
        get.addHeader("Accept", "text/xml");
        HttpResponse response = httpclient.execute(get);
        assertEquals(200, response.getStatusLine().getStatusCode());
        CustomerList cl = (CustomerList) jaxb.createUnmarshaller().unmarshal(new StringReader(EntityUtils.toString(response.getEntity())));
        List<Customer> vips = cl.getCustomers();
        assertEquals(2, vips.size());
        assertEquals(123, vips.get(0).getId());
        assertEquals(456, vips.get(1).getId());
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.component.cxf.jaxrs.simplebinding.testbean.CustomerList

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.