Package play.test

Examples of play.test.FakeRequest.withHeader()


                                    assertRoute(result, "testRoleCreate.role_not_found", Status.NOT_FOUND, null, false);
                                        
                                    //checks that the fake user belongs to the registered role
                                     sFakeCheckUser = getFakeUserAddress();
                                    requestCreation = new FakeRequest(GET, sFakeCheckUser);
                                    requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                    requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                    result = route(requestCreation);
                                    assertRoute(result, "testRoleCreate.checkUser", Status.OK, "\"name\":\"registered\"", true);
                                   
                                   
View Full Code Here


                                        
                                    //checks that the fake user belongs to the registered role
                                     sFakeCheckUser = getFakeUserAddress();
                                    requestCreation = new FakeRequest(GET, sFakeCheckUser);
                                    requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                    requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                    result = route(requestCreation);
                                    assertRoute(result, "testRoleCreate.checkUser", Status.OK, "\"name\":\"registered\"", true);
                                   
                                   
                                    //tries to recreate the same role, now with description
View Full Code Here

                                    assertRoute(result, "testRoleCreate.checkUser", Status.OK, "\"name\":\"registered\"", true);
                                   
                                   
                                    //tries to recreate the same role, now with description
                                        requestCreation = new FakeRequest(POST, sFakeRole);
                                        requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                        requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                        mapper = new ObjectMapper();
                                        actualObj = mapper.readTree("{\"description\":\"this is a test\"}")
                                        requestCreation = requestCreation.withJsonBody(actualObj);
                                        requestCreation = requestCreation.withHeader("Content-Type", "application/json");
View Full Code Here

                                   
                                   
                                    //tries to recreate the same role, now with description
                                        requestCreation = new FakeRequest(POST, sFakeRole);
                                        requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                        requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                        mapper = new ObjectMapper();
                                        actualObj = mapper.readTree("{\"description\":\"this is a test\"}")
                                        requestCreation = requestCreation.withJsonBody(actualObj);
                                        requestCreation = requestCreation.withHeader("Content-Type", "application/json");
                                        result = route(requestCreation);
View Full Code Here

                                        requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                        requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                        mapper = new ObjectMapper();
                                        actualObj = mapper.readTree("{\"description\":\"this is a test\"}")
                                        requestCreation = requestCreation.withJsonBody(actualObj);
                                        requestCreation = requestCreation.withHeader("Content-Type", "application/json");
                                        result = route(requestCreation);
                                        assertRoute(result, "testRoleCreate.create_the_same", Status.CREATED, null, true);
                                    //checks the role
                                    requestCreation = new FakeRequest(GET, sFakeRole);
View Full Code Here

                                        result = route(requestCreation);
                                        assertRoute(result, "testRoleCreate.create_the_same", Status.CREATED, null, true);
                                    //checks the role
                                    requestCreation = new FakeRequest(GET, sFakeRole);
                                    requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                    requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                    result = route(requestCreation);
                                    assertRoute(result, "testRoleCreate.check_with_desc", Status.OK, "\"description\":\"this is a test\"", true);
                                                                        
                                    //updates the role name and description
View Full Code Here

                                        assertRoute(result, "testRoleCreate.create_the_same", Status.CREATED, null, true);
                                    //checks the role
                                    requestCreation = new FakeRequest(GET, sFakeRole);
                                    requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                    requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                    result = route(requestCreation);
                                    assertRoute(result, "testRoleCreate.check_with_desc", Status.OK, "\"description\":\"this is a test\"", true);
                                                                        
                                    //updates the role name and description
                             
View Full Code Here

                                    assertRoute(result, "testRoleCreate.check_with_desc", Status.OK, "\"description\":\"this is a test\"", true);
                                                                        
                                    //updates the role name and description
                             
                                     requestCreation = new FakeRequest(PUT, sFakeRole);
                                         requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                         requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                         mapper = new ObjectMapper();
                                         actualObj = mapper.readTree("{\"description\":\"this is new test\"}")
                                         requestCreation = requestCreation.withJsonBody(actualObj,PUT);
                                         result = route(requestCreation);
View Full Code Here

                                                                        
                                    //updates the role name and description
                             
                                     requestCreation = new FakeRequest(PUT, sFakeRole);
                                         requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                         requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                         mapper = new ObjectMapper();
                                         actualObj = mapper.readTree("{\"description\":\"this is new test\"}")
                                         requestCreation = requestCreation.withJsonBody(actualObj,PUT);
                                         result = route(requestCreation);
                                         assertRoute(result, "testRoleCreate.update_desc", Status.OK, null, true);
View Full Code Here

                                         assertRoute(result, "testRoleCreate.update_desc", Status.OK, null, true);
                                        
                                                                            
                                    //checks the role
                                         requestCreation = new FakeRequest(GET, sFakeRole);
                                     requestCreation = requestCreation.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE);
                                     requestCreation = requestCreation.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
                                     result = route(requestCreation);
                                     assertRoute(result, "testRoleCreate.check_with_new_desc", Status.OK, "\"description\":\"this is new test\"", true);
                                      
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.