@Test
public void testFindAddConsentIndividualProviderDtoByUsername() {

	// Arrange
	final String username = "TheUsername";
	Patient patient = mock(Patient.class);
	when(patientRepository.findByUsername(username)).thenReturn(patient);
	IndividualProvider provider1 = mock(IndividualProvider.class);
	IndividualProvider provider2 = mock(IndividualProvider.class);
	Set<IndividualProvider> providerSet = new HashSet();
	providerSet.add(provider1);
	providerSet.add(provider2);
	when(patient.getIndividualProviders()).thenReturn(providerSet);
	AddConsentIndividualProviderDto providerDto1 = mock(AddConsentIndividualProviderDto.class);
	AddConsentIndividualProviderDto providerDto2 = mock(AddConsentIndividualProviderDto.class);
	when(modelMapper.map(provider1, AddConsentIndividualProviderDto.class))
			.thenReturn(providerDto1);
	when(modelMapper.map(provider2, AddConsentIndividualProviderDto.class))
			.thenReturn(providerDto2);
	// Act
	List<AddConsentIndividualProviderDto> result = sut
			.findAddConsentIndividualProviderDtoByUsername(username);
	// Assert
	// Assert
	assertEquals(2, result.size());
	for (AddConsentIndividualProviderDto providerDto : result) {
		assertTrue(providerDto == providerDto1
				|| providerDto == providerDto2);
	}
	assertTrue(result.get(0) != result.get(1));
}