@Test(expectedExceptions = IllegalArgumentException.class) public void testAddUserToProjectNullAccount() { service.addUserToProject(mock(Project.class), null); }
public User addUserToProject(final Project project, final Account account, final Role... userRoles) { notNull(project, "project"); notNull(account, "account"); notEmpty(account.getUri(), "account.uri"); notNull(userRoles, "userRoles"); validateRoleURIs(userRoles); notEmpty(project.getId(), "project.id"); final User user = new User(account, userRoles); doPostProjectUsersUpdate(project, user); return getUser(project, account); }
ProjectService extends AbstractService { public User addUserToProject(final Project project, final Account account, final Role... userRoles) { notNull(project, "project"); notNull(account, "account"); notEmpty(account.getUri(), "account.uri"); notNull(userRoles, "userRoles"); validateRoleURIs(userRoles); notEmpty(project.getId(), "project.id"); final User user = new User(account, userRoles); doPostProjectUsersUpdate(project, user); return getUser(project, account); } }
ProjectService extends AbstractService { public User addUserToProject(final Project project, final Account account, final Role... userRoles) { notNull(project, "project"); notNull(account, "account"); notEmpty(account.getUri(), "account.uri"); notNull(userRoles, "userRoles"); validateRoleURIs(userRoles); notEmpty(project.getId(), "project.id"); final User user = new User(account, userRoles); doPostProjectUsersUpdate(project, user); return getUser(project, account); } ProjectService(final RestTemplate restTemplate, final AccountService accountService,
                          final GoodDataSettings settings); }
ProjectService extends AbstractService { public User addUserToProject(final Project project, final Account account, final Role... userRoles) { notNull(project, "project"); notNull(account, "account"); notEmpty(account.getUri(), "account.uri"); notNull(userRoles, "userRoles"); validateRoleURIs(userRoles); notEmpty(project.getId(), "project.id"); final User user = new User(account, userRoles); doPostProjectUsersUpdate(project, user); return getUser(project, account); } ProjectService(final RestTemplate restTemplate, final AccountService accountService,
                          final GoodDataSettings settings); @Deprecated Collection<Project> getProjects(); PageBrowser<Project> listProjects(); PageBrowser<Project> listProjects(final PageRequest startPage); FutureResult<Project> createProject(final Project project); Project getProjectByUri(final String uri); Project getProjectById(String id); void removeProject(final Project project); Collection<ProjectTemplate> getProjectTemplates(final Project project); Set<ProjectValidationType> getAvailableProjectValidationTypes(final Project project); FutureResult<ProjectValidationResults> validateProject(final Project project); FutureResult<ProjectValidationResults> validateProject(final Project project, ProjectValidationType... validations); FutureResult<ProjectValidationResults> validateProject(final Project project, Set<ProjectValidationType> validations); PageBrowser<User> listUsers(final Project project); PageBrowser<User> listUsers(final Project project, final PageRequest startPage); Set<Role> getRoles(final Project project); Role getRoleByUri(String uri); CreatedInvitations sendInvitations(final Project project, final Invitation... invitations); User getUser(final Project project, final Account account); User addUserToProject(final Project project, final Account account, final Role... userRoles); void updateUserInProject(final Project project, final User... users); }
ProjectService extends AbstractService { public User addUserToProject(final Project project, final Account account, final Role... userRoles) { notNull(project, "project"); notNull(account, "account"); notEmpty(account.getUri(), "account.uri"); notNull(userRoles, "userRoles"); validateRoleURIs(userRoles); notEmpty(project.getId(), "project.id"); final User user = new User(account, userRoles); doPostProjectUsersUpdate(project, user); return getUser(project, account); } ProjectService(final RestTemplate restTemplate, final AccountService accountService,
                          final GoodDataSettings settings); @Deprecated Collection<Project> getProjects(); PageBrowser<Project> listProjects(); PageBrowser<Project> listProjects(final PageRequest startPage); FutureResult<Project> createProject(final Project project); Project getProjectByUri(final String uri); Project getProjectById(String id); void removeProject(final Project project); Collection<ProjectTemplate> getProjectTemplates(final Project project); Set<ProjectValidationType> getAvailableProjectValidationTypes(final Project project); FutureResult<ProjectValidationResults> validateProject(final Project project); FutureResult<ProjectValidationResults> validateProject(final Project project, ProjectValidationType... validations); FutureResult<ProjectValidationResults> validateProject(final Project project, Set<ProjectValidationType> validations); PageBrowser<User> listUsers(final Project project); PageBrowser<User> listUsers(final Project project, final PageRequest startPage); Set<Role> getRoles(final Project project); Role getRoleByUri(String uri); CreatedInvitations sendInvitations(final Project project, final Invitation... invitations); User getUser(final Project project, final Account account); User addUserToProject(final Project project, final Account account, final Role... userRoles); void updateUserInProject(final Project project, final User... users); static final UriTemplate PROJECT_TEMPLATE; static final UriTemplate PROJECT_USERS_TEMPLATE; static final UriTemplate PROJECT_USER_TEMPLATE; static final UriTemplate LIST_PROJECTS_TEMPLATE; }