test_class.declarator: CREATION_TIME_STRING = TestDateUtil.CURRENT_TIMESTAMP
test_class.modifier: private static final
test_class.original_string: private static final String CREATION_TIME_STRING = TestDateUtil.CURRENT_TIMESTAMP;
test_class.type: String
test_class.var_name: CREATION_TIME_STRING
test_class.declarator: CREATION_TIME = TestDateUtil.parseTimestamp(CREATION_TIME_STRING)
test_class.modifier: private static final
test_class.original_string: private static final Timestamp CREATION_TIME = TestDateUtil.parseTimestamp(CREATION_TIME_STRING);
test_class.type: Timestamp
test_class.var_name: CREATION_TIME
test_class.declarator: DESCRIPTION = "description"
test_class.modifier: private static final
test_class.original_string: private static final String DESCRIPTION = "description";
test_class.type: String
test_class.var_name: DESCRIPTION
test_class.declarator: ID = 1L
test_class.modifier: private static final
test_class.original_string: private static final Long ID = 1L;
test_class.type: Long
test_class.var_name: ID
test_class.declarator: MODIFICATION_TIME_STRING = TestDateUtil.CURRENT_TIMESTAMP
test_class.modifier: private static final
test_class.original_string: private static final String MODIFICATION_TIME_STRING = TestDateUtil.CURRENT_TIMESTAMP;
test_class.type: String
test_class.var_name: MODIFICATION_TIME_STRING
test_class.declarator: MODIFICATION_TIME = TestDateUtil.parseTimestamp(MODIFICATION_TIME_STRING)
test_class.modifier: private static final
test_class.original_string: private static final Timestamp MODIFICATION_TIME = TestDateUtil.parseTimestamp(MODIFICATION_TIME_STRING);
test_class.type: Timestamp
test_class.var_name: MODIFICATION_TIME
test_class.declarator: TITLE = "title"
test_class.modifier: private static final
test_class.original_string: private static final String TITLE = "title";
test_class.type: String
test_class.var_name: TITLE
test_class.declarator: SEARCH_TERM = "title"
test_class.modifier: private static final
test_class.original_string: private static final String SEARCH_TERM = "title";
test_class.type: String
test_class.var_name: SEARCH_TERM
test_class.declarator: PAGE_NUMBER = 0
test_class.modifier: private static final
test_class.original_string: private static final int PAGE_NUMBER = 0;
test_class.type: int
test_class.var_name: PAGE_NUMBER
test_class.declarator: PAGE_SIZE = 10
test_class.modifier: private static final
test_class.original_string: private static final int PAGE_SIZE = 10;
test_class.type: int
test_class.var_name: PAGE_SIZE
test_class.declarator: SORT = mock(Sort.class)
test_class.modifier: private static final
test_class.original_string: private static final Sort SORT = mock(Sort.class);
test_class.type: Sort
test_class.var_name: SORT
test_class.declarator: ONE_ELEMENT_ON_PAGE = 1
test_class.modifier: private static final
test_class.original_string: private static final int ONE_ELEMENT_ON_PAGE = 1;
test_class.type: int
test_class.var_name: ONE_ELEMENT_ON_PAGE
test_class.declarator: ONE_ELEMENT = 1L
test_class.modifier: private static final
test_class.original_string: private static final long ONE_ELEMENT = 1L;
test_class.type: long
test_class.var_name: ONE_ELEMENT
test_class.declarator: ONE_PAGE = 1
test_class.modifier: private static final
test_class.original_string: private static final int ONE_PAGE = 1;
test_class.type: int
test_class.var_name: ONE_PAGE
test_class.declarator: ZERO_ELEMENTS = 0L
test_class.modifier: private static final
test_class.original_string: private static final long ZERO_ELEMENTS = 0L;
test_class.type: long
test_class.var_name: ZERO_ELEMENTS
test_class.declarator: ZERO_PAGES = 0
test_class.modifier: private static final
test_class.original_string: private static final int ZERO_PAGES = 0;
test_class.type: int
test_class.var_name: ZERO_PAGES
test_class.declarator: pageRequest
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Pageable pageRequest;
test_class.type: Pageable
test_class.var_name: pageRequest
test_class.declarator: repositoryMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private TodoRepository repositoryMock;
test_class.type: TodoRepository
test_class.var_name: repositoryMock
test_class.declarator: service
test_class.modifier: private
test_class.original_string: private RepositoryTodoSearchService service;
test_class.type: RepositoryTodoSearchService
test_class.var_name: service
test_class.declarator: transformer
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private JTransfo transformer;
test_class.type: JTransfo
test_class.var_name: transformer
test_class.file: jooq-only/src/test/java/net/petrikainulainen/spring/jooq/todo/service/RepositoryTodoSearchServiceTest.java
test_class.identifier: RepositoryTodoSearchServiceTest
test_case.body: @Test
      public void findBySearchTerm_NoTodoEntriesFound_ShouldReturnEmptyList() {
          Page<Todo> page = new PageBuilder<Todo>()
                  .pageNumber(PAGE_NUMBER)
                  .pageSize(PAGE_SIZE)
                  .sort(SORT)
                  .build();
  
          when(repositoryMock.findBySearchTerm(SEARCH_TERM, pageRequest)).thenReturn(page);
  
          Page<TodoDTO> searchResults = service.findBySearchTerm(SEARCH_TERM, pageRequest);
  
          verify(repositoryMock, times(1)).findBySearchTerm(SEARCH_TERM, pageRequest);
          verifyNoMoreInteractions(repositoryMock);
  
          assertThatPage(searchResults)
                  .isFirstPage()
                  .isLastPage()
                  .hasPageNumber(PAGE_NUMBER)
                  .hasPageSize(PAGE_SIZE)
                  .hasSort(SORT)
                  .hasTotalNumberOfElements(ZERO_ELEMENTS)
                  .hasTotalNumberOfPages(ZERO_PAGES)
                  .isEmpty();
      }
