DataCfg implements ConfigurationEntry { public StorageLevel getAtomixStorageLevel() { return useMmap() ? StorageLevel.MAPPED : StorageLevel.DISK; }  @Override void init(final BrokerCfg globalConfig, final String brokerBase); List<String> getDirectories(); void setDirectories(final List<String> directories); long getLogSegmentSizeInBytes(); DataSize getLogSegmentSize(); void setLogSegmentSize(final DataSize logSegmentSize); Duration getSnapshotPeriod(); void setSnapshotPeriod(final Duration snapshotPeriod); int getLogIndexDensity(); void setLogIndexDensity(final int logIndexDensity); boolean useMmap(); void setUseMmap(final boolean useMmap); StorageLevel getAtomixStorageLevel(); boolean isDiskUsageMonitoringEnabled(); void setDiskUsageMonitoringEnabled(final boolean diskUsageMonitoringEnabled); double getDiskUsageCommandWatermark(); void setDiskUsageCommandWatermark(final double diskUsageCommandWatermark); long getFreeDiskSpaceCommandWatermark(); double getDiskUsageReplicationWatermark(); void setDiskUsageReplicationWatermark(final double diskUsageReplicationWatermark); long getFreeDiskSpaceReplicationWatermark(); Duration getDiskUsageMonitoringInterval(); void setDiskUsageMonitoringInterval(final Duration diskUsageMonitoringInterval); RocksdbCfg getRocksdb(); void setRocksdb(final RocksdbCfg rocksdb); @Override String toString(); static final String DEFAULT_DIRECTORY; }
@Test public void shouldGetDiskAtomixStorageLevelAsDefault() { final var sutDataCfg = new DataCfg(); final var actual = sutDataCfg.getAtomixStorageLevel(); assertThat(actual).isEqualTo(StorageLevel.DISK); }