@Test
public void testHandleMessage_Successes_Given_XDS_Returns_Success_Response()
		throws Throwable {

	// Arrange
	String consentIdMock = "1";
	byte[] revokedConsentPdf = new byte[1];
	RevokedConsentDto policyIdDto = mock(RevokedConsentDto.class);
	when(policyIdDto.getPatientEid()).thenReturn("FAM.123");
	when(policyIdDto.getXacmlCcdId()).thenReturn("PolicyId");
	when(policyIdDto.getPatientMrn()).thenReturn("locPolicyId");
	when(policyIdDto.getRevokedPdfConsent()).thenReturn(revokedConsentPdf);
	when(consentGetterMock.getRevokedConsentDto(1)).thenReturn(policyIdDto);
	when(
			marshallerMock
					.marshalWithoutRootElement(isA(XdsSrcSubmitRsp.class)))
			.thenReturn("marshalledXmlMock");
	XdsSrcSubmitRsp responsemock = mock(XdsSrcSubmitRsp.class);
	EhrResponseDetail responseDetailMock = mock(EhrResponseDetail.class);
	List<String> listSuccess = new ArrayList<String>();
	listSuccess.add("Success 1");
	when(responsemock.getResponseDetail()).thenReturn(responseDetailMock);
	when(responseDetailMock.getListSuccess()).thenReturn(listSuccess);
	when(
			spiritAdapter.deprecatePolicy("PolicyId", "locPolicyId",
					revokedConsentPdf)).thenReturn(responsemock);
	// Assert
	assertEquals("Consent is successfully revoked in XDS.b repository",
			sut.handleMessage(consentIdMock));
	verify(endpointStopperMock, times(1)).setCounter(0);
}