Package org.jboss.resteasy.cdi.interceptors

Examples of org.jboss.resteasy.cdi.interceptors.Book


  {
     log.info("starting testInterceptors()");
    
      // Create book.
      ClientRequest request = new ClientRequest("http://localhost:8080/resteasy-cdi-ejb-test/rest/create/");
      Book book = new Book("RESTEasy: the Sequel");
      Type genericType = (new GenericType<Book>() {}).getGenericType();
      request.body(Constants.MEDIA_TYPE_TEST_XML_TYPE, book, genericType);
      ClientResponse<?> response = request.post();
      log.info("Status: " + response.getStatus());
      assertEquals(200, response.getStatus());
      int id = response.getEntity(int.class);
      log.info("id: " + id);
      Assert.assertEquals(0, id);
     
      // Retrieve book.
      request = new ClientRequest("http://localhost:8080/resteasy-cdi-ejb-test/rest/book/" + id);
      request.accept(Constants.MEDIA_TYPE_TEST_XML);
      response = request.get();
      log.info("Status: " + response.getStatus());
      assertEquals(200, response.getStatus());
      Book result = response.getEntity(Book.class);
      log.info("book: " + book);
      Assert.assertEquals(book, result);
     
     request = new ClientRequest("http://localhost:8080/resteasy-cdi-ejb-test/rest/test/");
     response = request.post();
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.cdi.interceptors.Book

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.