@SuppressWarnings("unchecked")
@Test
public void testBuildConsent2Cdar2_ConsentGenException()
		throws ConsentGenException {

	// Arrange
	thrown.expect(ConsentGenException.class);
	final long consentId = 1;
	final String cdar2XslUrlStrMock = "cdar2XslUrlStrMock";
	final ConsentDto consentDtoMock = mock(ConsentDto.class);
	when(consentDtoFactoryMock.createConsentDto(anyLong())).thenReturn(
			consentDtoMock);
	when(xacmlXslUrlProvider.getUrl(XslResource.CDAR2XSLNAME)).thenReturn(
			cdar2XslUrlStrMock);
	when(
			xmlTransformerMock.transform(eq(consentDtoMock),
					eq(cdar2XslUrlStrMock), isA(Optional.class),
					isA(Optional.class))).thenThrow(
			new RuntimeException("Error in saxon transform"));
	// Act
	sut.buildConsent2Cdar2(consentId);
	// Assert
}