@Test
public void testShowSecureClinicalDocuments() throws Exception {

	PatientProfileDto patientProfileDto = mock(PatientProfileDto.class);
	List<ClinicalDocumentDto> clinicaldocumentDtos = new ArrayList<ClinicalDocumentDto>();
	ClinicalDocumentDto notNullClinicalDocumentDto=mock(ClinicalDocumentDto.class);
	LookupDto lookupDto=mock(LookupDto.class);
	when(notNullClinicalDocumentDto.getClinicalDocumentTypeCode()).thenReturn(lookupDto);
	clinicaldocumentDtos.add(notNullClinicalDocumentDto);
	for (int i = 0; i < 3; i++) {
		ClinicalDocumentDto clinicalDocumentDto = mock(ClinicalDocumentDto.class);
		clinicaldocumentDtos.add(clinicalDocumentDto);
	}
	List<LookupDto> allDocumentTypeCodes = new ArrayList<LookupDto>();
	for (int i = 0; i < 3; i++) {
		LookupDto clinicalDocumentTypeCode = mock(LookupDto.class);
		allDocumentTypeCodes.add(clinicalDocumentTypeCode);
	}
	when(patientService.findPatientProfileByUsername(anyString()))
			.thenReturn(patientProfileDto);
	when(clinicalDocumentService.findDtoByPatientDto(patientProfileDto))
			.thenReturn(clinicaldocumentDtos);
	when(clinicalDocumentTypeCodeService.findAllClinicalDocumentTypeCodes())
			.thenReturn(allDocumentTypeCodes);
	mockMvc.perform(get("/patients/clinicaldocuments.html")).andExpect(
			view().name("views/clinicaldocuments/secureClinicalDocuments"));
}