Package gwtappcontainer.shared.apis

Examples of gwtappcontainer.shared.apis.APIResponse


    User user = userService.getCurrentUser();
    assertTrue(user != null);
    assertTrue(user.getEmail().equals(helper.getEmail()))
   
    SecurityAPI api = new SecurityAPI();
    APIResponse response = api.getUser(helper.getEmail());
    assertTrue(response.object == null);       
  }
View Full Code Here


    User user = userService.getCurrentUser();
    assertTrue(user != null);
    assertTrue(user.getEmail().equals(helper.getEmail()));   
   
    SecurityAPI api = new SecurityAPI();
    APIResponse response = api.getUser(helper.getEmail());
    assertTrue(response.object != null);
  }
View Full Code Here

    User user = userService.getCurrentUser();
    assertTrue(user != null);
    assertTrue(user.getEmail().equals(helper.getEmail()));   
   
    SecurityAPI api = new SecurityAPI();
    APIResponse response = api.getUser(helper.getEmail());
    UserProp prop = (UserProp) response.object;
    assertTrue(prop.email.equals(helper.getEmail()));
   
    assertTrue(prop.privileges.contains("TEST"));
   
View Full Code Here

  @Test
  public void addPrivilegeTest() {
    SecurityAPI api = new SecurityAPI();
   
    //should have the right privilege
    APIResponse response = api.addPrivilege("test", null);
    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
   
    response = api.addPrivilege("test", helper.loginAsInvalidUser());
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test
  public void deletePrivilegeTest() {
    SecurityAPI api = new SecurityAPI();
   
    APIResponse response = api.addPrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
   
    //should have the right privilege
    response = api.deletePrivilege("test", null);
    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
View Full Code Here

    SecurityAPI api = new SecurityAPI();
    TreeSet<String> allPrivileges = (TreeSet<String>) api.getAllPrivileges().object;
   
    assertTrue(allPrivileges.size() == 0);
   
    @SuppressWarnings("unused")
    APIResponse response = api.addPrivilege("abc", helper.loginAsSuperUser());         
    response = api.addPrivilege("xyz", helper.loginAsSuperUser());   
    response = api.addPrivilege("ishaprivilege", helper.loginAsSuperUser());   
   
    allPrivileges = (TreeSet<String>) api.getAllPrivileges().object;       
View Full Code Here

  @Test
  public void addRoleTest() {
    SecurityAPI api = new SecurityAPI();
   
    //should have the right privilege
    APIResponse response = api.addRole("test", null);
    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
   
    response = api.addRole("test", helper.loginAsInvalidUser());
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test
  public void deleteRoleTest() {
    SecurityAPI api = new SecurityAPI();
   
    APIResponse response = api.addRole("test",
        helper.loginWithPrivilege(Privileges.EDIT_ROLE));
   
    //should have the right privilege
    response = api.deleteRole("test", null);
    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test
  public void assignPrivilegeToRoleTest() {
    SecurityAPI api = new SecurityAPI();
   
    APIResponse response = api.addPrivilege("testprivilege",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
    assertTrue(response.statusCode == Status.SUCCESS);
   
    response = api.addRole("testrole",
        helper.loginWithPrivilege(Privileges.EDIT_ROLE));
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test
  public void unassignPrivilegeToRoleTest() {
    SecurityAPI api = new SecurityAPI();
   
    APIResponse response = api.addPrivilege("testprivilege",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
    assertTrue(response.statusCode == Status.SUCCESS);
   
    response = api.addRole("testrole",
        helper.loginWithPrivilege(Privileges.EDIT_ROLE));
View Full Code Here

TOP

Related Classes of gwtappcontainer.shared.apis.APIResponse

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.