@Test
public void testGeneratePolicyId_Throws_UniqueValueGeneratorException() {

	// Arrange
	when(consentRepository.findAllByConsentReferenceId(anyString()))
			.thenReturn(Arrays.asList(new Consent()));
	ConsentDto consentDto = new ConsentDto();
	Set<String> organizationalProvidersDisclosureIsMadeTo = new HashSet<String>();
	organizationalProvidersDisclosureIsMadeTo.add("111");
	Set<String> providersPermittedToDisclose = new HashSet<String>();
	providersPermittedToDisclose.add("222");
	consentDto
			.setOrganizationalProvidersDisclosureIsMadeTo(organizationalProvidersDisclosureIsMadeTo);
	consentDto
			.setProvidersPermittedToDisclose(providersPermittedToDisclose);
	thrown.expect(UniqueValueGeneratorException.class);
	// Act
	String policyId = sut.generatePolicyId(consentDto, MRNMOCK);
	// Assert
	assertTrue(StringUtils.hasText(policyId));
	assertTrue(policyId.startsWith(MRNMOCK));
	assertTrue(policyId.contains(PIDDOMAINIDMOCK));
	assertTrue(policyId.contains(PIDDOMAINTYPEMOCK));
}