### Question:
MovieServiceImpl implements MovieService { @Override public void unlikeMovie(final UUID movieId, final String account) throws MovieConditionalException, MovieNotFoundException { try { final Movie movie = movieRepository.findById(movieId.toString()) .orElseThrow(() -> new MovieNotFoundException()); if (movie.isDeleted()) { throw new MovieNotFoundException(); } final String currentRevision = movie.getRevision(); movie.setRevision(UUID.randomUUID().toString()); movie.setUpdated(true); movie.getPendingLikes().remove(account); movie.getPendingUnlikes().add(account); final long affectedDocuments = movieRepository.updateMovie(movie, currentRevision); if (affectedDocuments == 0) { throw new MovieConditionalException(); } movieIndexHelper.indexMovie(movie); } catch (final MovieNotFoundException | MovieConditionalException ex) { throw ex; } catch (final Exception ex) { final String errorMessage = String.format("An error occured while updating movie %s: %s", movieId, ex.getMessage()); log.error(errorMessage, ex); throw new MoviePersistenceException(errorMessage, 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(expected = MovieNotFoundException.class) public void test_unlikeMovie_movieNotFound() throws Exception { final UUID movieId = UUID.randomUUID(); when(movieRepository.findById(movieId.toString())).thenReturn(Optional.empty()); movieService.unlikeMovie(movieId, "test_account"); }
@Test(expected = MovieNotFoundException.class) public void test_unlikeMovie_deleted() throws Exception { final UUID movieId = UUID.randomUUID(); final Movie movie = new Movie(); movie.setDeleted(true); when(movieRepository.findById(movieId.toString())).thenReturn(Optional.of(movie)); movieService.unlikeMovie(movieId, "test_account"); }