@Test
public void testSaveConsent() throws Exception {

	// Arrange
	ConsentService cstSpy = spy(cst);
	Consent consent = mock(Consent.class);
	String xacmlMock = "xacmlMock";
	String policyIdMock = "policyIdMock";
	when(cstSpy.makeConsent()).thenReturn(consent);
	when(consentExportService.exportConsent2XACML(any(Consent.class)))
			.thenReturn(xacmlMock);
	when(
			consentExportService
					.exportConsent2XacmlPdfConsentFrom(any(Consent.class)))
			.thenReturn(xacmlMock);
	when(
			consentExportService
					.exportConsent2XacmlPdfConsentTo(any(Consent.class)))
			.thenReturn(xacmlMock);
	ConsentDto consentDto = mock(ConsentDto.class);
	when(consentCheckService.getConflictConsent(consentDto)).thenReturn(
			null);
	when(policyIdService.generatePolicyId(consentDto, MRN)).thenReturn(
			policyIdMock);
	Set<String> organizationalProvidersDisclosureIsMadeTo = new HashSet<String>();
	organizationalProvidersDisclosureIsMadeTo.add(NPI_1);
	Set<String> organizationalProvidersPermittedToDisclose = new HashSet<String>();
	organizationalProvidersPermittedToDisclose.add(NPI_2);
	when(consentDto.getOrganizationalProvidersDisclosureIsMadeTo())
			.thenReturn(organizationalProvidersDisclosureIsMadeTo);
	when(consentDto.getOrganizationalProvidersPermittedToDisclose())
			.thenReturn(organizationalProvidersPermittedToDisclose);
	// Act
	cstSpy.saveConsent(consentDto, 0);
	// Assert
	verify(consentRepository).save(consent);
	verify(consentAssertions).forEach(any(Consumer.class));
}