@Test public void shouldGetRegimenByProgram() { List<Regimen> expectedRegimens = new ArrayList<>(); Long programId = 1l; when(mapper.getByProgram(programId)).thenReturn(expectedRegimens); List<Regimen> regimens = repository.getByProgram(programId); assertThat(regimens, is(expectedRegimens)); verify(mapper).getByProgram(programId); }
public List<Regimen> getByProgram(Long programId) { return mapper.getByProgram(programId); }
RegimenRepository { public List<Regimen> getByProgram(Long programId) { return mapper.getByProgram(programId); } }
RegimenRepository { public List<Regimen> getByProgram(Long programId) { return mapper.getByProgram(programId); }  }
RegimenRepository { public List<Regimen> getByProgram(Long programId) { return mapper.getByProgram(programId); }  List<Regimen> getByProgram(Long programId); Regimen getById(Long id); void save(List<Regimen> regimens, Long userId); List<Regimen> getAllRegimens(); List<DosageFrequency> getAllDosageFrequencies(); List<RegimenCombinationConstituent> getAllRegimenCombinationConstituents(); List<RegimenConstituentDosage> getAllRegimenConstituentsDosages(); List<RegimenProductCombination> getAllRegimenProductCombinations(); }
RegimenRepository { public List<Regimen> getByProgram(Long programId) { return mapper.getByProgram(programId); }  List<Regimen> getByProgram(Long programId); Regimen getById(Long id); void save(List<Regimen> regimens, Long userId); List<Regimen> getAllRegimens(); List<DosageFrequency> getAllDosageFrequencies(); List<RegimenCombinationConstituent> getAllRegimenCombinationConstituents(); List<RegimenConstituentDosage> getAllRegimenConstituentsDosages(); List<RegimenProductCombination> getAllRegimenProductCombinations();  }