OrganizationalProviderServiceImpl implements
		OrganizationalProviderService { @Override public void deleteOrganizationalProviderDto( OrganizationalProviderDto organizationalProviderDto) { Patient patient = patientRepository .findByUsername(organizationalProviderDto.getUsername()); Set<OrganizationalProvider> organizationalProviders = patient .getOrganizationalProviders(); for (OrganizationalProvider o : organizationalProviders) { if (o.getNpi().equals(organizationalProviderDto.getNpi())) { organizationalProviders.remove(o); break; } } patient.setOrganizationalProviders(organizationalProviders); patientRepository.save(patient); } OrganizationalProviderServiceImpl(
			PatientRepository patientRepository, ModelMapper modelMapper,
			OrganizationalProviderRepository organizationalProviderRepository); @Override long countAllOrganizationalProviders(); @Override void deleteOrganizationalProvider(
			OrganizationalProvider organizationalProvider); @Override void deleteOrganizationalProviderDto(
			OrganizationalProviderDto organizationalProviderDto); @Override void deleteOrganizationalProviderDtoByPatientId(
			OrganizationalProviderDto organizationalProviderDto); @Override OrganizationalProvider findOrganizationalProvider(Long id); @Override OrganizationalProviderDto findOrganizationalProviderDto(Long id); @Override List<OrganizationalProvider> findAllOrganizationalProviders(); @Override List<OrganizationalProvider> findOrganizationalProviderEntries(
			int firstResult, int maxResults); @Override void saveOrganizationalProvider(
			OrganizationalProvider organizationalProvider); @Override OrganizationalProvider updateOrganizationalProvider(
			OrganizationalProvider organizationalProvider); @Override void updateOrganizationalProvider(
			OrganizationalProviderDto organizationalProviderDto); @Override OrganizationalProvider addNewOrganizationalProvider(
			OrganizationalProviderDto organizationalProviderDto); OrganizationalProvider findOrganizationalProviderByNpi(String npi);  }
@Test public void testDeleteOrganizationalProviderDto() { OrganizationalProviderDto organizationalProviderDto = mock(OrganizationalProviderDto.class); organizationalProviderService .deleteOrganizationalProviderDto(mock(OrganizationalProviderDto.class)); verify(patientRepository).save(any(Patient.class)); }
@Test public void testDeleteOrganizationalProviderByPatientId() { OrganizationalProviderDto organizationalProviderDto = mock(OrganizationalProviderDto.class); when(organizationalProviderDto.getPatientId()).thenReturn("11"); Patient patient = mock(Patient.class); when(patientRepository.findOne(anyLong())).thenReturn(patient); organizationalProviderService .deleteOrganizationalProviderDto(mock(OrganizationalProviderDto.class)); verify(patientRepository).save(any(Patient.class)); }