Package play.test

Examples of play.test.FakeRequest.withHeader()


      {
        public void run()
        {
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress() + "?where=user.name like \"user%25\" and user.name.length() = 5 and visibleByFriend.key = \"value\"&orderBy=user.signUpDate asc");
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          Result result = routeAndCall(request);
          assertRoute(result, "RouteOK Admin user", Status.OK, null, false);
         
        }
      }
View Full Code Here


      new Runnable()
      {
        public void run()
        {
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress() + "?fields=user.name");
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          Result result = routeAndCall(request);
          assertRoute(result, "RouteOK Admin user", Status.OK, null, false);
         
        }
View Full Code Here

      {
        public void run()
        {
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress() + "?fields=user.name");
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          Result result = routeAndCall(request);
          assertRoute(result, "RouteOK Admin user", Status.OK, null, false);
         
        }
      }
View Full Code Here

      {
        public void run()
        {
          // Default user credentials
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, "BASIC");
          Result result = routeAndCall(request);
          assertRoute(result, "testMalformedBasicAuthHeader", UNAUTHORIZED, null, false);
        }
      }
View Full Code Here

        public void run()
        {
          // Default user credentials
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, "BASIC");
          Result result = routeAndCall(request);
          assertRoute(result, "testMalformedBasicAuthHeader", UNAUTHORIZED, null, false);
        }
      }
    );
View Full Code Here

      {
        public void run()
        {
          // Default user credentials
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_DEFAULT_ENC);
          Result result = routeAndCall(request);
          assertRoute(result, "testRouteDefaultUser", FORBIDDEN, null, false);
        }
      }
View Full Code Here

        public void run()
        {
          // Default user credentials
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_DEFAULT_ENC);
          Result result = routeAndCall(request);
          assertRoute(result, "testRouteDefaultUser", FORBIDDEN, null, false);
        }
      }
    );   
View Full Code Here

      {
        public void run()
        {
          // Default user credentials
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          Result result = routeAndCall(request);
          assertRoute(result, "testRouteAdminUser", UNAUTHORIZED, null, false);
        }
      }
View Full Code Here

                new Runnable()  {
                            public void run()       {
                                    try {
                                       String sFakeRole = getRouteAddress();
                                         FakeRequest requestCreation = new FakeRequest(POST, sFakeRole);
                                         requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                         requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                         Result result = route(requestCreation);
                                         assertRoute(result, "testRoleCreate.create", Status.CREATED, null, true);
                                        
                                        //creates one user in this Role
View Full Code Here

        public void run()
        {
          // Default user credentials
          FakeRequest request = new FakeRequest(getMethod(), getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
          Result result = routeAndCall(request);
          assertRoute(result, "testRouteAdminUser", UNAUTHORIZED, null, false);
        }
      }
    );   
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.