@Test
public void testEnsurePath() throws Exception
{

    Timing timing = new Timing();
    CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
    client.start();
    try
    {
        try ( PathChildrenCache cache = new PathChildrenCache(client, "/one/two/three", false) )
        {
            cache.start();
            timing.sleepABit();
            try
            {
                client.create().forPath("/one/two/three/four");
            }
            catch ( KeeperException.NoNodeException e )
            {
                Assert.fail("Path should exist", e);
            }
        }
        timing.sleepABit();
    }
    finally
    {
        TestCleanState.closeAndTestClean(client);
    }
}