test_case.class_method_signature: RepositoryTodoSearchServiceTest.findBySearchTerm_NoTodoEntriesFound_ShouldReturnEmptyList()
test_case.full_signature: @Test public void findBySearchTerm_NoTodoEntriesFound_ShouldReturnEmptyList()
test_case.identifier: findBySearchTerm_NoTodoEntriesFound_ShouldReturnEmptyList
test_case.invocations: build sort pageSize pageNumber thenReturn when findBySearchTerm findBySearchTerm findBySearchTerm verify times verifyNoMoreInteractions isEmpty hasTotalNumberOfPages hasTotalNumberOfElements hasSort hasPageSize hasPageNumber isLastPage isFirstPage assertThatPage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void findBySearchTerm_NoTodoEntriesFound_ShouldReturnEmptyList()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(RepositoryTodoSearchService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(RepositoryTodoSearchService.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: repository
focal_class.modifier: private
focal_class.original_string: private TodoRepository repository;
focal_class.type: TodoRepository
focal_class.var_name: repository
focal_class.declarator: transformer
focal_class.modifier: private
focal_class.original_string: private JTransfo transformer;
focal_class.type: JTransfo
focal_class.var_name: transformer
focal_class.file: jooq-only/src/main/java/net/petrikainulainen/spring/jooq/todo/service/RepositoryTodoSearchService.java
focal_class.identifier: RepositoryTodoSearchService
focal_class.interfaces: implements TodoSearchService
focal_class.class_method_signature: RepositoryTodoSearchService.RepositoryTodoSearchService(TodoRepository repository, JTransfo transformer)
focal_class.full_signature: @Autowired public  RepositoryTodoSearchService(TodoRepository repository, JTransfo transformer)
focal_class.identifier: RepositoryTodoSearchService
focal_class.modifiers: @Autowired public
focal_class.parameters: (TodoRepository repository, JTransfo transformer)
focal_class.signature:  RepositoryTodoSearchService(TodoRepository repository, JTransfo transformer)
focal_class.class_method_signature: RepositoryTodoSearchService.findBySearchTerm(String searchTerm, Pageable pageable)
focal_class.full_signature: @Transactional(readOnly = true) @Override public Page<TodoDTO> findBySearchTerm(String searchTerm, Pageable pageable)
focal_class.identifier: findBySearchTerm
focal_class.modifiers: @Transactional(readOnly = true) @Override public
focal_class.parameters: (String searchTerm, Pageable pageable)
focal_class.return: Page<TodoDTO>
focal_class.signature: Page<TodoDTO> findBySearchTerm(String searchTerm, Pageable pageable)
focal_method.body: @Transactional(readOnly = true)
      @Override
      public Page<TodoDTO> findBySearchTerm(String searchTerm, Pageable pageable) {
          LOGGER.info("Finding {} todo entries for page {} by using search term: {}",
                  pageable.getPageSize(),
                  pageable.getPageNumber(),
                  searchTerm
          );
  
          Page<Todo> searchResults = repository.findBySearchTerm(searchTerm, pageable);
          LOGGER.info("Found {} todo entries for page: {}",
                  searchResults.getNumberOfElements(),
                  searchResults.getNumber()
          );
  
          List<TodoDTO> dtos = transformer.convertList(searchResults.getContent(), TodoDTO.class);
  
          return new PageImpl<>(dtos,
                  new PageRequest(searchResults.getNumber(), searchResults.getSize(), searchResults.getSort()),
                  searchResults.getTotalElements()
          );
      }
focal_method.class_method_signature: RepositoryTodoSearchService.findBySearchTerm(String searchTerm, Pageable pageable)
focal_method.full_signature: @Transactional(readOnly = true) @Override public Page<TodoDTO> findBySearchTerm(String searchTerm, Pageable pageable)
focal_method.identifier: findBySearchTerm
focal_method.invocations: info getPageSize getPageNumber findBySearchTerm info getNumberOfElements getNumber convertList getContent getNumber getSize getSort getTotalElements
focal_method.modifiers: @Transactional(readOnly = true) @Override public
focal_method.parameters: (String searchTerm, Pageable pageable)
focal_method.return: Page<TodoDTO>
focal_method.signature: Page<TodoDTO> findBySearchTerm(String searchTerm, Pageable pageable)