public void validateUserCanReceivePushEventForProjectUuids(String userUuid, Set<String> projectUuids) {
    UserDto userDto;
    try (DbSession dbSession = dbClient.openSession(false)) {
      userDto = dbClient.userDao().selectByUuid(dbSession, userUuid);
    }
    if (userDto == null) {
      throw new ForbiddenException("User does not exist");
    }
    UserSession userSession = userSessionFactory.create(userDto, false);
    List<ProjectDto> projectDtos;
    try (DbSession dbSession = dbClient.openSession(false)) {
      projectDtos = dbClient.projectDao().selectByUuids(dbSession, projectUuids);
    }
    validateProjectPermissions(userSession, projectDtos);
  }
@Test
  public void validate_givenUserActivatedAndWithRequiredPermissions_dontThrowException() {
    UserDto userDto = new UserDto();
    when(userDao.selectByUuid(any(), any())).thenReturn(userDto);
    when(userSession.isActive()).thenReturn(true);

    assertThatCode(() -> underTest.validateUserCanReceivePushEventForProjectUuids(USER_UUID, exampleProjectuuids))
      .doesNotThrowAnyException();
  }