@Test
public void testHandleError_withInvalidApplicationException_withDetails() {

	RoboconfError error = new RoboconfError( CMD_CANNOT_HAVE_ANY_PARENT, value( "t" ));
	Exception e = new InvalidApplicationException( error );
	Response response = RestServicesUtils.handleError(
			Status.FORBIDDEN,
			new RestError( REST_APP_EXEC_ERROR, e, name( "titi" )),
			null ).build();
	Assert.assertEquals( Status.FORBIDDEN.getStatusCode(), response.getStatus());
	StringBuilder expected = new StringBuilder();
	expected.append( "{\"reason\":\"" );
	expected.append( tb.getString( REST_APP_EXEC_ERROR.toString()));
	expected.append( " Name: titi. " );
	expected.append( "Exception Type: net.roboconf.dm.management.exceptions.InvalidApplicationException." );
	expected.append( " Log Reference: " );
	Assert.assertTrue( response.getEntity().toString().startsWith( expected.toString()));
	expected = new StringBuilder();
	expected.append( "\\n\\n" );
	expected.append( tb.getString( CMD_CANNOT_HAVE_ANY_PARENT.toString()));
	expected.append( " Value: t\"}" );
	Assert.assertTrue( response.getEntity().toString().endsWith( expected.toString()));
}