ConfigurationSource { public static Configuration createFromPropertiesResource(final File propertiesFile) { Properties properties; try { log.info("Loading Properties from : {}", propertiesFile); properties = loadProperties(propertiesFile); log.info("Properties loaded : {}", properties); } catch (final IOException e) { log.error("Failure while loading Properties file {}", propertiesFile, e); properties = new Properties(); } final ApplicationConfig applicationConfig = ConfigFactory.create(ApplicationConfig.class, properties); return new Configuration(propertiesFile, applicationConfig); }  static Configuration createFromDefaultProfile(); static Configuration createFromProfile(final String profileId); static Configuration createFromPropertiesResource(final File propertiesFile);  }
@Test void shouldCreateFromPropertiesResource() { Configuration result = ConfigurationSource.createFromPropertiesResource(new File(resourcesFolder, "GazePlay.properties")); assertEquals("eng", result.getLanguage()); }
@Test void givenPropertiesFileNotFound_shouldCreateDefaultProperties() { Configuration result = ConfigurationSource.createFromPropertiesResource(new File(localDataFolder, "wrong.properties")); assertEquals(500, result.getFixationLength()); }