final File root = folder.getRoot();
Mockito.when(datadir.getLuceneDir()).thenReturn(root);
FSDirectoryFactory directoryFactory = new FSDirectoryFactory();
directoryFactory.setDataDir(datadir);
LuceneConfig luceneConfig = Mockito.mock(LuceneConfig.class);
Mockito.when(luceneConfig.commitInterval()).thenReturn(1L);
Mockito.when(luceneConfig.useNRTManagerReopenThread()).thenReturn(false);
createAndLockFilesAndResetTracker(directoryFactory, luceneConfig, true);
assertEquals(FSDirectoryFactory.NON_SPATIAL_DIR + "_" + 1, directoryFactory.getIndexDir().getName());