UserHomeDetector implements HomeDetector { @Override public File detect() { Path path = Paths.get(System.getProperty("user.home"), ".oxalis"); if (Files.notExists(path)) return null; log.info("Using Oxalis folder relative to home folder: {}", path); return path.toFile(); }  @Override File detect();  }
@Test public void valid() throws Exception { Path path = Paths.get(getClass().getResource("/.oxalis").toURI()).getParent(); System.setProperty("user.home", path.toAbsolutePath().toString()); Assert.assertNotNull(homeDetector.detect()); }
@Test public void invalid() { System.setProperty("user.home", "/invalid"); Assert.assertNull(homeDetector.detect()); }