Created
April 19, 2016 17:46
-
-
Save MafaldaLandeiro/110d31ab968c5157d4f9cac17010f58d to your computer and use it in GitHub Desktop.
Country service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.MockitoTest; | |
| import java.util.List; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Service; | |
| @Service | |
| public class CountryService { | |
| @Autowired | |
| private CountryRepository countryRepository; | |
| public List<Country> findAll() { | |
| return (List<Country>) countryRepository.findAll(); | |
| } | |
| /** | |
| * @return the countryRepository | |
| */ | |
| public CountryRepository getCountryRepository() { | |
| return countryRepository; | |
| } | |
| /** | |
| * @param countryRepository | |
| * the countryRepository to set | |
| */ | |
| public void setCountryRepository(CountryRepository countryRepository) { | |
| this.countryRepository = countryRepository; | |
| } | |
| public Country findOne(int id) { | |
| return countryRepository.findOne(id); | |
| } | |
| public List<Country> findByCurrency(String currency) { | |
| return countryRepository.findByCurrency(currency); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment