@Test public void testGetHealthChecksReturnsHealthCheckThatTestsDiskSpace() throws IOException { final FilesystemJobSpecDAO dao = new FilesystemJobSpecDAO(createTmpDir(FilesystemJobsDAOTest.class)); assertThat(dao.getHealthChecks()).containsKeys(FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK); assertThat(dao.getHealthChecks().get(FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK)).isNotNull(); }
@Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( jobSpecsDir.toFile(), FILESYSTEM_SPECS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); }
FilesystemJobSpecDAO implements JobSpecDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( jobSpecsDir.toFile(), FILESYSTEM_SPECS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } }
FilesystemJobSpecDAO implements JobSpecDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( jobSpecsDir.toFile(), FILESYSTEM_SPECS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } FilesystemJobSpecDAO(Path jobSpecsDir); }
FilesystemJobSpecDAO implements JobSpecDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( jobSpecsDir.toFile(), FILESYSTEM_SPECS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> getHealthChecks(); @Override Optional<JobSpecSummary> getJobSpecSummaryById(JobSpecId jobSpecId); @Override List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page); @Override List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page, String query); }
FilesystemJobSpecDAO implements JobSpecDAO { @Override public Map<String, HealthCheck> getHealthChecks() { return singletonMap( FILESYSTEM_SPECS_DAO_DISK_SPACE_HEALTHCHECK, new DiskSpaceHealthCheck( jobSpecsDir.toFile(), FILESYSTEM_SPECS_DAO_DISK_SPACE_WARNING_THRESHOLD_IN_BYTES)); } FilesystemJobSpecDAO(Path jobSpecsDir); @Override Optional<JobSpec> getJobSpecById(JobSpecId jobSpecId); @Override Map<String, HealthCheck> getHealthChecks(); @Override Optional<JobSpecSummary> getJobSpecSummaryById(JobSpecId jobSpecId); @Override List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page); @Override List<JobSpecSummary> getJobSpecSummaries(int pageSize, int page, String query);  }