@Test public void testNoUserHome() { final Platform platform = mock(Platform.class); when(platform.getUserHome()).thenReturn(null); final ConfigDatabase config = createDatabase(platform); exception.expect(ConfigException.class); config.putGlobal("section.int", 1); }
private void setUpGeogig(GeogigCLI cli) throws Exception { final File userhome = tempFolder.newFolder("mockUserHomeDir"); final File workingDir = tempFolder.newFolder("mockWorkingDir"); tempFolder.newFolder("mockWorkingDir", ".geogig"); final Platform platform = mock(Platform.class); when(platform.pwd()).thenReturn(workingDir); when(platform.getUserHome()).thenReturn(userhome); cli.setPlatform(platform); }
@Before public final void setUp() { final File userhome = tempFolder.newFolder("mockUserHomeDir"); final File workingDir = tempFolder.newFolder("mockWorkingDir"); tempFolder.newFolder("mockWorkingDir", ".geogig"); final Platform platform = mock(Platform.class); when(platform.getUserHome()).thenReturn(userhome); when(platform.pwd()).thenReturn(workingDir); config = createDatabase(platform); }