use of com.synopsys.integration.blackduck.api.generated.view.UserGroupView in project blackduck-common by blackducksoftware.
the class UserGroupService method createUserGroup.
public UserGroupView createUserGroup(UserGroupRequest userGroupRequest) throws IntegrationException {
HttpUrl userGroupUrl = blackDuckApiClient.post(apiDiscovery.metaUsergroupsLink().getUrl(), userGroupRequest);
UserGroupView userGroupView = blackDuckApiClient.getResponse(userGroupUrl, UserGroupView.class);
return userGroupView;
}
use of com.synopsys.integration.blackduck.api.generated.view.UserGroupView in project blackduck-common by blackducksoftware.
the class UserServiceTestIT method testAddingGroupToProject.
@Test
public void testAddingGroupToProject() throws IntegrationException {
String userGroupName = "user-group-test" + System.currentTimeMillis();
ProjectView projectView = null;
UserGroupView userGroupView = null;
try {
projectView = createProjectView();
UserGroupRequest userGroupRequest = new UserGroupRequest();
userGroupRequest.setName(userGroupName);
userGroupView = userGroupService.createUserGroup(userGroupRequest);
List<UserGroupView> projectGroups = projectUsersService.getGroupsForProject(projectView);
assertFalse(projectGroups.contains(userGroupView));
projectUsersService.addGroupToProject(projectView, userGroupName);
projectGroups = projectUsersService.getGroupsForProject(projectView);
assertTrue(projectGroups.contains(userGroupView));
} finally {
deleteView(projectView);
deleteView(userGroupView);
}
}
Aggregations