@Test
public void testGetPolicies_Throws_PolicyProviderException()
		throws NoPolicyFoundException, PolicyProviderException,
		Hl7v3TransformerException, JAXBException, IOException {

	thrown.expect(PolicyProviderException.class);
	SimplePDPFactory.getSimplePDP();
	final String homeCommunityId = "homeCommunityId";
	final String intermediarySubjectNPI = "intermediarySubjectNPI";
	final String messageId = "messageId";
	final String patientId = "patientId";
	final String patientUniqueId = "patientUniqueId";
	final String purposeOfUse = "purposeOfUse";
	final String recipientSubjectNPI = "recipientSubjectNPI";
	final String xacml = "NotXacml";
	final byte[] bytes = xacml.getBytes("UTF-8");
	final XacmlRequest xacmlRequest = new XacmlRequest();
	xacmlRequest.setHomeCommunityId(homeCommunityId);
	xacmlRequest.setIntermediarySubjectNPI(intermediarySubjectNPI);
	xacmlRequest.setMessageId(messageId);
	xacmlRequest.setPatientId(patientId);
	xacmlRequest.setPatientUniqueId(patientUniqueId);
	xacmlRequest.setPurposeOfUse(purposeOfUse);
	xacmlRequest.setRecipientSubjectNPI(recipientSubjectNPI);
	final PolicyDto policyDto = mock(PolicyDto.class);
	when(
			polRepRestClient.getPoliciesCombinedAsPolicySet(anyString(),
					anyString(), anyString(),
					eq(PolicyCombiningAlgIds.DENY_OVERRIDES))).thenReturn(
			policyDto);
	when(policyDto.getPolicy()).thenReturn(bytes);
	final String hl7Query = "hl7Query";
	when(
			hl7v3Transformer.getPixQueryXml(eq(patientId), anyString(),
					eq(Hl7v3Transformer.XML_PIX_QUERY))).thenReturn(
			hl7Query);
	final PRPAIN201309UV02 req = mock(PRPAIN201309UV02.class);
	when(
			requestXMLToJava.getPIXQueryReqObject(hl7Query,
					PixManagerConstants.ENCODE_STRING)).thenReturn(req);
	final PRPAIN201310UV02 resp = mock(PRPAIN201310UV02.class);
	when(pixManagerService.pixManagerPRPAIN201309UV02(req))
			.thenReturn(resp);
	final PixManagerBean pixManagerBean = mock(PixManagerBean.class);
	when(
			pixManagerMessageHelper.getQueryMessage(eq(resp),
					any(PixManagerBean.class))).thenReturn(pixManagerBean);
	// Act
	final List<Evaluatable> response = sut.getPolicies(xacmlRequest);
	// Assert
	assertNotNull(response);
	assertTrue(response.size() == 1);
	assertNotNull(response.get(0));
}