CommonInjector extends AbstractModule { @VisibleForTesting static String getHolmesHomeSubDirectory(final String subDirName) { Path uiPath = get(HOLMES_HOME.getValue(), subDirName); if (!exists(uiPath)) { throw new HolmesRuntimeException(uiPath + " does not exist. Check " + HOLMES_HOME.getName() + " [" + HOLMES_HOME.getValue() + "] system property"); } return uiPath.toString(); } CommonInjector();   }
@Test public void testGetHolmesHomeSubDir() { File uiPath = new File(HOLMES_HOME.getValue(), "ui"); if (!uiPath.exists() && uiPath.mkdirs()) uiPath.deleteOnExit(); assertNotNull(CommonInjector.getHolmesHomeSubDirectory("ui")); }
@Test(expected = HolmesRuntimeException.class) public void testGetBadHolmesHomeSubDir() { assertNotNull(CommonInjector.getHolmesHomeSubDirectory("bad_subDir")); }