use of org.neo4j.commandline.admin.OutsideWorld in project neo4j by neo4j.
the class ImportCommandTest method defaultsToCsvWhenModeNotSpecified.
@Test
public void defaultsToCsvWhenModeNotSpecified() throws Exception {
File homeDir = testDir.directory("home");
ImporterFactory mockImporterFactory = mock(ImporterFactory.class);
when(mockImporterFactory.getImporterForMode(eq("csv"), any(Args.class), any(Config.class), any(OutsideWorld.class))).thenReturn(mock(Importer.class));
try (RealOutsideWorld outsideWorld = new RealOutsideWorld()) {
ImportCommand importCommand = new ImportCommand(homeDir.toPath(), testDir.directory("conf").toPath(), outsideWorld, mockImporterFactory);
String[] arguments = { "--database=foo", "--from=bar" };
importCommand.execute(arguments);
verify(mockImporterFactory).getImporterForMode(eq("csv"), any(Args.class), any(Config.class), any(OutsideWorld.class));
}
}
use of org.neo4j.commandline.admin.OutsideWorld in project neo4j by neo4j.
the class SetDefaultAdminCommandTest method setup.
@Before
public void setup() throws IOException, InvalidArgumentsException {
OutsideWorld mock = mock(OutsideWorld.class);
when(mock.fileSystem()).thenReturn(fileSystem);
setDefaultAdmin = new SetDefaultAdminCommand(testDir.directory("home").toPath(), testDir.directory("conf").toPath(), mock);
config = setDefaultAdmin.loadNeo4jConfig();
UserRepository users = CommunitySecurityModule.getUserRepository(config, NullLogProvider.getInstance(), fileSystem);
users.create(new User.Builder("jake", Credential.forPassword("123")).withRequiredPasswordChange(false).build());
adminIniFile = new File(CommunitySecurityModule.getUserRepositoryFile(config).getParentFile(), "admin.ini");
}
use of org.neo4j.commandline.admin.OutsideWorld in project neo4j by neo4j.
the class SetInitialPasswordCommandTest method setup.
@Before
public void setup() {
fileSystem = fileSystemRule.get();
OutsideWorld mock = mock(OutsideWorld.class);
when(mock.fileSystem()).thenReturn(fileSystem);
setPasswordCommand = new SetInitialPasswordCommand(testDir.directory("home").toPath(), testDir.directory("conf").toPath(), mock);
authInitFile = CommunitySecurityModule.getInitialUserRepositoryFile(setPasswordCommand.loadNeo4jConfig());
authFile = CommunitySecurityModule.getUserRepositoryFile(setPasswordCommand.loadNeo4jConfig());
}
Aggregations