### Question:
FavoritePlaceServiceImpl implements FavoritePlaceService { @Override public List<FavoritePlaceDto> findAllByUserEmail(String email) { log.info(LogMessage.IN_FIND_ALL); return repo.findAllByUserEmail(email).stream().map(fp -> modelMapper.map(fp, FavoritePlaceDto.class)) .collect(Collectors.toList()); }  @Override FavoritePlaceDto save(FavoritePlaceDto favoritePlaceDto, String userEmail); @Override FavoritePlaceDto update(FavoritePlaceDto favoritePlaceDto, String userEmail); @Override List<FavoritePlaceDto> findAllByUserEmail(String email); @Override @Transactional Long deleteByUserEmailAndPlaceId(Long placeId, String userEmail); @Override FavoritePlace findByPlaceId(Long placeId); @Override PlaceInfoDto getInfoFavoritePlace(Long placeId); @Override PlaceByBoundsDto getFavoritePlaceWithLocation(Long placeId, String email);  }### Answer:
@Test public void findAllTest() { List<FavoritePlace> favoritePlaces = new ArrayList<>(); List<FavoritePlaceDto> favoritePlaceDtos = new ArrayList<>(); FavoritePlaceDto dto = ModelUtils.getFavoritePlaceDto(); FavoritePlace fp = ModelUtils.getFavoritePlace(); for (long i = 0; i < 5; i++) { favoritePlaces.add(fp); favoritePlaceDtos.add(dto); } when(repo.findAllByUserEmail(anyString())).thenReturn(favoritePlaces); when(modelMapper.map(any(FavoritePlace.class), eq(FavoritePlaceDto.class))).thenReturn(dto); assertEquals(favoritePlaceDtos, favoritePlaceService.findAllByUserEmail(TestConst.EMAIL)); }
@Test public void findAllWhenNotRecords() { List<FavoritePlace> result = new ArrayList<>(); when(repo.findAllByUserEmail(anyString())).thenReturn(result); assertEquals(result, favoritePlaceService.findAllByUserEmail(TestConst.EMAIL)); }