UpdateConfiguration { public UpdateStrategy getStrategy() { return UpdateStrategy.valueOf(properties.getProperty(UPDATE_STRATEGY)); } UpdateConfiguration(Properties properties); String getApplicationName(); UpdateStrategy getStrategy(); String getLocationForFixedVersion(); RepositoryType repositoryTypeForLatestVersion(); String repositoryLocationForLatestVersion(); static final String UPDATE_APPLICATION_NAME; static final String UPDATE_STRATEGY; static final String UPDATE_LATEST_VERSION_REPOSITORY_TYPE; static final String UPDATE_FIXED_VERSION_LOCATION; static final String UPDATE_LATEST_VERSION_REPOSITORY_LOCATION; }
@Test public void knowsFixedVersionStrategy() throws Exception { properties.put("update.strategy", "FixedVersion"); assertThat(configuration.getStrategy(), is(UpdateStrategy.FixedVersion)); }
@Test public void knowsLatestVersionStrategy() throws Exception { properties.put("update.strategy", "LatestVersion"); assertThat(configuration.getStrategy(), is(UpdateStrategy.LatestVersion)); }