@Test
public void testSignConsentRevokation() {

	Consent consent = mock(Consent.class);
	Patient patient = mock(Patient.class);
	when(consent.getPatient()).thenReturn(patient);
	when(patient.getFirstName()).thenReturn("John");
	when(patient.getLastName()).thenReturn("Doe");
	AuthenticatedUser user = mock(AuthenticatedUser.class);
	when(userContext.getCurrentUser()).thenReturn(user);
	when(user.getUsername()).thenReturn("mockedUser");
	when(consentRepository.findOne(anyLong())).thenReturn(consent);
	ConsentService spy = spy(cst);
	ConsentRevokationPdfDto consentRevokationPdfDto = mock(ConsentRevokationPdfDto.class);
	when(consentRevokationPdfDto.getRevokationType())
			.thenReturn("NO NEVER");
	SignedPDFConsentRevocation signedPDFConsentRevocation = mock(SignedPDFConsentRevocation.class);
	when(spy.makeSignedPDFConsentRevocation()).thenReturn(
			signedPDFConsentRevocation);
	spy.signConsentRevokation(consentRevokationPdfDto);
	verify(signedPDFConsentRevocation).setDocumentId(anyString());
	verify(signedPDFConsentRevocation).setDocumentNameBySender(anyString());
	verify(signedPDFConsentRevocation).setDocumentMessageBySender(
			anyString());
	verify(signedPDFConsentRevocation).setSignerEmail(anyString());
	verify(signedPDFConsentRevocation).setDocumentSignedStatus(anyString());
	verify(signedPDFConsentRevocation).setDocumentCreatedBy("Doe, John");
	verify(signedPDFConsentRevocation)
			.setDocumentSentOutForSignatureDateTime(any(Date.class));
	verify(consent).setSignedPdfConsentRevoke(signedPDFConsentRevocation);
	verify(consentRepository).save(any(Consent.class));
}