AbstractBackupWriterConfig { String getBackupType() { String value = properties.getProperty(TYPE); if (StringUtils.isBlank(value)) { throw new IllegalStateException("Type is missing"); } return value; } AbstractBackupWriterConfig(Properties properties);   }
@Test public void getBackupTypeThrowsIfMissing() { assertThatThrownBy(() -> config.getBackupType()).isInstanceOf(IllegalStateException.class); }
@Test public void getBackupTypeThrowsIfBlank() { properties.setProperty(TYPE, ""); assertThatThrownBy(() -> config.getBackupType()).isInstanceOf(IllegalStateException.class); }
@Test public void getBackupTypeReturnsCorrectString() { properties.setProperty(TYPE, type); assertThat(config.getBackupType()).isEqualTo(type); }