summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/eventmanager/src')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java16
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java18
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java4
3 files changed, 21 insertions, 17 deletions
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
index bb349591e..4b438a94d 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
@@ -791,7 +791,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
}
/**
- * Does provisioning status, for an event, have a value other than ACTIVE?
+ * Does provisioning status, for an event, have a value other than ACTIVE.
*
* @param event the event
* @return {@code true} if the provisioning status is neither ACTIVE nor {@code null},
@@ -829,11 +829,11 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
try {
if (vserverName != null) {
- String aaiHostURL = PolicyEngine.manager.getEnvironmentProperty("aai.url");
+ String aaiHostUrl = PolicyEngine.manager.getEnvironmentProperty("aai.url");
String aaiUser = PolicyEngine.manager.getEnvironmentProperty("aai.username");
String aaiPassword = PolicyEngine.manager.getEnvironmentProperty("aai.password");
String aaiGetQueryByVserver = "/aai/v11/nodes/vservers?vserver-name=";
- String url = aaiHostURL + aaiGetQueryByVserver;
+ String url = aaiHostUrl + aaiGetQueryByVserver;
logger.info("AAI Host URL by VServer: {}", url);
response = new AaiManager(new RESTManager()).getQueryByVserverName(url, aaiUser, aaiPassword, requestId,
vserverName);
@@ -859,20 +859,20 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
String vnfName = event.getAai().get(GENERIC_VNF_VNF_NAME);
String vnfId = event.getAai().get(GENERIC_VNF_VNF_ID);
- String aaiHostURL = PolicyEngine.manager.getEnvironmentProperty("aai.url");
+ String aaiHostUrl = PolicyEngine.manager.getEnvironmentProperty("aai.url");
String aaiUser = PolicyEngine.manager.getEnvironmentProperty("aai.username");
String aaiPassword = PolicyEngine.manager.getEnvironmentProperty("aai.password");
try {
if (vnfName != null) {
String aaiGetQueryByVnfName = "/aai/v11/network/generic-vnfs/generic-vnf?vnf-name=";
- String url = aaiHostURL + aaiGetQueryByVnfName;
+ String url = aaiHostUrl + aaiGetQueryByVnfName;
logger.info("AAI Host URL by VNF name: {}", url);
response = new AaiManager(new RESTManager()).getQueryByVnfName(url, aaiUser, aaiPassword, requestId,
vnfName);
} else if (vnfId != null) {
String aaiGetQueryByVnfId = "/aai/v11/network/generic-vnfs/generic-vnf/";
- String url = aaiHostURL + aaiGetQueryByVnfId;
+ String url = aaiHostUrl + aaiGetQueryByVnfId;
logger.info("AAI Host URL by VNF ID: {}", url);
response =
new AaiManager(new RESTManager()).getQueryByVnfId(url, aaiUser, aaiPassword, requestId, vnfId);
@@ -890,13 +890,13 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
* @return output from the AAI vserver named-query
*/
public AaiNqResponseWrapper getNqVserverFromAai() {
- if(nqVserverResponse != null) {
+ if (nqVserverResponse != null) {
// already queried
return nqVserverResponse;
}
String vserverName = onset.getAai().get(VSERVER_VSERVER_NAME);
- if(vserverName == null) {
+ if (vserverName == null) {
logger.warn("Missing vserver-name for AAI request {}", onset.getRequestId());
return null;
}
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java
index 1b2d8db61..562a46e4e 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -44,9 +45,9 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onap.policy.aai.AaiGetVnfResponse;
import org.onap.policy.aai.AaiGetVserverResponse;
-import org.onap.policy.aai.AaiNqVServer;
import org.onap.policy.aai.AaiNqRequestError;
import org.onap.policy.aai.AaiNqResponseWrapper;
+import org.onap.policy.aai.AaiNqVServer;
import org.onap.policy.aai.RelatedToProperty;
import org.onap.policy.aai.Relationship;
import org.onap.policy.aai.RelationshipData;
@@ -101,6 +102,9 @@ public class ControlLoopEventManagerTest {
HttpServletServer.factory.destroy();
}
+ /**
+ * Setup.
+ */
@Before
public void setUp() {
onset = new VirtualControlLoopEvent();
@@ -368,7 +372,7 @@ public class ControlLoopEventManagerTest {
*/
public static AaiGetVserverResponse getQueryByVserverName2(String urlGet, String username, String password,
UUID requestId, String key) {
- AaiGetVserverResponse response = new AaiGetVserverResponse();
+ final AaiGetVserverResponse response = new AaiGetVserverResponse();
AaiNqVServer svr = new AaiNqVServer();
@@ -1049,7 +1053,7 @@ public class ControlLoopEventManagerTest {
}
@Test
- public void testProcessVNFResponse_Success() throws Exception {
+ public void testProcessVnfResponse_Success() throws Exception {
AaiGetVnfResponse resp = new AaiGetVnfResponse();
resp.setIsClosedLoopDisabled(false);
resp.setProvStatus(ControlLoopEventManager.PROV_STATUS_ACTIVE);
@@ -1057,7 +1061,7 @@ public class ControlLoopEventManagerTest {
}
@Test
- public void testProcessVNFResponse_NullResponse() throws Exception {
+ public void testProcessVnfResponse_NullResponse() throws Exception {
thrown.expect(AaiException.class);
thrown.expectMessage("AAI Response is null (query by vnf-id)");
@@ -1066,7 +1070,7 @@ public class ControlLoopEventManagerTest {
}
@Test
- public void testProcessVNFResponse_Error() throws Exception {
+ public void testProcessVnfResponse_Error() throws Exception {
thrown.expect(AaiException.class);
thrown.expectMessage("AAI Responded with a request error (query by vnf-name)");
@@ -1080,7 +1084,7 @@ public class ControlLoopEventManagerTest {
}
@Test
- public void testProcessVNFResponse_Disabled() throws Exception {
+ public void testProcessVnfResponse_Disabled() throws Exception {
thrown.expect(AaiException.class);
thrown.expectMessage("is-closed-loop-disabled is set to true (query by vnf-id)");
@@ -1091,7 +1095,7 @@ public class ControlLoopEventManagerTest {
}
@Test
- public void testProcessVNFResponse_Inactive() throws Exception {
+ public void testProcessVnfResponse_Inactive() throws Exception {
thrown.expect(AaiException.class);
thrown.expectMessage("prov-status is not ACTIVE (query by vnf-name)");
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java
index cd541cf66..46452974e 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java
@@ -454,10 +454,10 @@ public class ControlLoopOperationManagerTest {
clom.startOperation(onsetEvent);
- assertEquals("actor=SO,operation=Restart,target=Target [type=VFC, resourceID=null],subRequestId=1",
+ assertEquals("actor=SO,operation=Restart,target=Target [type=VFC, resourceId=null],subRequestId=1",
clom.getOperationMessage());
assertEquals(
- "actor=SO,operation=Restart,target=Target [type=VFC, resourceID=null],subRequestId=1, Guard result: "
+ "actor=SO,operation=Restart,target=Target [type=VFC, resourceId=null],subRequestId=1, Guard result: "
+ "The Wizard Escaped",
clom.getOperationMessage("The Wizard Escaped"));