@Test
void createVelocityEngineWhenFailing()
{

    Throwable exception = assertThrows(XWikiVelocityException.class, () -> {
        this.velocityFactory.createVelocityEngine("somekey", new Properties());
    });
    assertEquals("Failed to create Velocity Engine", exception.getMessage());
    // Verify that the nested exception is there
    assertEquals("ComponentLookupException: Can't find descriptor for the component with type "
            + "[interface org.xwiki.velocity.VelocityEngine] and hint [null]",
        ExceptionUtils.getRootCauseMessage(exception));
}