Package com.google.appengine.api.users

Examples of com.google.appengine.api.users.User


        assertEquals("loginURL?gwt.codesvr=127.0.0.1:9997", loginDto.getLoginUrl());
    }

    @Test
    public void testLogin_NewUser() {
        User googleUser = new User("vleushin@gmail.com", "gmail.com", "1234567890");
        when(userService.getCurrentUser()).thenReturn(googleUser);
        when(userDao.getByUserAuthID("1234567890")).thenReturn(null);
        when(userService.createLogoutURL("requestUri")).thenReturn("logoutURL");
        when(userService.isUserAdmin()).thenReturn(false);
        LoginDto loginDto = userManagementService.login("requestUri", "en");
View Full Code Here


        assertEquals(0, loginDto.getRoles().size());
    }

    @Test
    public void testLogin_ExistingUser() {
        User googleUser = new User("vleushin@gmail.com", "gmail.com", "1234567890");
        when(userService.getCurrentUser()).thenReturn(googleUser);
        lv.odylab.evemanage.domain.user.User user = new lv.odylab.evemanage.domain.user.User();
        user.setId(1L);
        user.setUserAuthID("1234567890");
        user.setAuthDomain("gmail.com");
View Full Code Here

        assertEquals(user, userManagementService.getUser(userKey));
    }

    @Test
    public void testGetCurrentUserKey() {
        User googleUser = new User("vleushin@gmail.com", "gmail.com", "1234567890");
        when(userService.getCurrentUser()).thenReturn(googleUser);
        Key<lv.odylab.evemanage.domain.user.User> userKey = new Key<lv.odylab.evemanage.domain.user.User>(lv.odylab.evemanage.domain.user.User.class, 1);
        when(userDao.geKeyByUserAuthID("1234567890")).thenReturn(userKey);
        assertEquals(userKey, userManagementService.getCurrentUserKey());
    }
View Full Code Here

      entity.setProperty("Long", new Long(RandomUtils.nextLong()));
      entity.setProperty("Boolean", new Boolean(RandomUtils.nextBoolean()));
      entity.setProperty("Float", new Float(RandomUtils.nextFloat()));
      entity.setProperty("Double", new Double(RandomUtils.nextDouble()));
      entity.setProperty("Date", new Date(RandomUtils.nextLong()));
      entity.setProperty("User", new User("test@example", "google.com"));
      entity.setProperty("Key", KeyFactory.createKey("test", RandomStringUtils
        .randomAlphabetic(5)));
      entity.setProperty("Category", new Category(RandomStringUtils.randomAlphabetic(3)));
      entity.setProperty("Email", new Email("test@example"));
      entity.setProperty("GeoPt", new GeoPt(new Float(new Integer(RandomStringUtils
View Full Code Here

    helper.loginAsDeveloper();
   
    ContentAPI api = new ContentAPI();
    String tag = "tag_" + UUID.randomUUID();
   
    User user = UserServiceFactory.getUserService().getCurrentUser();
    APIResponse resp = api.addNewTag(tag, user);
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    resp = api.getAllTags();
    assertTrue(resp.statusCode == Status.SUCCESS);
View Full Code Here

    String tag = "tag_" + UUID.randomUUID();
    addNewTag(tag);
     
    //assign this tag to user
    helper.loginAsPortalAdmin();
    User user = UserServiceFactory.getUserService().getCurrentUser();
    ContentAPI contentApi = new ContentAPI();
    APIResponse resp = contentApi.assignUserAsContentAdmin(email,
        tag, user);
    assertTrue(resp.statusCode == Status.SUCCESS);
   
View Full Code Here

    APIResponse resp = api.assignUserAsContentAdmin(email, tag,
        helper.loginAsPortalAdmin());
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    String content = "dummy content";
    User user = helper.loginAs(email);
    resp = api.setContent(content, tag, true, user);
   
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    //ensure content can be retrieved
View Full Code Here

    addNewTag(tag);
       
    ContentAPI api = new ContentAPI();
       
    String content = "dummy content";
    User user = helper.loginAsPortalAdmin();
    APIResponse resp = api.setContent(content, tag, false, user);
   
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    //ensure content can be retrieved
View Full Code Here

    StringBuilder content = new StringBuilder();
    for (int i = 0; i < 255; i++) {
      content.append("1");
    }
           
    User user = helper.loginAsPortalAdmin();
    APIResponse resp = api.setContent(content.toString(),
        tag, true, helper.loginAsPortalAdmin());
   
    resp = api.setLargeContent(tag, true,
        content.toString(), content.toString(), content.toString(),
View Full Code Here

    addNewTag(tag);
       
    ContentAPI api = new ContentAPI();
       
    String content = "dummy content";
    User user = helper.loginAsPortalReadOnly();
       
    APIResponse resp = api.setContent(content, tag, false, user);
    assertTrue(resp.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);   
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.users.User

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.