### Question:
MovieServiceImpl implements MovieService { @Scheduled(fixedRateString = "${searchIndex.fixedRate}") public void updateSearchIndex() { try { movieRepository.findByUpdated(true).forEach(movieIndexHelper::indexMovie); } catch (final Exception ex) { log.error("An error occured while loading movies to index: " + ex.getMessage(), ex); } }  @Override MoviePagedResultModel searchMovies(final Optional<String> text, final Optional<Integer> pageNumber,
        final Optional<String> sortField, final boolean isAscending); @Override MovieDto getMovie(final UUID id); @Override MovieDto createMovie(MovieDto movieDto); @Override MovieDto updateMovie(final MovieDto movieDto); @Override void deleteMovie(final UUID id); @Override void likeMovie(final UUID movieId, final String account); @Override void unlikeMovie(final UUID movieId, final String account); boolean hasLiked(final UUID movieId, final String account); @Scheduled(fixedRateString = "${searchIndex.fixedRate}") void updateSearchIndex();  }### Answer:
@Test public void test_updateSearchIndex_success() { final Movie movie = new Movie(); when(movieRepository.findByUpdated(true)).thenReturn(Arrays.asList(movie)); movieService.updateSearchIndex(); verify(movieIndexHelper).indexMovie(movie); }
@Test public void test_updateSearchIndex_loadException() { when(movieRepository.findByUpdated(true)).thenThrow(new RuntimeException()); movieService.updateSearchIndex(); }