diff options
author | 2017-09-06 11:47:00 -0400 | |
---|---|---|
committer | 2017-09-06 11:50:20 -0400 | |
commit | 21788cc75a85a6e7b2097c5549957a38178a9197 (patch) | |
tree | 2f1cc40eeaa5190f75a5022e9178178e997855a6 /sliPluginUtils/provider/src/test/java/org | |
parent | b6ad62d01b1045ff03c03aa05ee1beeaabc633c7 (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/java/org')
-rw-r--r-- | sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java | 10 |
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 48c32f45..ab681ad2 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); |