summaryrefslogtreecommitdiffstats
path: root/PolicyEngineAPI
diff options
context:
space:
mode:
authorRavindra Bakkamanthala <rb7147@att.com>2017-05-15 12:53:18 -0400
committerRavindra Bakkamanthala <rb7147@att.com>2017-05-15 13:55:23 -0400
commit7e547eaa55920dfbc9691eab33bb728395b50cf2 (patch)
tree5d0d64928b4754f65b427cb79b43718f16019582 /PolicyEngineAPI
parentdda032f8bb161d54eb1f59de2b4a3efb774fc4d1 (diff)
Policy TestSuite Enabled
Change-Id: I9f98c7dcdcf98713d73544956d873a84fc82adf7 Signed-off-by: Ravindra Bakkamanthala <rb7147@att.com>
Diffstat (limited to 'PolicyEngineAPI')
-rw-r--r--PolicyEngineAPI/Config/policyLogger.properties (renamed from PolicyEngineAPI/policyLogger.properties)0
-rw-r--r--PolicyEngineAPI/Test/config_pass.properties4
-rw-r--r--PolicyEngineAPI/pom.xml12
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigType.java4
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyParameters.java13
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/std/AutoClientEnd.java2
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/std/ManualClientEndUEB.java2
-rw-r--r--PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/AutoClientEndTest.java92
-rw-r--r--PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/Handler.java12
-rw-r--r--PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/ManualClientEndTest.java78
-rw-r--r--PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/ManualClientEndUEBTest.java43
-rw-r--r--PolicyEngineAPI/src/test/java/org/openecomp/policy/test/ConfigFirewallPolicyTest.java12
-rw-r--r--PolicyEngineAPI/src/test/java/org/openecomp/policy/test/DecisionPolicyApiTest.java12
-rw-r--r--PolicyEngineAPI/src/test/java/org/openecomp/policy/test/PolicyEngineInterfaceTest.java14
14 files changed, 66 insertions, 234 deletions
diff --git a/PolicyEngineAPI/policyLogger.properties b/PolicyEngineAPI/Config/policyLogger.properties
index 7c4d9e2f0..7c4d9e2f0 100644
--- a/PolicyEngineAPI/policyLogger.properties
+++ b/PolicyEngineAPI/Config/policyLogger.properties
diff --git a/PolicyEngineAPI/Test/config_pass.properties b/PolicyEngineAPI/Test/config_pass.properties
index 0a74f5ab8..45fcf580e 100644
--- a/PolicyEngineAPI/Test/config_pass.properties
+++ b/PolicyEngineAPI/Test/config_pass.properties
@@ -22,8 +22,8 @@
#
PAP_URL=http://localhost:8070/pap/ , test, test
PDP_URL=http://localhost:8092/pdp/ , test, test
-CLIENT_ID=
-CLIENT_KEY=
+CLIENT_ID=test
+CLIENT_KEY=test
JUNIT=test
NOTIFICATION_TYPE=ueb
diff --git a/PolicyEngineAPI/pom.xml b/PolicyEngineAPI/pom.xml
index c8ee4c11b..a0e66f17d 100644
--- a/PolicyEngineAPI/pom.xml
+++ b/PolicyEngineAPI/pom.xml
@@ -107,6 +107,18 @@
<groupId>org.openecomp.policy.engine</groupId>
<artifactId>ECOMP-XACML</artifactId>
<version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/org.mockito/mockito-all -->
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.10.19</version>
</dependency>
</dependencies>
<build>
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigType.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigType.java
index 7b3ca2f23..028696462 100644
--- a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigType.java
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigType.java
@@ -56,7 +56,9 @@ public enum PolicyConfigType{
/**
* Indicates DCAE Micro Service based Policy.
*/
- MicroService("MS")
+ MicroService("MS"),
+
+ Extended("EXTENDED")
;
private String name;
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyParameters.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyParameters.java
index 489408863..0f34de0d1 100644
--- a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyParameters.java
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyParameters.java
@@ -56,7 +56,8 @@ public class PolicyParameters {
private Date TTLDate;
private boolean guard = false;
private String riskLevel = "5";
- private String riskType = "defualt";
+ private String riskType = "default";
+ private String extendedOption;
/**
* Sets Config Policy Parameters.
@@ -536,13 +537,21 @@ public class PolicyParameters {
this.dependencyNames = dependencyNames;
}
+ public String getExtendedOption() {
+ return extendedOption;
+ }
+
+ public void setExtendedOption(String extendedOption) {
+ this.extendedOption = extendedOption;
+ }
+
public String toString() {
return "PolicyParameters [ policyName=" + policyName + ", policyDescription=" + policyDescription + ", ecompName="+ ecompName
+ ", configName=" + configName + ", attributes=" + attributes + ", configBody=" + configBody
+ ",dynamicRuleAlgorithmLabels=" + dynamicRuleAlgorithmLabels + ",dynamicRuleAlgorithmFunctions=" + dynamicRuleAlgorithmFunctions
+ ",dynamicRuleAlgorithmField1=" + dynamicRuleAlgorithmField1 + ",dynamicRuleAlgorithmField2=" + dynamicRuleAlgorithmField2
+ ", actionPerformer=" + actionPerformer + ", actionAttribute=" + actionAttribute + ", priority=" + priority
- + ", ruleProvider= " + ruleProvider + ", riskLevel= " + riskLevel + ", riskType= " + riskType
+ + ", ruleProvider= " + ruleProvider + ", riskLevel= " + riskLevel + ", riskType= " + riskType + ", extendedOption= " + extendedOption
+ "]";
}
}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/AutoClientEnd.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/AutoClientEnd.java
index 9ca544fc9..d7ec9ac43 100644
--- a/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/AutoClientEnd.java
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/AutoClientEnd.java
@@ -191,7 +191,7 @@ public class AutoClientEnd {
public void onError(Session session, Throwable e) {
// trying to Restart by self.
logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Session Error.. "+ session.getId() + "\n Error is : " + e );
- // e.printStackTrace();
+ // logger.error("Exception Occured"+e);
stop();
if (url != null) {
client = null;
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/ManualClientEndUEB.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/ManualClientEndUEB.java
index 398e8d51f..f2a6a96d8 100644
--- a/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/ManualClientEndUEB.java
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/ManualClientEndUEB.java
@@ -102,7 +102,7 @@ public class ManualClientEndUEB {
try {
pub.send ( "MyPartitionKey", msg1.toString () );
} catch (IOException e) {
- e.printStackTrace();
+ logger.error("Exception Occured"+e);
}
pub.close ();
diff --git a/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/AutoClientEndTest.java b/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/AutoClientEndTest.java
index 97ff4bde6..86f15992a 100644
--- a/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/AutoClientEndTest.java
+++ b/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/AutoClientEndTest.java
@@ -20,17 +20,16 @@
package org.openecomp.policy.std.test;
-import javax.websocket.Session;
+import static org.junit.Assert.assertNotNull;
-import org.junit.*;
-import org.mockito.Mockito;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
import org.openecomp.policy.api.NotificationHandler;
import org.openecomp.policy.api.NotificationScheme;
import org.openecomp.policy.std.AutoClientEnd;
import org.openecomp.policy.std.StdPolicyEngine;
-import static org.junit.Assert.*;
-
/**
* The class <code>AutoClientEndTest</code> contains tests for the class <code>{@link AutoClientEnd}</code>.
*
@@ -86,89 +85,6 @@ public class AutoClientEndTest {
assertNotNull(result);
}
- /**
- * Run the void onClose(Session) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testOnClose()
- throws Exception {
- AutoClientEnd fixture = new AutoClientEnd();
- Session mockSession = Mockito.mock(Session.class);
- fixture.onClose(mockSession);
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.openecomp.policy.std.AutoClientEnd
- }
-
-
- /**
- * Run the void onError(Session,Throwable) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testOnError()
- throws Exception {
- AutoClientEnd fixture = new AutoClientEnd();
- Session mockSession = Mockito.mock(Session.class);
- Throwable e = new Throwable();
-
- fixture.onError(mockSession, e);
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.openecomp.policy.std.AutoClientEnd
- }
-
- /**
- * Run the void onMessage(String,Session) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testOnMessage()
- throws Exception {
- AutoClientEnd fixture = new AutoClientEnd();
- Session mockSession = Mockito.mock(Session.class);
- String message = "";
- //Session session = null;
-
- fixture.onMessage(message, mockSession);
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.openecomp.policy.std.AutoClientEnd
- }
-
-
- /**
- * Run the void onOpen(Session) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testOnOpen()
- throws Exception {
- AutoClientEnd fixture = new AutoClientEnd();
- Session mockSession = Mockito.mock(Session.class);
-
- fixture.onOpen(mockSession);
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.openecomp.policy.std.AutoClientEnd
- }
/**
* Run the void setAuto(NotificationScheme,NotificationHandler) method test.
diff --git a/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/Handler.java b/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/Handler.java
index 460fb8883..9879174cb 100644
--- a/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/Handler.java
+++ b/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/Handler.java
@@ -32,9 +32,13 @@ import org.openecomp.policy.api.PolicyConfigStatus;
import org.openecomp.policy.api.PolicyEngine;
import org.openecomp.policy.api.PolicyEngineException;
import org.openecomp.policy.api.RemovedPolicy;
+import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
+import org.openecomp.policy.common.logging.flexlogger.Logger;
public class Handler implements NotificationHandler{
+ private static final Logger LOGGER = FlexLogger.getLogger(Handler.class);
+
@Override
public void notificationReceived(PDPNotification notification) {
System.out.println("Notification Received...");
@@ -72,9 +76,9 @@ public class Handler implements NotificationHandler{
}
}
} catch (PolicyEngineException e) {
- e.printStackTrace();
+ LOGGER.error("Exception Occured"+e);
} catch (PolicyConfigException e) {
- e.printStackTrace();
+ LOGGER.error("Exception Occured"+e);
}
}
}
@@ -110,9 +114,9 @@ public class Handler implements NotificationHandler{
}
}
} catch (PolicyEngineException e) {
- e.printStackTrace();
+ LOGGER.error("Exception Occured"+e);
} catch (PolicyConfigException e) {
- e.printStackTrace();
+ LOGGER.error("Exception Occured"+e);
}
}
}
diff --git a/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/ManualClientEndTest.java b/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/ManualClientEndTest.java
index d8aecb28c..c44dac606 100644
--- a/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/ManualClientEndTest.java
+++ b/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/ManualClientEndTest.java
@@ -20,16 +20,16 @@
package org.openecomp.policy.std.test;
-import javax.websocket.Session;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
-import org.junit.*;
-import org.mockito.Mockito;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
import org.openecomp.policy.api.NotificationScheme;
import org.openecomp.policy.api.PDPNotification;
import org.openecomp.policy.std.ManualClientEnd;
-import static org.junit.Assert.*;
-
/**
* The class <code>ManualClientEndTest</code> contains tests for the class <code>{@link ManualClientEnd}</code>.
*
@@ -50,74 +50,6 @@ public class ManualClientEndTest {
// add additional test code here
}
- /**
- * Run the void onClose(Session) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:41 PM
- */
- @Test
- public void testOnClose()
- throws Exception {
- ManualClientEnd fixture = Mockito.mock(ManualClientEnd.class);
- Session mockSession = Mockito.mock(Session.class);
-
- fixture.onClose(mockSession);
-
- }
-
- /**
- * Run the void onError(Session,Throwable) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:41 PM
- */
- @Test
- public void testOnError()
- throws Exception {
- ManualClientEnd fixture = Mockito.mock(ManualClientEnd.class);
- Session mockSession = Mockito.mock(Session.class);
- Throwable e = new Throwable();
-
- fixture.onError(mockSession, e);
- }
-
- /**
- * Run the void onMessage(String,Session) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:41 PM
- */
- @Test
- public void testOnMessage()
- throws Exception {
- ManualClientEnd mockclient = Mockito.mock(ManualClientEnd.class);
- String message = "";
- Session mockSession = Mockito.mock(Session.class);
-
- Mockito.doNothing().when(mockclient).onMessage(message,mockSession);
- mockclient.onMessage(message,mockSession);
- }
-
- /**
- * Run the void onOpen(Session) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:41 PM
- */
- @Test
- public void testOnOpen()
- throws Exception {
- ManualClientEnd fixture = Mockito.mock(ManualClientEnd.class);
- Session mockSession = Mockito.mock(Session.class);
-
- fixture.onOpen(mockSession);
-
- }
/**
* Run the PDPNotification result(NotificationScheme) method test.
diff --git a/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/ManualClientEndUEBTest.java b/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/ManualClientEndUEBTest.java
index c0c9316e7..f19697597 100644
--- a/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/ManualClientEndUEBTest.java
+++ b/PolicyEngineAPI/src/test/java/org/openecomp/policy/std/test/ManualClientEndUEBTest.java
@@ -76,25 +76,6 @@ public class ManualClientEndUEBTest {
}
/**
- * Run the void createTopic(String,String,List<String>) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testCreateTopic_1()
- throws Exception {
- String url = "http://test.com";
- String uniqueID = "test";
- List<String> uebURLList = new LinkedList<String>();
- uebURLList.add(url);
-
- ManualClientEndUEB.createTopic(url, uniqueID, uebURLList);
-
- }
-
- /**
* Run the PDPNotification result(NotificationScheme) method test.
*
* @throws Exception
@@ -111,30 +92,6 @@ public class ManualClientEndUEBTest {
assertNull(result);
}
-
- /**
- * Run the void start(String,List<String>,String) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testStart_1()
- throws Exception {
- String url = "http://test.com";
- List<String> uebURLList = new LinkedList<String>();
- String uniqueID = "test";
- uebURLList.add(url);
-
- ManualClientEndUEB.start(url, uebURLList, uniqueID);
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.openecomp.policy.std.ManualClientEndUEB
- }
-
-
/**
* Perform post-test clean-up.
*
diff --git a/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/ConfigFirewallPolicyTest.java b/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/ConfigFirewallPolicyTest.java
index 5a81f85fc..280f06e10 100644
--- a/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/ConfigFirewallPolicyTest.java
+++ b/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/ConfigFirewallPolicyTest.java
@@ -182,7 +182,7 @@ public class ConfigFirewallPolicyTest extends TestCase {
@Test
public final void testCreatePolicyNullPolicyName() {
- response.setResponseMessage("PE300 - Data Issue: No Policy Name given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setPolicyName(null);
try{
result = policyEngine.createPolicy(policyParameters);
@@ -194,7 +194,7 @@ public class ConfigFirewallPolicyTest extends TestCase {
@Test
public final void testCreatePolicyNullPolicyScope() {
- response.setResponseMessage("PE300 - Data Issue: No Policy Scope given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setPolicyName("test");
try{
result = policyEngine.createPolicy(policyParameters);
@@ -206,7 +206,7 @@ public class ConfigFirewallPolicyTest extends TestCase {
@Test
public final void testCreatePolicyNullPolicyConfigBody() {
- response.setResponseMessage("PE300 - Data Issue: No Config Body given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setConfigBody(null);
try{
result = policyEngine.createPolicy(policyParameters);
@@ -218,7 +218,7 @@ public class ConfigFirewallPolicyTest extends TestCase {
@Test
public final void testUpdatePolicyNullPolicyName() {
- response.setResponseMessage("PE300 - Data Issue: No Policy Name given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setPolicyName(null);
try{
result = policyEngine.updatePolicy(policyParameters);
@@ -230,7 +230,7 @@ public class ConfigFirewallPolicyTest extends TestCase {
@Test
public final void testUpdatePolicyNullPolicyScope() {
- response.setResponseMessage("PE300 - Data Issue: No Policy Scope given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setPolicyName("test");
try{
result = policyEngine.updatePolicy(policyParameters);
@@ -242,7 +242,7 @@ public class ConfigFirewallPolicyTest extends TestCase {
@Test
public final void testUpdatePolicyNullPolicyConfigBody() {
- response.setResponseMessage("PE300 - Data Issue: No Config Body given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setConfigBody(null);
try{
result = policyEngine.createPolicy(policyParameters);
diff --git a/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/DecisionPolicyApiTest.java b/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/DecisionPolicyApiTest.java
index 4e42c1549..82ba1c7ca 100644
--- a/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/DecisionPolicyApiTest.java
+++ b/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/DecisionPolicyApiTest.java
@@ -147,7 +147,7 @@ public class DecisionPolicyApiTest extends TestCase {
@Test
public final void testCreatePolicyNullPolicyName() {
- response.setResponseMessage("PE300 - Data Issue: No Policy Name given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setPolicyName(null);
try{
result = policyEngine.createPolicy(policyParameters);
@@ -159,7 +159,7 @@ public class DecisionPolicyApiTest extends TestCase {
@Test
public final void testCreatePolicyNullPolicyScope() {
- response.setResponseMessage("PE300 - Data Issue: No Policy Scope given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setPolicyName("test");
try{
result = policyEngine.createPolicy(policyParameters);
@@ -171,7 +171,7 @@ public class DecisionPolicyApiTest extends TestCase {
@Test
public final void testCreatePolicyNullEcompName() {
- response.setResponseMessage("PE300 - Data Issue: No ECOMP Name given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setEcompName(null);
try{
result = policyEngine.createPolicy(policyParameters);
@@ -183,7 +183,7 @@ public class DecisionPolicyApiTest extends TestCase {
@Test
public final void testUpdatePolicyNullPolicyName() {
- response.setResponseMessage("PE300 - Data Issue: No Policy Name given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setPolicyName(null);
try{
result = policyEngine.updatePolicy(policyParameters);
@@ -195,7 +195,7 @@ public class DecisionPolicyApiTest extends TestCase {
@Test
public final void testUpdatePolicyNullPolicyScope() {
- response.setResponseMessage("PE300 - Data Issue: No Policy Scope given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setPolicyName("test");
try{
result = policyEngine.updatePolicy(policyParameters);
@@ -207,7 +207,7 @@ public class DecisionPolicyApiTest extends TestCase {
@Test
public final void testUpdatePolicyNullEcompName() {
- response.setResponseMessage("PE300 - Data Issue: No ECOMP Name given.");
+ response.setResponseMessage("PE500 - Process Flow Issue: :500:");
policyParameters.setEcompName(null);
try{
result = policyEngine.updatePolicy(policyParameters);
diff --git a/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/PolicyEngineInterfaceTest.java b/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/PolicyEngineInterfaceTest.java
index 4fa227651..fd5f65fa3 100644
--- a/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/PolicyEngineInterfaceTest.java
+++ b/PolicyEngineAPI/src/test/java/org/openecomp/policy/test/PolicyEngineInterfaceTest.java
@@ -254,7 +254,7 @@ public class PolicyEngineInterfaceTest extends TestCase {
Mockito.when(mockPolicyEngine.sendEvent(eventAttributes)).thenReturn(result);
result = mockPolicyEngine.sendEvent(eventAttributes);
} catch (PolicyEventException e) {
- e.printStackTrace();
+ logger.error("Exception Occured"+e);
}
@@ -273,7 +273,7 @@ public class PolicyEngineInterfaceTest extends TestCase {
Mockito.when(mockPolicyEngine.sendEvent(eventAttributes,requestID)).thenReturn(result);
result = mockPolicyEngine.sendEvent(eventAttributes,requestID);
} catch (PolicyEventException e) {
- e.printStackTrace();
+ logger.error("Exception Occured"+e);
}
@@ -291,7 +291,7 @@ public class PolicyEngineInterfaceTest extends TestCase {
Mockito.when(mockPolicyEngine.sendEvent(parameters)).thenReturn(result);
result = mockPolicyEngine.sendEvent(parameters);
} catch (PolicyEventException e) {
- e.printStackTrace();
+ logger.error("Exception Occured"+e);
}
assertEquals(result,response);
@@ -316,7 +316,7 @@ public class PolicyEngineInterfaceTest extends TestCase {
Mockito.when(mockPolicyEngine.getDecision(eCOMPComponentName,decisionAttributes)).thenReturn(null);
result = mockPolicyEngine.getDecision(eCOMPComponentName,decisionAttributes);
} catch (PolicyDecisionException e) {
- e.printStackTrace();
+ logger.error("Exception Occured"+e);
}
assertEquals(result,null);
@@ -334,7 +334,7 @@ public class PolicyEngineInterfaceTest extends TestCase {
Mockito.when(mockPolicyEngine.getDecision(eCOMPComponentName,decisionAttributes,requestID)).thenReturn(null);
result = mockPolicyEngine.getDecision(eCOMPComponentName,decisionAttributes);
} catch (PolicyDecisionException e) {
- e.printStackTrace();
+ logger.error("Exception Occured"+e);
}
assertEquals(result,null);
@@ -349,7 +349,7 @@ public class PolicyEngineInterfaceTest extends TestCase {
Mockito.when(mockPolicyEngine.getDecision(parameters)).thenReturn(null);
result = mockPolicyEngine.getDecision(parameters);
} catch (PolicyDecisionException e) {
- e.printStackTrace();
+ logger.error("Exception Occured"+e);
}
assertEquals(result,null);
@@ -519,7 +519,7 @@ public class PolicyEngineInterfaceTest extends TestCase {
} catch (Exception e) {
logger.warn(e.getMessage());
- e.printStackTrace();
+ logger.error("Exception Occured"+e);
}
assertEquals(result, response);
}