@Test public void shouldGetRegimensByProgram() { List<Regimen> expectedRegimens = new ArrayList<>(); Long programId = 1l; when(repository.getByProgram(programId)).thenReturn(expectedRegimens); List<Regimen> regimenList = service.getByProgram(programId); assertThat(regimenList, is(expectedRegimens)); verify(repository).getByProgram(programId); }
public List<Regimen> getByProgram(Long programId) { return repository.getByProgram(programId); }
RegimenService { public List<Regimen> getByProgram(Long programId) { return repository.getByProgram(programId); } }
RegimenService { public List<Regimen> getByProgram(Long programId) { return repository.getByProgram(programId); }  }
RegimenService { public List<Regimen> getByProgram(Long programId) { return repository.getByProgram(programId); }  void save(List<Regimen> regimens, Long userId); List<Regimen> getByProgram(Long programId); List<RegimenCategory> getAllRegimenCategories(); Regimen getById(Long id); List<DosageFrequency> getAllDosageFrequencies(); List<RegimenProductCombination> getAllRegimenProductCombinations(); List<RegimenCombinationConstituent> getAllRegimenCombinationConstituents(); List<RegimenConstituentDosage> getAllRegimenConstituentDosages(); }
RegimenService { public List<Regimen> getByProgram(Long programId) { return repository.getByProgram(programId); }  void save(List<Regimen> regimens, Long userId); List<Regimen> getByProgram(Long programId); List<RegimenCategory> getAllRegimenCategories(); Regimen getById(Long id); List<DosageFrequency> getAllDosageFrequencies(); List<RegimenProductCombination> getAllRegimenProductCombinations(); List<RegimenCombinationConstituent> getAllRegimenCombinationConstituents(); List<RegimenConstituentDosage> getAllRegimenConstituentDosages();  }