aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap
diff options
context:
space:
mode:
authorSébastien Determe <sd378r@intl.att.com>2018-04-12 07:30:13 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-12 07:30:13 +0000
commit58f42afe1dd9176a29d163ebcc323916a57fa37c (patch)
tree55d28635b3cc00da20380e18297b0329a45f03e9 /src/test/java/org/onap
parent2616c5dad88f6f66f9c303b301cbc2462e35c4b8 (diff)
parent42765b28e9008a0932ddf0300b2f77bcf8deaae3 (diff)
Merge "Improve policy Config"
Diffstat (limited to 'src/test/java/org/onap')
-rw-r--r--src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java b/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java
index 71cd9f6b8..c7f0f2871 100644
--- a/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java
@@ -23,6 +23,8 @@
package org.onap.clamp.clds.it;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
@@ -37,6 +39,7 @@ import org.onap.clamp.clds.client.req.policy.OperationalPolicyReq;
import org.onap.clamp.clds.client.req.policy.PolicyClient;
import org.onap.clamp.clds.client.req.tca.TcaRequestFormatter;
import org.onap.clamp.clds.config.ClampProperties;
+import org.onap.clamp.clds.config.PolicyConfiguration;
import org.onap.clamp.clds.model.CldsEvent;
import org.onap.clamp.clds.model.properties.ModelProperties;
import org.onap.clamp.clds.model.properties.Policy;
@@ -57,6 +60,8 @@ import org.springframework.test.context.junit4.SpringRunner;
public class PolicyClientItCase {
@Autowired
+ private PolicyConfiguration policyConfiguration;
+ @Autowired
private ClampProperties refProp;
@Autowired
protected PolicyClient policyClient;
@@ -144,4 +149,30 @@ public class PolicyClientItCase {
TimeUnit.SECONDS.sleep(20);
deleteTcaPolicy(CldsEvent.ACTION_DELETE);
}
+
+ @Test
+ public void testPolicyConfiguration() {
+ assertNotNull(policyConfiguration.getPdpUrl1());
+ assertNotNull(policyConfiguration.getPdpUrl2());
+ assertNotNull(policyConfiguration.getPapUrl());
+ assertNotNull(policyConfiguration.getPolicyEnvironment());
+ assertNotNull(policyConfiguration.getClientId());
+ assertNotNull(policyConfiguration.getClientKey());
+ assertNotNull(policyConfiguration.getNotificationType());
+ assertNotNull(policyConfiguration.getNotificationUebServers());
+ assertEquals(8, policyConfiguration.getProperties().size());
+ assertTrue(((String) policyConfiguration.getProperties().get(PolicyConfiguration.PDP_URL1))
+ .contains("/pdp/ , testpdp, alpha123"));
+ assertTrue(((String) policyConfiguration.getProperties().get(PolicyConfiguration.PDP_URL2))
+ .contains("/pdp/ , testpdp, alpha123"));
+ assertTrue(((String) policyConfiguration.getProperties().get(PolicyConfiguration.PAP_URL))
+ .contains("/pap/ , testpap, alpha123"));
+ assertEquals("websocket", policyConfiguration.getProperties().get(PolicyConfiguration.NOTIFICATION_TYPE));
+ assertEquals("localhost",
+ policyConfiguration.getProperties().get(PolicyConfiguration.NOTIFICATION_UEB_SERVERS));
+ assertEquals("myclientid", policyConfiguration.getProperties().get(PolicyConfiguration.CLIENT_ID));
+ assertEquals("5CE79532B3A2CB4D132FC0C04BF916A7",
+ policyConfiguration.getProperties().get(PolicyConfiguration.CLIENT_KEY));
+ assertEquals("DEVL", policyConfiguration.getProperties().get(PolicyConfiguration.ENVIRONMENT));
+ }
}