Skip to content

Instantly share code, notes, and snippets.

@MafaldaLandeiro
Created April 19, 2016 17:46
Show Gist options
  • Select an option

  • Save MafaldaLandeiro/110d31ab968c5157d4f9cac17010f58d to your computer and use it in GitHub Desktop.

Select an option

Save MafaldaLandeiro/110d31ab968c5157d4f9cac17010f58d to your computer and use it in GitHub Desktop.
Country service
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