DirectoryResource tempResource = resourceFactory.create(tempDir).reify(DirectoryResource.class);
tempDir.deleteOnExit();
Shell shell = shellTest.getShell();
shell.setCurrentResource(tempResource);
Result changeDirResult = shellTest.execute("cd " + userHome.getAbsolutePath(), 10, TimeUnit.SECONDS);
Assert.assertNotNull(changeDirResult);
Assert.assertEquals(userHome, shell.getCurrentResource().getUnderlyingResourceObject());
}