@Test
public void shouldStartRepositoryUsingLocalEnvironmentWithDefaultPersistenceConfiguration() throws Exception {

    // Create the repository configuration ...
    String configFilePath = "config/repo-config-inmemory-no-persistence.json";
    InputStream configFileStream = getClass().getClassLoader().getResourceAsStream(configFilePath);
    RepositoryConfiguration repositoryConfiguration = RepositoryConfiguration.read(configFileStream, "doesn't matter");
    LocalEnvironment environment = new LocalEnvironment();
    repositoryConfiguration = repositoryConfiguration.with(environment);
    // Start the engine and repository ...
    ModeShapeEngine engine = new ModeShapeEngine();
    engine.start();
    try {
        JcrRepository repository = engine.deploy(repositoryConfiguration);
        Session session = repository.login();
        Node root = session.getRootNode();
        root.addNode("Library", "nt:folder");
        session.save();
        session.logout();
        session = repository.login();
        Node library = session.getNode("/Library");
        assertThat(library, is(notNullValue()));
        assertThat(library.getPrimaryNodeType().getName(), is("nt:folder"));
        session.logout();
    } finally {
        engine.shutdown().get();
        environment.shutdown();
    }
}