Examples of GitlabUser


Examples of org.gitlab.api.models.GitlabUser

    public void testCreateUpdateDeleteUser() throws IOException {
     
      String password = randVal("$%password");
     

      GitlabUser gitUser = _api.createUser(randVal("testEmail@gitlabapitest.com"),
                        password,
                        randVal("userName"),
                        randVal("fullName"),
                        randVal("skypeId"),
                        randVal("linledin"),
                        randVal("twitter"),
                        "http://"+randVal("url.com"),
                        10,
                        randVal("externuid"),
                        randVal("externprovidername"),
                        randVal("bio"),
                        false,
                        false,
                        false);
      Assert.assertNotNull(gitUser);
     
      GitlabUser refetched = _api.getUserViaSudo(gitUser.getUsername());
     
      Assert.assertNotNull(refetched);
     
      Assert.assertEquals(refetched.getUsername(),gitUser.getUsername());
     
      _api.updateUser(gitUser.getId(), gitUser.getEmail(), password , gitUser.getUsername(),
          gitUser.getName(), "newSkypeId", gitUser.getLinkedin(), gitUser.getTwitter(), gitUser.getWebsiteUrl(),
          10 /* project limit does not come back on GET */, gitUser.getExternUid(), gitUser.getExternProviderName(),
          gitUser.getBio(), gitUser.isAdmin(), gitUser.isCanCreateGroup(), false);
     
     
      GitlabUser postUpdate = _api.getUserViaSudo(gitUser.getUsername());
     
     
      Assert.assertNotNull(postUpdate);
      Assert.assertEquals(postUpdate.getSkype(),"newSkypeId");
     
     
      _api.deleteUser(postUpdate.getId());
     
      // expect a 404, but we have no access to it
      try {
        GitlabUser shouldNotExist = _api.getUser(postUpdate.getId());
        Assert.assertNull(shouldNotExist); // should never even get here
       
      } catch(FileNotFoundException thisIsSoOddForAnRESTApiClient) {
        Assert.assertTrue(true); // expected
      }
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.