diff options
author | PawelSzalapski <pawel.szalapski@nokia.com> | 2018-08-02 10:31:56 +0200 |
---|---|---|
committer | PawelSzalapski <pawel.szalapski@nokia.com> | 2018-08-06 09:43:32 +0200 |
commit | 7752c2d818e6d19e4d805c2fd6760b4a13d601bc (patch) | |
tree | 053cbc5afd76a8b9644ec62298053aad8cf5e2a8 /src/test/java/org/onap/dcae/ApplicationSettingsTest.java | |
parent | 654ebdff4c9ec2487b819d2b76273732759de4c7 (diff) |
Implement second part of dynamic DMaaP config
VESCollector app can now fetch CBS configuration and
rebuilt the part regarding sending events dynamically,
without restarting application.
Application will still be restarted by a .sh script,
if there were changes regarding collector.properties file.
The decision of whether dynamic configuration should be
triggered is now based on existence of env vars
CONSUL_HOST, CONFIG_BINDING_SERVICE, HOSTNAME,
not as previously on CBSPOLLTIME.
Frequency at which the config check should happen is
now exposed via property from collector.properties
Change-Id: I98ff160fa51d08d84a23c716d90ceaacbe17ada6
Signed-off-by: PawelSzalapski <pawel.szalapski@nokia.com>
Issue-ID: DCAEGEN2-519
Diffstat (limited to 'src/test/java/org/onap/dcae/ApplicationSettingsTest.java')
-rw-r--r-- | src/test/java/org/onap/dcae/ApplicationSettingsTest.java | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/test/java/org/onap/dcae/ApplicationSettingsTest.java b/src/test/java/org/onap/dcae/ApplicationSettingsTest.java index b483bcb6..2ac42080 100644 --- a/src/test/java/org/onap/dcae/ApplicationSettingsTest.java +++ b/src/test/java/org/onap/dcae/ApplicationSettingsTest.java @@ -149,6 +149,26 @@ public class ApplicationSettingsTest { } @Test + public void shouldReturnConfigurationUpdateInterval() throws IOException { + // when + int updateFrequency = fromTemporaryConfiguration("collector.dynamic.config.update.frequency=10") + .configurationUpdateFrequency(); + + // then + assertEquals(10, updateFrequency); + } + + @Test + public void shouldReturnDefaultConfigurationUpdateInterval() throws IOException { + // when + int updateFrequency = fromTemporaryConfiguration() + .configurationUpdateFrequency(); + + // then + assertEquals(5, updateFrequency); + } + + @Test public void shouldReturnLocationOfThePasswordFile() throws IOException { // when String passwordFileLocation = fromTemporaryConfiguration("collector.keystore.passwordfile=/somewhere/password").keystorePasswordFileLocation(); @@ -207,7 +227,7 @@ public class ApplicationSettingsTest { @Test public void shouldReturnDMAAPConfigFileLocation() throws IOException { // when - String dmaapConfigFileLocation = fromTemporaryConfiguration("collector.dmaapfile=/somewhere/dmaapFile").cambriaConfigurationFileLocation(); + String dmaapConfigFileLocation = fromTemporaryConfiguration("collector.dmaapfile=/somewhere/dmaapFile").dMaaPConfigurationFileLocation(); // then assertEquals(sanitizePath("/somewhere/dmaapFile"), dmaapConfigFileLocation); @@ -216,7 +236,7 @@ public class ApplicationSettingsTest { @Test public void shouldReturnDefaultDMAAPConfigFileLocation() throws IOException { // when - String dmaapConfigFileLocation = fromTemporaryConfiguration().cambriaConfigurationFileLocation(); + String dmaapConfigFileLocation = fromTemporaryConfiguration().dMaaPConfigurationFileLocation(); // then assertEquals(sanitizePath("etc/DmaapConfig.json"), dmaapConfigFileLocation); @@ -390,7 +410,7 @@ public class ApplicationSettingsTest { public void shouldReturnCambriaConfigurationFileLocation() throws IOException { // when String cambriaConfigurationFileLocation = fromTemporaryConfiguration("collector.dmaapfile=/somewhere/dmaapConfig") - .cambriaConfigurationFileLocation(); + .dMaaPConfigurationFileLocation(); // then assertEquals(sanitizePath("/somewhere/dmaapConfig"), cambriaConfigurationFileLocation); @@ -400,7 +420,7 @@ public class ApplicationSettingsTest { public void shouldReturnDefaultCambriaConfigurationFileLocation() throws IOException { // when String cambriaConfigurationFileLocation = fromTemporaryConfiguration() - .cambriaConfigurationFileLocation(); + .dMaaPConfigurationFileLocation(); // then assertEquals(sanitizePath("etc/DmaapConfig.json"), cambriaConfigurationFileLocation); |