Package play.test

Examples of play.test.FakeRequest.withHeader()


          String sFakeCollection = new AdminCollectionFunctionalTest().routeCreateCollection();
       
          // Test list documents in empty collection
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress(sFakeCollection));
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          request = request.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
          Result result = routeAndCall(request);
          assertRoute(result, "testRouteListDocuments empty collection", Status.OK, null, false);
         
          result = routeCreateDocument(getRouteAddress(sFakeCollection));
View Full Code Here


       
          // Test list documents in empty collection
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress(sFakeCollection));
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          request = request.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
          Result result = routeAndCall(request);
          assertRoute(result, "testRouteListDocuments empty collection", Status.OK, null, false);
         
          result = routeCreateDocument(getRouteAddress(sFakeCollection));
          assertRoute(result, "testRouteListDocuments CREATE document in fake collection", Status.OK, null, true);
View Full Code Here

          result = routeCreateDocument(getRouteAddress(sFakeCollection));
          assertRoute(result, "testRouteListDocuments CREATE document in fake collection", Status.OK, null, true);
         
          // Test list documents in empty collection
          request = new FakeRequest(getMethod(), getRouteAddress(sFakeCollection));
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          request = request.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
          result = routeAndCall(request);
          assertRoute(result, "testRouteListDocuments not empty collection", Status.OK, null, true);
        }
View Full Code Here

          assertRoute(result, "testRouteListDocuments CREATE document in fake collection", Status.OK, null, true);
         
          // Test list documents in empty collection
          request = new FakeRequest(getMethod(), getRouteAddress(sFakeCollection));
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          request = request.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
          result = routeAndCall(request);
          assertRoute(result, "testRouteListDocuments not empty collection", Status.OK, null, true);
        }
      }
View Full Code Here

         
          // Test list documents in empty collection
          request = new FakeRequest(getMethod(), getRouteAddress(sFakeCollection));
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          request = request.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
          result = routeAndCall(request);
          assertRoute(result, "testRouteListDocuments not empty collection", Status.OK, null, true);
        }
      }
    );
View Full Code Here

      new Runnable()
      {
        public void run()
        {
          FakeRequest request = new FakeRequest(getMethod(), SERVICE_ROUTE + COLLECTION_NOT_EXIST);
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          request = request.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
          Result result = routeAndCall(request);
          assertRoute(result, "testRouteListDocumentsBadCollection", Status.NOT_FOUND, TestConfig.MSG_INVALID_COLLECTION, true);
        }
View Full Code Here

      {
        public void run()
        {
          FakeRequest request = new FakeRequest(getMethod(), SERVICE_ROUTE + COLLECTION_NOT_EXIST);
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          request = request.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
          Result result = routeAndCall(request);
          assertRoute(result, "testRouteListDocumentsBadCollection", Status.NOT_FOUND, TestConfig.MSG_INVALID_COLLECTION, true);
        }
      }
View Full Code Here

        public void run()
        {
          FakeRequest request = new FakeRequest(getMethod(), SERVICE_ROUTE + COLLECTION_NOT_EXIST);
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          request = request.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
          Result result = routeAndCall(request);
          assertRoute(result, "testRouteListDocumentsBadCollection", Status.NOT_FOUND, TestConfig.MSG_INVALID_COLLECTION, true);
        }
      }
    );
View Full Code Here

        public void run()
        {

          //Anonymous user looking for a non existent collection
          FakeRequest request = new FakeRequest(GET, getRouteAddress("PIPPOPLUTO"));
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
          Result result = routeAndCall(request);
          assertRoute(result, "testAccessDocumentsWithoutAuth.not_exists", Status.NOT_FOUND, null, false);
         
          //Admin creates a collection         
View Full Code Here

        {

          //Anonymous user looking for a non existent collection
          FakeRequest request = new FakeRequest(GET, getRouteAddress("PIPPOPLUTO"));
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);
          Result result = routeAndCall(request);
          assertRoute(result, "testAccessDocumentsWithoutAuth.not_exists", Status.NOT_FOUND, null, false);
         
          //Admin creates a collection         
          String sFakeCollection = new AdminCollectionFunctionalTest().routeCreateCollection();   
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.