AbstractBackupWriterConfig { String getTimestamp() { String value = properties.getProperty(TIMESTAMP); if (StringUtils.isBlank(value)) { throw new IllegalStateException("Timestamp is missing"); } return value; } AbstractBackupWriterConfig(Properties properties);   }
@Test public void getTimestampThrowsIfMissing() { assertThatThrownBy(() -> config.getTimestamp()).isInstanceOf(IllegalStateException.class); }
@Test public void getTimestampThrowsIfBlank() { properties.setProperty(TIMESTAMP, ""); assertThatThrownBy(() -> config.getTimestamp()).isInstanceOf(IllegalStateException.class); }
@Test public void getTimestampReturnsCorrectString() { properties.setProperty(TIMESTAMP, timestamp); assertThat(config.getTimestamp()).isEqualTo(timestamp); }