@Test public void testDeleteIndividualProviderDto() { IndividualProviderDto individualProviderDto = mock(IndividualProviderDto.class); individualProviderService .deleteIndividualProviderDto(mock(IndividualProviderDto.class)); verify(patientRepository).save(any(Patient.class)); }
@Override public void deleteIndividualProviderDto( IndividualProviderDto individualProviderDto) { Patient patient = patientRepository .findByUsername(individualProviderDto.getUsername()); Set<IndividualProvider> individualProviders = patient .getIndividualProviders(); for (IndividualProvider o : individualProviders) { if (o.getNpi().equals(individualProviderDto.getNpi())) { individualProviders.remove(o); break; } } patient.setIndividualProviders(individualProviders); patientRepository.save(patient); }
IndividualProviderServiceImpl implements IndividualProviderService { @Override public void deleteIndividualProviderDto( IndividualProviderDto individualProviderDto) { Patient patient = patientRepository .findByUsername(individualProviderDto.getUsername()); Set<IndividualProvider> individualProviders = patient .getIndividualProviders(); for (IndividualProvider o : individualProviders) { if (o.getNpi().equals(individualProviderDto.getNpi())) { individualProviders.remove(o); break; } } patient.setIndividualProviders(individualProviders); patientRepository.save(patient); } }
IndividualProviderServiceImpl implements IndividualProviderService { @Override public void deleteIndividualProviderDto( IndividualProviderDto individualProviderDto) { Patient patient = patientRepository .findByUsername(individualProviderDto.getUsername()); Set<IndividualProvider> individualProviders = patient .getIndividualProviders(); for (IndividualProvider o : individualProviders) { if (o.getNpi().equals(individualProviderDto.getNpi())) { individualProviders.remove(o); break; } } patient.setIndividualProviders(individualProviders); patientRepository.save(patient); } IndividualProviderServiceImpl(
			IndividualProviderRepository individualProviderRepository,
			ModelMapper modelMapper, PatientRepository patientRepository); }
IndividualProviderServiceImpl implements IndividualProviderService { @Override public void deleteIndividualProviderDto( IndividualProviderDto individualProviderDto) { Patient patient = patientRepository .findByUsername(individualProviderDto.getUsername()); Set<IndividualProvider> individualProviders = patient .getIndividualProviders(); for (IndividualProvider o : individualProviders) { if (o.getNpi().equals(individualProviderDto.getNpi())) { individualProviders.remove(o); break; } } patient.setIndividualProviders(individualProviders); patientRepository.save(patient); } IndividualProviderServiceImpl(
			IndividualProviderRepository individualProviderRepository,
			ModelMapper modelMapper, PatientRepository patientRepository); @Override long countAllIndividualProviders(); @Override void updateIndividualProvider(
			IndividualProviderDto individualProviderDto); @Override void deleteIndividualProvider(IndividualProvider individualProvider); @Override void deleteIndividualProviderDto(
			IndividualProviderDto individualProviderDto); @Override void deleteIndividualProviderDtoByPatientId(
			IndividualProviderDto individualProviderDto); @Override IndividualProvider findIndividualProviderByNpi(String npi); @Override IndividualProvider findIndividualProvider(Long id); @Override List<IndividualProvider> findAllIndividualProviders(); @Override List<IndividualProvider> findIndividualProviderEntries(
			int firstResult, int maxResults); @Override void saveIndividualProvider(IndividualProvider individualProvider); @Override IndividualProvider updateIndividualProvider(
			IndividualProvider individualProvider); @Override IndividualProvider addNewIndividualProvider(
			IndividualProviderDto individualProviderDto); @Override List<IndividualProviderDto> findAllIndividualProvidersDto(); @Override IndividualProviderDto findIndividualProviderDto(Long id); }
IndividualProviderServiceImpl implements IndividualProviderService { @Override public void deleteIndividualProviderDto( IndividualProviderDto individualProviderDto) { Patient patient = patientRepository .findByUsername(individualProviderDto.getUsername()); Set<IndividualProvider> individualProviders = patient .getIndividualProviders(); for (IndividualProvider o : individualProviders) { if (o.getNpi().equals(individualProviderDto.getNpi())) { individualProviders.remove(o); break; } } patient.setIndividualProviders(individualProviders); patientRepository.save(patient); } IndividualProviderServiceImpl(
			IndividualProviderRepository individualProviderRepository,
			ModelMapper modelMapper, PatientRepository patientRepository); @Override long countAllIndividualProviders(); @Override void updateIndividualProvider(
			IndividualProviderDto individualProviderDto); @Override void deleteIndividualProvider(IndividualProvider individualProvider); @Override void deleteIndividualProviderDto(
			IndividualProviderDto individualProviderDto); @Override void deleteIndividualProviderDtoByPatientId(
			IndividualProviderDto individualProviderDto); @Override IndividualProvider findIndividualProviderByNpi(String npi); @Override IndividualProvider findIndividualProvider(Long id); @Override List<IndividualProvider> findAllIndividualProviders(); @Override List<IndividualProvider> findIndividualProviderEntries(
			int firstResult, int maxResults); @Override void saveIndividualProvider(IndividualProvider individualProvider); @Override IndividualProvider updateIndividualProvider(
			IndividualProvider individualProvider); @Override IndividualProvider addNewIndividualProvider(
			IndividualProviderDto individualProviderDto); @Override List<IndividualProviderDto> findAllIndividualProvidersDto(); @Override IndividualProviderDto findIndividualProviderDto(Long id);  }