ConfigurationUtils { private static String getVersion(Properties properties, String versionKey, String timestampKey) { String version = null; if (StringUtils.isNotEmpty(properties.getProperty(versionKey))) { version = properties.getProperty(versionKey); if (StringUtils.isNotEmpty(properties.getProperty(timestampKey))) { version = version + "_" + properties.getProperty(timestampKey); } } return version; }  static boolean isConfigurationStubbed(ClassLoader classLoader); static String getStubbedConfiguration(Configuration configuration, String originalConfig); static String getActivatedConfiguration(Configuration configuration, String originalConfig); static String getCanonicalizedConfiguration(Configuration configuration, String originalConfig); static String transformConfiguration(Configuration configuration, String originalConfig, String xslt, Map<String, Object> parameters); static String getConfigurationFile(ClassLoader classLoader, String currentConfigurationName); static String getConfigurationVersion(ClassLoader classLoader); static String getApplicationVersion(); static Map<String, Object> getConfigFromDatabase(IbisContext ibisContext, String name); static Map<String, Object> getConfigFromDatabase(IbisContext ibisContext, String name, String jmsRealm); static Map<String, Object> getConfigFromDatabase(IbisContext ibisContext, String name, String jmsRealm, String version); static boolean addConfigToDatabase(IbisContext ibisContext, String datasource, boolean activate_config, boolean automatic_reload, String fileName, InputStream file, String ruser); static String processMultiConfigZipFile(IbisContext ibisContext, String datasource, boolean activate_config, boolean automatic_reload, InputStream file, String ruser); static boolean addConfigToDatabase(IbisContext ibisContext, String datasource, boolean activate_config, boolean automatic_reload, String name, String version, String fileName, InputStream file, String ruser); static void removeConfigFromDatabase(IbisContext ibisContext, String name, String jmsRealm, String version); static boolean activateConfig(IbisContext ibisContext, String name, String version, boolean value, String jmsRealm); static boolean autoReloadConfig(IbisContext ibisContext, String name, String version, boolean booleanValue, String jmsRealm); static Map<String, String> retrieveAllConfigNames(IbisContext ibisContext); static List<String> retrieveConfigNamesFromDatabase(IbisContext ibisContext, String jmsRealm); static List<String> retrieveConfigNamesFromDatabase(IbisContext ibisContext, String jmsRealm, boolean onlyAutoReload); @Deprecated static String[] retrieveBuildInfo(InputStream inputStream); static String ADDITIONAL_PROPERTIES_FILE_SUFFIX; static final String DEFAULT_CONFIGURATION_FILE; }
@Test public void configurationValidator() throws Exception { URL zip = ConfigurationUtilsTest.class.getResource("/ConfigurationUtils/buildInfoZip.jar"); assertNotNull("BuildInfoZip not found", zip); ConfigurationUtils.ADDITIONAL_PROPERTIES_FILE_SUFFIX = ""; ConfigurationValidator details = new ConfigurationValidator(zip.openStream()); assertEquals("buildInfo name does not match", "ConfigurationName", details.getName()); assertEquals("buildInfo version does not match", "001_20191002-1300", details.getVersion()); }