Package play.test

Examples of play.test.FakeRequest.withHeader()


          JsonNode jsonRes = Json.parse(body);
          String token = jsonRes.get("data").get(SessionKeys.TOKEN.toString()).textValue();
         
          //test if the user can execute a GET on himself
          request = new FakeRequest(GET, getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_TOKEN, token);
          result = route(request);
          assertRoute(result, "routeCreateUser_check", Status.OK, null, false);
         
          //now we suspend it
View Full Code Here


          String token = jsonRes.get("data").get(SessionKeys.TOKEN.toString()).textValue();
         
          //test if the user can execute a GET on himself
          request = new FakeRequest(GET, getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_TOKEN, token);
          result = route(request);
          assertRoute(result, "routeCreateUser_check", Status.OK, null, false);
         
          //now we suspend it
          request = new FakeRequest(PUT, getRouteAddress()+"/suspend");
View Full Code Here

          result = route(request);
          assertRoute(result, "routeCreateUser_check", Status.OK, null, false);
         
          //now we suspend it
          request = new FakeRequest(PUT, getRouteAddress()+"/suspend");
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_TOKEN, token);
          result = route(request);
          assertRoute(result, "routeCreateUser_suspend", Status.OK, null, false);
         
          //test if the user can execute a GET on himself
View Full Code Here

          assertRoute(result, "routeCreateUser_check", Status.OK, null, false);
         
          //now we suspend it
          request = new FakeRequest(PUT, getRouteAddress()+"/suspend");
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_TOKEN, token);
          result = route(request);
          assertRoute(result, "routeCreateUser_suspend", Status.OK, null, false);
         
          //test if the user can execute a GET on himself
          request = new FakeRequest(GET, getRouteAddress());
View Full Code Here

          result = route(request);
          assertRoute(result, "routeCreateUser_suspend", Status.OK, null, false);
         
          //test if the user can execute a GET on himself
          request = new FakeRequest(GET, getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_TOKEN, token);
          result = route(request);
          assertRoute(result, "routeCreateUser_check_2", Status.UNAUTHORIZED, null, false);       
         
          //now the admin reactivate him
View Full Code Here

          assertRoute(result, "routeCreateUser_suspend", Status.OK, null, false);
         
          //test if the user can execute a GET on himself
          request = new FakeRequest(GET, getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_TOKEN, token);
          result = route(request);
          assertRoute(result, "routeCreateUser_check_2", Status.UNAUTHORIZED, null, false);       
         
          //now the admin reactivate him
          request = new FakeRequest(PUT, "/admin/user/activate/" + sFakeUser);
View Full Code Here

          result = route(request);
          assertRoute(result, "routeCreateUser_check_2", Status.UNAUTHORIZED, null, false);       
         
          //now the admin reactivate him
          request = new FakeRequest(PUT, "/admin/user/activate/" + sFakeUser);
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.encodeAuth(TestConfig.AUTH_ADMIN));
          result = route(request);
          assertRoute(result, "routeCreateUser_activate", Status.OK, null, false);
         
          //the user should can connect again
View Full Code Here

          assertRoute(result, "routeCreateUser_check_2", Status.UNAUTHORIZED, null, false);       
         
          //now the admin reactivate him
          request = new FakeRequest(PUT, "/admin/user/activate/" + sFakeUser);
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.encodeAuth(TestConfig.AUTH_ADMIN));
          result = route(request);
          assertRoute(result, "routeCreateUser_activate", Status.OK, null, false);
         
          //the user should can connect again
          request = new FakeRequest(GET, getRouteAddress());
View Full Code Here

          result = route(request);
          assertRoute(result, "routeCreateUser_activate", Status.OK, null, false);
         
          //the user should can connect again
          request = new FakeRequest(GET, getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_TOKEN, token);
          result = route(request);
          assertRoute(result, "routeCreateUser_check_3", Status.OK, null, false)
         
          //now the admin suspend him again
View Full Code Here

          assertRoute(result, "routeCreateUser_activate", Status.OK, null, false);
         
          //the user should can connect again
          request = new FakeRequest(GET, getRouteAddress());
          request = request.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
          request = request.withHeader(TestConfig.KEY_TOKEN, token);
          result = route(request);
          assertRoute(result, "routeCreateUser_check_3", Status.OK, null, false)
         
          //now the admin suspend him again
          request = new FakeRequest(PUT, "/admin/user/suspend/" + sFakeUser);
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.