test_class.declarator: LOB_DEPENDENT_STATUS = Set.of("open")
test_class.modifier: private static final
test_class.original_string: private static final Set<String> LOB_DEPENDENT_STATUS = Set.of("open");
test_class.type: Set<String>
test_class.var_name: LOB_DEPENDENT_STATUS
test_class.declarator: EXCLUDED_STATUS = Set.of("closed")
test_class.modifier: private static final
test_class.original_string: private static final Set<String> EXCLUDED_STATUS = Set.of("closed");
test_class.type: Set<String>
test_class.var_name: EXCLUDED_STATUS
test_class.declarator: userServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserService userServiceMock;
test_class.type: UserService
test_class.var_name: userServiceMock
test_class.declarator: projectRepoMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ProjectRepository projectRepoMock;
test_class.type: ProjectRepository
test_class.var_name: projectRepoMock
test_class.declarator: managerHibernateSearchServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private HibernateSearchService managerHibernateSearchServiceMock;
test_class.type: HibernateSearchService
test_class.var_name: managerHibernateSearchServiceMock
test_class.declarator: staffHibernateSearchServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private HibernateSearchService staffHibernateSearchServiceMock;
test_class.type: HibernateSearchService
test_class.var_name: staffHibernateSearchServiceMock
test_class.declarator: userMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private User userMock;
test_class.type: User
test_class.var_name: userMock
test_class.declarator: userDataMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserData userDataMock;
test_class.type: UserData
test_class.var_name: userDataMock
test_class.declarator: projectMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Project projectMock;
test_class.type: Project
test_class.var_name: projectMock
test_class.declarator: propertiesMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ProjectBoardConfigurationProperties propertiesMock;
test_class.type: ProjectBoardConfigurationProperties
test_class.var_name: propertiesMock
test_class.declarator: userProjectService
test_class.modifier: private
test_class.original_string: private RepositoryUserProjectService userProjectService;
test_class.type: RepositoryUserProjectService
test_class.var_name: userProjectService
test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/ad/project/service/RepositoryUserProjectServiceTest.java
test_class.identifier: RepositoryUserProjectServiceTest
test_case.body: @Test
      public void searchProjectsForUserPaginatedSearchesInAllProjectsWhenUserIsManager() {
          // given
          var expectedQuery = "a cool query";
          var expectedPageable = PageRequest.of(1, 4);
  
          given(userServiceMock.userIsManager(userMock)).willReturn(true);
          given(managerHibernateSearchServiceMock.searchProjects(expectedQuery, expectedPageable, null))
                  .willReturn(new PageImpl<>(List.of(projectMock)));
  
          // when
          var actualProjectPage = userProjectService.searchProjectsForUserPaginated(expectedQuery, userMock, expectedPageable);
  
          // then
          assertThat(actualProjectPage).containsExactly(projectMock);
      }
test_case.class_method_signature: RepositoryUserProjectServiceTest.searchProjectsForUserPaginatedSearchesInAllProjectsWhenUserIsManager()
test_case.full_signature: @Test public void searchProjectsForUserPaginatedSearchesInAllProjectsWhenUserIsManager()
test_case.identifier: searchProjectsForUserPaginatedSearchesInAllProjectsWhenUserIsManager
test_case.invocations: of willReturn given userIsManager willReturn given searchProjects of searchProjectsForUserPaginated containsExactly assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void searchProjectsForUserPaginatedSearchesInAllProjectsWhenUserIsManager()
focal_class.declarator: projectRepo
focal_class.modifier: private final
focal_class.original_string: private final ProjectRepository projectRepo;
focal_class.type: ProjectRepository
focal_class.var_name: projectRepo
focal_class.declarator: userService
focal_class.modifier: private final
focal_class.original_string: private final UserService userService;
focal_class.type: UserService
focal_class.var_name: userService
focal_class.declarator: managerSearchService
focal_class.modifier: private final
focal_class.original_string: private final HibernateSearchService managerSearchService;
focal_class.type: HibernateSearchService
focal_class.var_name: managerSearchService
focal_class.declarator: staffSearchService
focal_class.modifier: private final
focal_class.original_string: private final HibernateSearchService staffSearchService;
focal_class.type: HibernateSearchService
focal_class.var_name: staffSearchService
focal_class.declarator: lobDependentStatus
focal_class.modifier: private final
focal_class.original_string: private final Set<String> lobDependentStatus;
focal_class.type: Set<String>
focal_class.var_name: lobDependentStatus
focal_class.declarator: excludedStatus
focal_class.modifier: private final
focal_class.original_string: private final Set<String> excludedStatus;
focal_class.type: Set<String>
focal_class.var_name: excludedStatus
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/ad/project/service/RepositoryUserProjectService.java
focal_class.identifier: RepositoryUserProjectService
focal_class.interfaces: implements PageableUserProjectService
focal_class.class_method_signature: RepositoryUserProjectService.RepositoryUserProjectService(ProjectRepository projectRepo,
                                          UserService userService,
                                          @Qualifier("managerSearchService") HibernateSearchService managerSearchService,
                                          @Qualifier("staffSearchService") HibernateSearchService staffSearchService,
                                          ProjectBoardConfigurationProperties properties)
