SolrDiskSpaceChecker implements DiskSpaceChecker { @Override public void configure(Map<String, Object> configuration) throws DiskSpaceCheckerException { final String dataPath = (String) configuration.get(DATA_DIR_CONFIG_OPTION); if (StringUtils.isBlank(dataPath)) { throw new DiskSpaceCheckerException("No data directory given for Solr disk space checker"); } else { try { Path path = FileSystems.getDefault().getPath(dataPath); fs = Files.getFileStore(path); } catch (IOException e) { LOGGER.error("IO Exception initialising file store: {}", e.getMessage()); throw new DiskSpaceCheckerException(e); } } }  @Override boolean isSpaceAvailable(); @Override void configure(Map<String, Object> configuration); @Override boolean requiresHttpClient(); @Override void setHttpClient(Client httpClient); @Override void setThreshold(DiskSpaceThreshold threshold); static final String DATA_DIR_CONFIG_OPTION; }
@Test(expected = uk.co.flax.harahachibu.services.DiskSpaceCheckerException.class) public void configureThrowsExceptionWhenNoDataDirConfigured() throws Exception { checker.configure(configuration); }
@Test(expected = uk.co.flax.harahachibu.services.DiskSpaceCheckerException.class) public void configureThrowsExceptionWhenDataDirNotExist() throws Exception { configuration.put(SolrDiskSpaceChecker.DATA_DIR_CONFIG_OPTION, "/no_such_path"); checker.configure(configuration); }