AdminServiceImpl implements AdminService { @Override public AdminProfileDto findAdminProfileByUsername(String username) { Staff admin = administratorRepository.findByUsername(username); AdminProfileDto adminProfileDto = modelMapper.map(admin, AdminProfileDto.class); return adminProfileDto; } AdminServiceImpl(
			Integer accountVerificationTokenExpireInHours,
			StaffRepository administratorRepository,
			PatientRepository patientRepository,
			DtoToDomainEntityMapper<PatientProfileDto, Patient> patientProfileDtoToPatientMapper,
			AdminProfileDtoToAdministratorMapper adminProfileDtoToAdministratorMapper,
			ModelMapper modelMapper,
			UserContext userContext,
			PasswordEncoder passwordEncoder,
			EmailSender emailSender,
			TokenGenerator tokenGenerator,
			EmailTokenRepository emailTokenRepository,
			UsersRepository usersRepository,
			AdministrativeGenderCodeRepository administrativeGenderCodeRepository,
			MrnService mrnService, PixService pixService); @Override AdminProfileDto findAdminProfileByUsername(String username); @Override @Transactional void updateAdministrator(AdminProfileDto adminProfileDto); @Override @Transactional void updatePatient(PatientProfileDto patientProfileDto); @Override AdminCreatePatientResponseDto createPatientAccount(
			BasicPatientAccountDto basicPatientAccountDto); @Override Boolean sendLoginInformationEmail(long patientId, String linkUrl);  }
@Test public void testFindPatientProfileByUsername() { final Staff admin = mock(Staff.class); when(administratorRepository.findByUsername(anyString())).thenReturn( admin); final AdminProfileDto expectedPAdminProfileDto = mock(AdminProfileDto.class); when(modelMapper.map(admin, AdminProfileDto.class)).thenReturn( expectedPAdminProfileDto); AdminProfileDto result = sut.findAdminProfileByUsername(anyString()); assertEquals(expectedPAdminProfileDto, result); }