use of com.synopsys.integration.blackduck.api.manual.temporary.component.UserGroupRequest 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