FileSystemBackupWriterConfig extends AbstractBackupWriterConfig { String getTargetDirectory() { String value = getProperties().getProperty(TARGET_DIR); if (StringUtils.isBlank(value)) { throw new IllegalStateException("Target directory is missing"); } return value; } FileSystemBackupWriterConfig(Properties properties);   }
@Test public void getTargetDirectoryThrowsIfMissing() { assertThatThrownBy(() -> config.getTargetDirectory()).isInstanceOf(IllegalStateException.class); }
@Test public void getTargetDirectoryThrowsIfBlank() { properties.setProperty(TARGET_DIR, ""); assertThatThrownBy(() -> config.getTargetDirectory()).isInstanceOf(IllegalStateException.class); }
@Test public void getTargetDirectoryReturnsCorrectString() { properties.setProperty(TARGET_DIR, targetDir); assertThat(config.getTargetDirectory()).isEqualTo(targetDir); }