summaryrefslogtreecommitdiffstats
path: root/PolicyEngineAPI/src/test/java/org/onap
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-03-06 14:44:41 +0100
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-03-06 16:17:04 +0100
commit8a4b697dc3d0a5556bdb4135dea0d43d0b4bfd0f (patch)
treebe39eb83a6d8413cd25749fa580be194c5f55084 /PolicyEngineAPI/src/test/java/org/onap
parent0ca791ec99d07b563cc28949d205c29b663437c1 (diff)
Add new constructor
Add a new constructor to PolicyEngine to support Properties parameters instead of a file. Issue-ID: CLAMP-136 Change-Id: Id82a736cac8ac5603ff3627a9ce2ac5af4197a45 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'PolicyEngineAPI/src/test/java/org/onap')
-rw-r--r--PolicyEngineAPI/src/test/java/org/onap/policy/std/StdPolicyEngineTest.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/PolicyEngineAPI/src/test/java/org/onap/policy/std/StdPolicyEngineTest.java b/PolicyEngineAPI/src/test/java/org/onap/policy/std/StdPolicyEngineTest.java
index d4c1012cf..1218f1914 100644
--- a/PolicyEngineAPI/src/test/java/org/onap/policy/std/StdPolicyEngineTest.java
+++ b/PolicyEngineAPI/src/test/java/org/onap/policy/std/StdPolicyEngineTest.java
@@ -142,6 +142,16 @@ public class StdPolicyEngineTest {
assertEquals(Arrays.asList(UEB, DMAAP), policyEngine.getNotificationType());
assertEquals(Arrays.asList(SERVER_NAME, SERVER_NAME), policyEngine.getNotificationURLList());
}
+
+ @Test
+ public void testStdPolicyEngineWithPropertiesInitialize_noException() throws Exception {
+ final StdPolicyEngine policyEngine = new StdPolicyEngine(getDefaultProperties(), (String) null);
+ policyEngine.setScheme(NotificationScheme.MANUAL_NOTIFICATIONS);
+ assertEquals("TEST", StdPolicyEngine.getEnvironment());
+ assertEquals("http://localhost:8092/pdp/", StdPolicyEngine.getPDPURL());
+ assertEquals(Arrays.asList(UEB, DMAAP), policyEngine.getNotificationType());
+ assertEquals(Arrays.asList(SERVER_NAME, SERVER_NAME), policyEngine.getNotificationURLList());
+ }
@Test
public void testStdPolicyEngineInitializeWithSingleServerName_noException() throws Exception {
@@ -194,7 +204,12 @@ public class StdPolicyEngineTest {
@Test(expected = PolicyEngineException.class)
public void testStdPolicyEngineInitialize_NullArguments_Exception() throws Exception {
- new StdPolicyEngine(null, (String) null);
+ new StdPolicyEngine((String)null, (String) null);
+ }
+
+ @Test(expected = PolicyEngineException.class)
+ public void testStdPolicyEngineWithPropertiesInitialize_NullArguments_Exception() throws Exception {
+ new StdPolicyEngine((Properties)null, (String) null);
}
@Test(expected = PolicyEngineException.class)