summaryrefslogtreecommitdiffstats
path: root/sliPluginUtils/provider/src/test
diff options
context:
space:
mode:
authorRyan Goulding <ryandgoulding@gmail.com>2017-09-06 11:47:00 -0400
committerRyan Goulding <ryandgoulding@gmail.com>2017-09-06 11:50:20 -0400
commit21788cc75a85a6e7b2097c5549957a38178a9197 (patch)
tree2f1cc40eeaa5190f75a5022e9178178e997855a6 /sliPluginUtils/provider/src/test
parentb6ad62d01b1045ff03c03aa05ee1beeaabc633c7 (diff)
Fix service registration for SDNC
sliPluginUtils was using a BundleActivator for Service Instantiation, which is prone to heisenbugs due to indeterminate service instantiation logic. This removes the BundleActivator and instantiates services using blueprint. Since dme2.properties are parsed using Properties instead of using a ManagedService, the decision was to just keep them immutable. Future work may involve making instance variables private in DME2, since currently Dme2Test performs direct member access on DME2 instance variables which is considered bad practices (violates encapsulation). Issue-Id: SDNC-54 Change-Id: Ib1155565e04e9a95d222bc4028a0845d9d81bd82 Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
Diffstat (limited to 'sliPluginUtils/provider/src/test')
-rw-r--r--sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java b/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java
index 48c32f452..ab681ad25 100644
--- a/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java
+++ b/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java
@@ -72,8 +72,9 @@ public class Dme2Test {
@Test
public void createDme2EndtoEnd() {
- SliPluginUtilsActivator activator = new SliPluginUtilsActivator();
- DME2 dme2 = activator.initDme2("src/test/resources/dme2.e2e.properties");
+ Dme2PropertiesProvider provider =
+ new Dme2PropertiesProvider("src/test/resources/dme2.e2e.properties");
+ DME2 dme2 = new DME2(provider);
assertEquals("user@sample.com", dme2.aafUserName);
assertEquals("fake", dme2.aafPassword);
assertEquals("UAT", dme2.envContext);
@@ -89,8 +90,9 @@ public class Dme2Test {
@Test
public void createDme2Prod() {
- SliPluginUtilsActivator activator = new SliPluginUtilsActivator();
- DME2 dme2 = activator.initDme2("src/test/resources/dme2.prod.properties");
+ Dme2PropertiesProvider provider =
+ new Dme2PropertiesProvider("src/test/resources/dme2.prod.properties");
+ DME2 dme2 = new DME2(provider);
assertEquals("user@sample.com", dme2.aafUserName);
assertEquals("fake", dme2.aafPassword);
assertEquals("PROD", dme2.envContext);