focal_class.full_signature: @Autowired public  RepositoryUserProjectService(ProjectRepository projectRepo,
                                          UserService userService,
                                          @Qualifier("managerSearchService") HibernateSearchService managerSearchService,
                                          @Qualifier("staffSearchService") HibernateSearchService staffSearchService,
                                          ProjectBoardConfigurationProperties properties)
focal_class.identifier: RepositoryUserProjectService
focal_class.modifiers: @Autowired public
focal_class.parameters: (ProjectRepository projectRepo,
                                          UserService userService,
                                          @Qualifier("managerSearchService") HibernateSearchService managerSearchService,
                                          @Qualifier("staffSearchService") HibernateSearchService staffSearchService,
                                          ProjectBoardConfigurationProperties properties)
focal_class.signature:  RepositoryUserProjectService(ProjectRepository projectRepo,
                                          UserService userService,
                                          @Qualifier("managerSearchService") HibernateSearchService managerSearchService,
                                          @Qualifier("staffSearchService") HibernateSearchService staffSearchService,
                                          ProjectBoardConfigurationProperties properties)
focal_class.class_method_signature: RepositoryUserProjectService.getProjectsForUser(User user, Sort sort)
focal_class.full_signature: @Override public List<Project> getProjectsForUser(User user, Sort sort)
focal_class.identifier: getProjectsForUser
focal_class.modifiers: @Override public
focal_class.parameters: (User user, Sort sort)
focal_class.return: List<Project>
focal_class.signature: List<Project> getProjectsForUser(User user, Sort sort)
focal_class.class_method_signature: RepositoryUserProjectService.searchProjectsForUser(User user, String query, Sort sort)
focal_class.full_signature: @Override public List<Project> searchProjectsForUser(User user, String query, Sort sort)
focal_class.identifier: searchProjectsForUser
focal_class.modifiers: @Override public
focal_class.parameters: (User user, String query, Sort sort)
focal_class.return: List<Project>
focal_class.signature: List<Project> searchProjectsForUser(User user, String query, Sort sort)
focal_class.class_method_signature: RepositoryUserProjectService.getProjectsForUserPaginated(User user, Pageable pageable)
focal_class.full_signature: @Override public Page<Project> getProjectsForUserPaginated(User user, Pageable pageable)
focal_class.identifier: getProjectsForUserPaginated
focal_class.modifiers: @Override public
focal_class.parameters: (User user, Pageable pageable)
focal_class.return: Page<Project>
focal_class.signature: Page<Project> getProjectsForUserPaginated(User user, Pageable pageable)
focal_class.class_method_signature: RepositoryUserProjectService.searchProjectsForUserPaginated(String query, User user, Pageable pageable)
focal_class.full_signature: @Override public Page<Project> searchProjectsForUserPaginated(String query, User user, Pageable pageable)
focal_class.identifier: searchProjectsForUserPaginated
focal_class.modifiers: @Override public
focal_class.parameters: (String query, User user, Pageable pageable)
focal_class.return: Page<Project>
focal_class.signature: Page<Project> searchProjectsForUserPaginated(String query, User user, Pageable pageable)
focal_class.class_method_signature: RepositoryUserProjectService.getProjectSpecificationForUser(User user)
focal_class.full_signature: private Specification<Project> getProjectSpecificationForUser(User user)
focal_class.identifier: getProjectSpecificationForUser
focal_class.modifiers: private
focal_class.parameters: (User user)
focal_class.return: Specification<Project>
focal_class.signature: Specification<Project> getProjectSpecificationForUser(User user)
focal_method.body: @Override
      public Page<Project> searchProjectsForUserPaginated(String query, User user, Pageable pageable) {
          if(userService.userIsManager(user)) {
              return managerSearchService.searchProjects(query, pageable,null);
          } else {
              var userLob = userService.getUserData(user).getLob();
              return staffSearchService.searchProjects(query, pageable, userLob);
          }
      }
focal_method.class_method_signature: RepositoryUserProjectService.searchProjectsForUserPaginated(String query, User user, Pageable pageable)
focal_method.full_signature: @Override public Page<Project> searchProjectsForUserPaginated(String query, User user, Pageable pageable)
focal_method.identifier: searchProjectsForUserPaginated
focal_method.invocations: userIsManager searchProjects getLob getUserData searchProjects
focal_method.modifiers: @Override public
focal_method.parameters: (String query, User user, Pageable pageable)
focal_method.return: Page<Project>
focal_method.signature: Page<Project> searchProjectsForUserPaginated(String query, User user, Pageable pageable)