Package org.jboss.seam.mock.ResourceRequestEnvironment

Examples of org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest


   }

   @Test(dataProvider = "query")
   public void getCategoryListTest(final String contentType, final String expectedResponse) throws Exception
   {
      new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/v1/auth/category")
      {

         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
View Full Code Here


   }

   @Test
   public void deleteCategoryTest() throws Exception
   {
      new ResourceRequest(new ResourceRequestEnvironment(this), Method.DELETE, "/v1/auth/category/Work")
      {

         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
View Full Code Here

     
      final String uri = "/v1/auth/category/Test%20Category";
      final String mimeType = "application/json";
      final String expectedResponse = "{\"category\":{\"name\":\"Test Category\"}}";
     
      new ResourceRequest(new ResourceRequestEnvironment(this), Method.PUT, uri)
      {

         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
            super.prepareRequest(request);
            request.addHeader("Authorization", "Basic ZGVtbzpkZW1v"); // demo:demo
         }

         @Override
         protected void onResponse(EnhancedMockHttpServletResponse response)
         {
            super.onResponse(response);
            assertEquals(response.getStatus(), 201, "Unexpected response code.");
         }

      }.run();

      new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, uri)
      {

         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
View Full Code Here

   }

   @Test
   public void noAuthorizationHeaderTest() throws Exception
   {
      new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/v1/auth/category")
      {

         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
View Full Code Here

TOP

Related Classes of org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest

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.