.setEnabled(true);
db.componentDao().insert(dbSession, project1);
db.componentDao().insert(dbSession, project2);
// Create a user having user permission on the two projects and the global quality profile admin permission
UserDto user = new UserDto().setLogin("john").setName("John").setEmail("jo@hn.com").setCreatedAt(new Date()).setUpdatedAt(new Date());
db.userDao().insert(dbSession, user);
tester.get(PermissionFacade.class).insertUserPermission(project1.getId(), user.getId(), UserRole.USER, dbSession);
tester.get(PermissionFacade.class).insertUserPermission(project2.getId(), user.getId(), UserRole.USER, dbSession);
UserSession userSession = MockUserSession.set().setUserId(user.getId().intValue()).setLogin("john").setName("John")
.setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN);
dbSession.commit();
projectOperations.addProject(profile.getId(), project1.getId(), userSession);