@Test public void shouldAddProgramSupported() throws Exception { ProgramSupported programSupported = new ProgramSupported(); programSupportedRepository.addSupportedProgram(programSupported); verify(programSupportedMapper).insert(programSupported); }
public void addSupportedProgram(ProgramSupported programSupported) { try { mapper.insert(programSupported); } catch (DuplicateKeyException duplicateKeyException) { throw new DataException("error.facility.program.mapping.exists"); } catch (DataIntegrityViolationException integrityViolationException) { throw new DataException("error.reference.data.invalid.program"); } }
ProgramSupportedRepository { public void addSupportedProgram(ProgramSupported programSupported) { try { mapper.insert(programSupported); } catch (DuplicateKeyException duplicateKeyException) { throw new DataException("error.facility.program.mapping.exists"); } catch (DataIntegrityViolationException integrityViolationException) { throw new DataException("error.reference.data.invalid.program"); } } }
ProgramSupportedRepository { public void addSupportedProgram(ProgramSupported programSupported) { try { mapper.insert(programSupported); } catch (DuplicateKeyException duplicateKeyException) { throw new DataException("error.facility.program.mapping.exists"); } catch (DataIntegrityViolationException integrityViolationException) { throw new DataException("error.reference.data.invalid.program"); } }  }
ProgramSupportedRepository { public void addSupportedProgram(ProgramSupported programSupported) { try { mapper.insert(programSupported); } catch (DuplicateKeyException duplicateKeyException) { throw new DataException("error.facility.program.mapping.exists"); } catch (DataIntegrityViolationException integrityViolationException) { throw new DataException("error.reference.data.invalid.program"); } }  Date getProgramStartDate(Long facilityId, Long programId); void deleteSupportedPrograms(Long facilityId, Long programId); void addSupportedProgram(ProgramSupported programSupported); boolean updateSupportedPrograms(Facility facility); List<ProgramSupported> getAllByFacilityId(Long facilityId); ProgramSupported getByFacilityIdAndProgramId(Long facilityId, Long programId); void updateSupportedProgram(ProgramSupported programSupported); List<ProgramSupported> getActiveByFacilityId(Long facilityId); void updateForVirtualFacilities(Facility parentFacility); }
ProgramSupportedRepository { public void addSupportedProgram(ProgramSupported programSupported) { try { mapper.insert(programSupported); } catch (DuplicateKeyException duplicateKeyException) { throw new DataException("error.facility.program.mapping.exists"); } catch (DataIntegrityViolationException integrityViolationException) { throw new DataException("error.reference.data.invalid.program"); } }  Date getProgramStartDate(Long facilityId, Long programId); void deleteSupportedPrograms(Long facilityId, Long programId); void addSupportedProgram(ProgramSupported programSupported); boolean updateSupportedPrograms(Facility facility); List<ProgramSupported> getAllByFacilityId(Long facilityId); ProgramSupported getByFacilityIdAndProgramId(Long facilityId, Long programId); void updateSupportedProgram(ProgramSupported programSupported); List<ProgramSupported> getActiveByFacilityId(Long facilityId); void updateForVirtualFacilities(Facility parentFacility);  }