Examples of allowRoleToUser()


Examples of gwtappcontainer.testhelpers.MockGateKeeper.allowRoleToUser()

    }
   
    @Test
    public void adminCanAddUserAssignUnassignRole() {
      MockGateKeeper mockGateKeeper = new MockGateKeeper();
      mockGateKeeper.allowRoleToUser("test@example.com", Role.PORTAL_ADMIN);
      mockGateKeeper.allowRoleToUser("test@example.com", Role.DEVELOPER);
      AdminAPI api = new AdminAPI();
      api.setGateKeeper(mockGateKeeper);
     
      User user = UserServiceFactory.getUserService().getCurrentUser();
View Full Code Here

Examples of gwtappcontainer.testhelpers.MockGateKeeper.allowRoleToUser()

   
    @Test
    public void adminCanAddUserAssignUnassignRole() {
      MockGateKeeper mockGateKeeper = new MockGateKeeper();
      mockGateKeeper.allowRoleToUser("test@example.com", Role.PORTAL_ADMIN);
      mockGateKeeper.allowRoleToUser("test@example.com", Role.DEVELOPER);
      AdminAPI api = new AdminAPI();
      api.setGateKeeper(mockGateKeeper);
     
      User user = UserServiceFactory.getUserService().getCurrentUser();
     
View Full Code Here

Examples of gwtappcontainer.testhelpers.MockGateKeeper.allowRoleToUser()

    }
   
    @Test
    public void assigningExistingRoleGivesResourceAlreadyExistsError() {
      MockGateKeeper mockGateKeeper = new MockGateKeeper();
      mockGateKeeper.allowRoleToUser("test@example.com", Role.PORTAL_ADMIN);
      mockGateKeeper.allowRoleToUser("test@example.com", Role.DEVELOPER);
      AdminAPI api = new AdminAPI();
      api.setGateKeeper(mockGateKeeper);
     
      User user = UserServiceFactory.getUserService().getCurrentUser();
View Full Code Here

Examples of gwtappcontainer.testhelpers.MockGateKeeper.allowRoleToUser()

   
    @Test
    public void assigningExistingRoleGivesResourceAlreadyExistsError() {
      MockGateKeeper mockGateKeeper = new MockGateKeeper();
      mockGateKeeper.allowRoleToUser("test@example.com", Role.PORTAL_ADMIN);
      mockGateKeeper.allowRoleToUser("test@example.com", Role.DEVELOPER);
      AdminAPI api = new AdminAPI();
      api.setGateKeeper(mockGateKeeper);
     
      User user = UserServiceFactory.getUserService().getCurrentUser();
     
View Full Code Here

Examples of gwtappcontainer.testhelpers.MockGateKeeper.allowRoleToUser()

    }
   
    @Test
    public void unassigningNonExistantRoleGivesResourceNotFoundError() {
      MockGateKeeper mockGateKeeper = new MockGateKeeper();
      mockGateKeeper.allowRoleToUser("test@example.com", Role.PORTAL_ADMIN);
      mockGateKeeper.allowRoleToUser("test@example.com", Role.DEVELOPER);
      AdminAPI api = new AdminAPI();
      api.setGateKeeper(mockGateKeeper);
     
      User user = UserServiceFactory.getUserService().getCurrentUser();
View Full Code Here

Examples of gwtappcontainer.testhelpers.MockGateKeeper.allowRoleToUser()

   
    @Test
    public void unassigningNonExistantRoleGivesResourceNotFoundError() {
      MockGateKeeper mockGateKeeper = new MockGateKeeper();
      mockGateKeeper.allowRoleToUser("test@example.com", Role.PORTAL_ADMIN);
      mockGateKeeper.allowRoleToUser("test@example.com", Role.DEVELOPER);
      AdminAPI api = new AdminAPI();
      api.setGateKeeper(mockGateKeeper);
     
      User user = UserServiceFactory.getUserService().getCurrentUser();
     
View Full Code Here

Examples of gwtappcontainer.testhelpers.MockGateKeeper.allowRoleToUser()

    }
   
    @Test
    public void addingExistingEmailGivesResourceAlreadyExistsError() {
      MockGateKeeper mockGateKeeper = new MockGateKeeper();
      mockGateKeeper.allowRoleToUser("test@example.com", Role.PORTAL_ADMIN);
      AdminAPI api = new AdminAPI();
      api.setGateKeeper(mockGateKeeper);
     
      User user = UserServiceFactory.getUserService().getCurrentUser();
     
View Full Code Here

Examples of gwtappcontainer.testhelpers.MockGateKeeper.allowRoleToUser()

      //3. rename a role and ensure the entity in datastore is updated
      //4. delete the role and ensure it is deleted from datastore
     
      //1. create a gatekeeper and assign test@example.com as developer
    MockGateKeeper mockGateKeeper = new MockGateKeeper();
    mockGateKeeper.allowRoleToUser("test@example.com", Role.DEVELOPER);
   
      AdminAPI api = new AdminAPI();     
      api.setGateKeeper(mockGateKeeper);
     
      //2. add a role and ensure it is present
View Full Code Here

Examples of gwtappcontainer.testhelpers.MockGateKeeper.allowRoleToUser()

 
  @Test
  public void loginNotRequiredToViewRoles() {
    //1. create a gatekeeper that allows developer
    MockGateKeeper mockGateKeeper = new MockGateKeeper();
    mockGateKeeper.allowRoleToUser("test@example.com", Role.DEVELOPER);
      AdminAPI api = new AdminAPI();
      api.setGateKeeper(mockGateKeeper);
     
      User user = UserServiceFactory.getUserService().getCurrentUser();
      String role = "dummy_" + UUID.randomUUID();
View Full Code Here

Examples of gwtappcontainer.testhelpers.MockGateKeeper.allowRoleToUser()

      //3. rename a role and ensure it gives status code as insufficient permission
    //3. delete a role and ensure it gives status code as insufficient permission
     
      //1. create a gatekeeper that allows developer
    MockGateKeeper mockGateKeeper = new MockGateKeeper();
    mockGateKeeper.allowRoleToUser("test@example.com", Role.PORTAL_ADMIN);
      AdminAPI api = new AdminAPI();
      api.setGateKeeper(mockGateKeeper);
     
      //2. add a role
      User user = UserServiceFactory.getUserService().getCurrentUser();
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.