aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager
diff options
context:
space:
mode:
authormmis <michael.morris@ericsson.com>2018-03-27 13:13:57 +0100
committermmis <michael.morris@ericsson.com>2018-03-27 16:00:35 +0100
commit03bded5317a0c50e2a7a3c95f553f612f877ddef (patch)
treeebb1f01121f8842e087a49abf10810705b78dd46 /controlloop/common/eventmanager
parent0c2b7a2fc65ec7c8252764acafdcc3852db7b411 (diff)
Removed checkstyle warnings
Removed checkstyle warnings from: policy/drools-applications/controlloop/common/model-impl/appc policy/drools-applications/controlloop/common/model-impl/appclcm policy/drools-applications/controlloop/common/model-impl/events including changes to template files due to renamed methods Issue-ID: POLICY-705 Change-Id: Ieb93baf43268aa608f204eef1a610354f2adec32 Signed-off-by: mmis <michael.morris@ericsson.com>
Diffstat (limited to 'controlloop/common/eventmanager')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java48
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java22
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java8
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java170
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java114
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/drools/DroolsPolicyEngineTest.java14
6 files changed, 188 insertions, 188 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 39a4886a2..92b618f42 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
@@ -457,7 +457,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
//
LockResult<GuardResult, TargetLock> lockResult =
PolicyGuard.lockTarget(this.currentOperation.policy.getTarget().getType(),
- this.currentOperation.getTargetEntity(), this.onset.getRequestID(), this);
+ this.currentOperation.getTargetEntity(), this.onset.getRequestId(), this);
//
// Was it acquired?
//
@@ -613,7 +613,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
if (event.getClosedLoopControlName() == null || event.getClosedLoopControlName().length() < 1) {
throw new ControlLoopException("No control loop name");
}
- if (event.getRequestID() == null) {
+ if (event.getRequestId() == null) {
throw new ControlLoopException("No request ID");
}
if (event.getClosedLoopEventStatus() == ControlLoopEventStatus.ABATED) {
@@ -627,11 +627,11 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
&& !GENERIC_VNF_VNF_NAME.equalsIgnoreCase(event.getTarget())) {
throw new ControlLoopException("target field invalid - expecting VM_NAME or VNF_NAME");
}
- if (event.getAAI() == null) {
+ if (event.getAai() == null) {
throw new ControlLoopException("AAI is null");
}
- if (event.getAAI().get(GENERIC_VNF_VNF_ID) == null && event.getAAI().get(VSERVER_VSERVER_NAME) == null
- && event.getAAI().get(GENERIC_VNF_VNF_NAME) == null) {
+ if (event.getAai().get(GENERIC_VNF_VNF_ID) == null && event.getAai().get(VSERVER_VSERVER_NAME) == null
+ && event.getAai().get(GENERIC_VNF_VNF_NAME) == null) {
throw new ControlLoopException(
"generic-vnf.vnf-id or generic-vnf.vnf-name or vserver.vserver-name information missing");
}
@@ -644,16 +644,16 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
* @throws AaiException if an error occurs retrieving information from A&AI
*/
public void queryAai(VirtualControlLoopEvent event) throws AaiException {
- if ((event.getAAI().get(VSERVER_IS_CLOSED_LOOP_DISABLED) != null
- || event.getAAI().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED) != null) && isClosedLoopDisabled(event)) {
+ if ((event.getAai().get(VSERVER_IS_CLOSED_LOOP_DISABLED) != null
+ || event.getAai().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED) != null) && isClosedLoopDisabled(event)) {
throw new AaiException("is-closed-loop-disabled is set to true on VServer or VNF");
}
try {
- if (event.getAAI().get(GENERIC_VNF_VNF_ID) != null || event.getAAI().get(GENERIC_VNF_VNF_NAME) != null) {
+ if (event.getAai().get(GENERIC_VNF_VNF_ID) != null || event.getAai().get(GENERIC_VNF_VNF_NAME) != null) {
vnfResponse = getAAIVnfInfo(event);
- processVNFResponse(vnfResponse, event.getAAI().get(GENERIC_VNF_VNF_ID) != null);
- } else if (event.getAAI().get(VSERVER_VSERVER_NAME) != null) {
+ processVNFResponse(vnfResponse, event.getAai().get(GENERIC_VNF_VNF_ID) != null);
+ } else if (event.getAai().get(VSERVER_VSERVER_NAME) != null) {
vserverResponse = getAAIVserverInfo(event);
processVServerResponse(vserverResponse);
}
@@ -714,16 +714,16 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
* @return <code>true</code> if the contol loop is disabled, <code>false</code> otherwise
*/
public static boolean isClosedLoopDisabled(VirtualControlLoopEvent event) {
- if ("true".equalsIgnoreCase(event.getAAI().get(VSERVER_IS_CLOSED_LOOP_DISABLED))
- || "T".equalsIgnoreCase(event.getAAI().get(VSERVER_IS_CLOSED_LOOP_DISABLED))
- || "yes".equalsIgnoreCase(event.getAAI().get(VSERVER_IS_CLOSED_LOOP_DISABLED))
- || "Y".equalsIgnoreCase(event.getAAI().get(VSERVER_IS_CLOSED_LOOP_DISABLED))) {
+ if ("true".equalsIgnoreCase(event.getAai().get(VSERVER_IS_CLOSED_LOOP_DISABLED))
+ || "T".equalsIgnoreCase(event.getAai().get(VSERVER_IS_CLOSED_LOOP_DISABLED))
+ || "yes".equalsIgnoreCase(event.getAai().get(VSERVER_IS_CLOSED_LOOP_DISABLED))
+ || "Y".equalsIgnoreCase(event.getAai().get(VSERVER_IS_CLOSED_LOOP_DISABLED))) {
return true;
}
- return ("true".equalsIgnoreCase(event.getAAI().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED))
- || "T".equalsIgnoreCase(event.getAAI().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED))
- || "yes".equalsIgnoreCase(event.getAAI().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED))
- || "Y".equalsIgnoreCase(event.getAAI().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED)));
+ return ("true".equalsIgnoreCase(event.getAai().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED))
+ || "T".equalsIgnoreCase(event.getAai().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED))
+ || "yes".equalsIgnoreCase(event.getAai().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED))
+ || "Y".equalsIgnoreCase(event.getAai().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED)));
}
/**
@@ -734,9 +734,9 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
* @throws ControlLoopException if an error occurs
*/
public static AaiGetVserverResponse getAAIVserverInfo(VirtualControlLoopEvent event) throws ControlLoopException {
- UUID requestId = event.getRequestID();
+ UUID requestId = event.getRequestId();
AaiGetVserverResponse response = null;
- String vserverName = event.getAAI().get(VSERVER_VSERVER_NAME);
+ String vserverName = event.getAai().get(VSERVER_VSERVER_NAME);
try {
if (vserverName != null) {
@@ -765,10 +765,10 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
* @throws ControlLoopException if an error occurs
*/
public static AaiGetVnfResponse getAAIVnfInfo(VirtualControlLoopEvent event) throws ControlLoopException {
- UUID requestId = event.getRequestID();
+ UUID requestId = event.getRequestId();
AaiGetVnfResponse response = null;
- String vnfName = event.getAAI().get(GENERIC_VNF_VNF_NAME);
- String vnfId = event.getAAI().get(GENERIC_VNF_VNF_ID);
+ String vnfName = event.getAai().get(GENERIC_VNF_VNF_NAME);
+ String vnfId = event.getAai().get(GENERIC_VNF_VNF_ID);
aaiHostURL = PolicyEngine.manager.getEnvironmentProperty("aai.url");
aaiUser = PolicyEngine.manager.getEnvironmentProperty("aai.username");
@@ -811,7 +811,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
@Override
public String toString() {
return "ControlLoopEventManager [closedLoopControlName=" + closedLoopControlName + ", requestID=" + requestID
- + ", processor=" + processor + ", onset=" + (onset != null ? onset.getRequestID() : "null")
+ + ", processor=" + processor + ", onset=" + (onset != null ? onset.getRequestId() : "null")
+ ", numOnsets=" + numOnsets + ", numAbatements=" + numAbatements + ", isActivated=" + isActivated
+ ", currentOperation=" + currentOperation + ", targetLock=" + targetLock + "]";
}
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
index 97eaf9048..7ef2a2e04 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
@@ -35,7 +35,7 @@ import org.eclipse.persistence.config.PersistenceUnitProperties;
import org.onap.policy.aai.util.AaiException;
import org.onap.policy.appc.Response;
import org.onap.policy.appc.ResponseCode;
-import org.onap.policy.appclcm.LCMResponseWrapper;
+import org.onap.policy.appclcm.LcmResponseWrapper;
import org.onap.policy.controlloop.ControlLoopEvent;
import org.onap.policy.controlloop.ControlLoopException;
import org.onap.policy.controlloop.ControlLoopOperation;
@@ -63,7 +63,7 @@ public class ControlLoopOperationManager implements Serializable {
@Override
public String toString() {
- return "ControlLoopOperationManager [onset=" + (onset != null ? onset.getRequestID() : "null") + ", policy="
+ return "ControlLoopOperationManager [onset=" + (onset != null ? onset.getRequestId() : "null") + ", policy="
+ (policy != null ? policy.getId() : "null") + ", attempts=" + attempts + ", policyResult="
+ policyResult + ", currentOperation=" + currentOperation + ", operationHistory=" + operationHistory
+ "]";
@@ -152,15 +152,15 @@ public class ControlLoopOperationManager implements Serializable {
case VNF:
VirtualControlLoopEvent virtualOnset = (VirtualControlLoopEvent) this.onset;
if (this.onset.getTarget().equalsIgnoreCase(VSERVER_VSERVER_NAME)) {
- return virtualOnset.getAAI().get(VSERVER_VSERVER_NAME);
+ return virtualOnset.getAai().get(VSERVER_VSERVER_NAME);
} else if (this.onset.getTarget().equalsIgnoreCase(GENERIC_VNF_VNF_ID)) {
- return virtualOnset.getAAI().get(GENERIC_VNF_VNF_ID);
+ return virtualOnset.getAai().get(GENERIC_VNF_VNF_ID);
} else if (this.onset.getTarget().equalsIgnoreCase(GENERIC_VNF_VNF_NAME)) {
/*
* If the onset is enriched with the vnf-id, we don't need an A&AI response
*/
- if (virtualOnset.getAAI().containsKey(GENERIC_VNF_VNF_ID)) {
- return virtualOnset.getAAI().get(GENERIC_VNF_VNF_ID);
+ if (virtualOnset.getAai().containsKey(GENERIC_VNF_VNF_ID)) {
+ return virtualOnset.getAai().get(GENERIC_VNF_VNF_ID);
}
/*
@@ -303,11 +303,11 @@ public class ControlLoopOperationManager implements Serializable {
// Cast APPC response and handle it
//
return onResponse((Response) response);
- } else if (response instanceof LCMResponseWrapper) {
+ } else if (response instanceof LcmResponseWrapper) {
//
// Cast LCM response and handle it
//
- return onResponse((LCMResponseWrapper) response);
+ return onResponse((LcmResponseWrapper) response);
} else if (response instanceof SOResponseWrapper) {
//
// Cast SO response and handle it
@@ -335,7 +335,7 @@ public class ControlLoopOperationManager implements Serializable {
//
Integer operationAttempt = null;
try {
- operationAttempt = Integer.parseInt(appcResponse.getCommonHeader().getSubRequestID());
+ operationAttempt = Integer.parseInt(appcResponse.getCommonHeader().getSubRequestId());
} catch (NumberFormatException e) {
//
// We cannot tell what happened if this doesn't exist
@@ -422,7 +422,7 @@ public class ControlLoopOperationManager implements Serializable {
* @param dmaapResponse the LCM response
* @return The result of the response handling
*/
- private PolicyResult onResponse(LCMResponseWrapper dmaapResponse) {
+ private PolicyResult onResponse(LcmResponseWrapper dmaapResponse) {
/*
* Parse out the operation attempt using the subrequestid
*/
@@ -789,7 +789,7 @@ public class ControlLoopOperationManager implements Serializable {
OperationsHistoryDbEntry newEntry = new OperationsHistoryDbEntry();
newEntry.setClosedLoopName(this.onset.getClosedLoopControlName());
- newEntry.setRequestId(this.onset.getRequestID().toString());
+ newEntry.setRequestId(this.onset.getRequestId().toString());
newEntry.setActor(this.currentOperation.clOperation.getActor());
newEntry.setOperation(this.currentOperation.clOperation.getOperation());
newEntry.setTarget(this.targetEntity);
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java
index d5f73c741..773299dc2 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java
@@ -28,7 +28,7 @@ import java.util.Map;
import java.util.Queue;
import org.onap.policy.appc.Request;
-import org.onap.policy.appclcm.LCMRequestWrapper;
+import org.onap.policy.appclcm.LcmRequestWrapper;
import org.onap.policy.controlloop.ControlLoopNotification;
import org.onap.policy.controlloop.util.Serialization;
import org.onap.policy.drools.PolicyEngine;
@@ -74,9 +74,9 @@ public class PolicyEngineJUnitImpl implements PolicyEngine {
}
if (obj instanceof Request) {
Request request = (Request) obj;
- logger.debug("Request: {} subrequest {}", request.getAction(), request.getCommonHeader().getSubRequestID());
- } else if (obj instanceof LCMRequestWrapper) {
- LCMRequestWrapper dmaapRequest = (LCMRequestWrapper) obj;
+ logger.debug("Request: {} subrequest {}", request.getAction(), request.getCommonHeader().getSubRequestId());
+ } else if (obj instanceof LcmRequestWrapper) {
+ LcmRequestWrapper dmaapRequest = (LcmRequestWrapper) obj;
logger.debug("Request: {} subrequest {}", dmaapRequest.getBody().getAction(),
dmaapRequest.getBody().getCommonHeader().getSubRequestId());
}
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 4ff8338a6..700d1abf8 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
@@ -74,13 +74,13 @@ public class ControlLoopEventManagerTest {
{
onset = new VirtualControlLoopEvent();
onset.setClosedLoopControlName("ControlLoop-vUSP");
- onset.setRequestID(UUID.randomUUID());
+ onset.setRequestId(UUID.randomUUID());
onset.setTarget("VM_NAME");
onset.setClosedLoopAlarmStart(Instant.now());
- onset.setAAI(new HashMap<String, String>());
- onset.getAAI().put("cloud-region.identity-url", "foo");
- onset.getAAI().put("vserver.selflink", "bar");
- onset.getAAI().put("generic-vnf.vnf-id", "83f674e8-7555-44d7-9a39-bdc3770b0491");
+ onset.setAai(new HashMap<String, String>());
+ onset.getAai().put("cloud-region.identity-url", "foo");
+ onset.getAai().put("vserver.selflink", "bar");
+ onset.getAai().put("generic-vnf.vnf-id", "83f674e8-7555-44d7-9a39-bdc3770b0491");
onset.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
}
@@ -209,12 +209,12 @@ public class ControlLoopEventManagerTest {
public void abatemetCheckEventSyntaxTest() {
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.setClosedLoopControlName("abatementAAI");
- event.setRequestID(UUID.randomUUID());
+ event.setRequestId(UUID.randomUUID());
event.setTarget("generic-vnf.vnf-id");
event.setClosedLoopAlarmStart(Instant.now());
event.setClosedLoopEventStatus(ControlLoopEventStatus.ABATED);
ControlLoopEventManager manager =
- new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
assertNull(manager.getVnfResponse());
assertNull(manager.getVserverResponse());
try {
@@ -228,8 +228,8 @@ public class ControlLoopEventManagerTest {
assertNull(manager.getVserverResponse());
- event.setAAI(new HashMap<>());
- event.getAAI().put("generic-vnf.vnf-name", "abatementTest");
+ event.setAai(new HashMap<>());
+ event.getAai().put("generic-vnf.vnf-name", "abatementTest");
try {
manager.checkEventSyntax(event);
} catch (ControlLoopException e) {
@@ -246,15 +246,15 @@ public class ControlLoopEventManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.setClosedLoopControlName("TwoOnsetTest");
- event.setRequestID(requestId);
+ event.setRequestId(requestId);
event.setTarget("generic-vnf.vnf-id");
event.setClosedLoopAlarmStart(Instant.now());
event.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- event.setAAI(new HashMap<>());
- event.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ event.setAai(new HashMap<>());
+ event.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
VirtualControlLoopNotification notification = manager.activate(event);
assertNotNull(notification);
@@ -276,12 +276,12 @@ public class ControlLoopEventManagerTest {
VirtualControlLoopEvent event2 = new VirtualControlLoopEvent();
event2.setClosedLoopControlName("TwoOnsetTest");
- event2.setRequestID(requestId);
+ event2.setRequestId(requestId);
event2.setTarget("generic-vnf.vnf-id");
event2.setClosedLoopAlarmStart(Instant.now());
event2.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- event2.setAAI(new HashMap<>());
- event2.getAAI().put("generic-vnf.vnf-name", "onsetTwo");
+ event2.setAai(new HashMap<>());
+ event2.getAai().put("generic-vnf.vnf-name", "onsetTwo");
try {
@@ -494,15 +494,15 @@ public class ControlLoopEventManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.setClosedLoopControlName("TwoOnsetTest");
- event.setRequestID(requestId);
+ event.setRequestId(requestId);
event.setTarget("generic-vnf.vnf-id");
event.setClosedLoopAlarmStart(Instant.now());
event.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- event.setAAI(new HashMap<>());
- event.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ event.setAai(new HashMap<>());
+ event.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
manager.setActivated(true);
VirtualControlLoopNotification notification = manager.activate(event);
assertEquals(ControlLoopNotificationType.REJECTED, notification.getNotification());
@@ -519,15 +519,15 @@ public class ControlLoopEventManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.setClosedLoopControlName("TwoOnsetTest");
- event.setRequestID(requestId);
+ event.setRequestId(requestId);
event.setTarget("generic-vnf.vnf-id");
event.setClosedLoopAlarmStart(Instant.now());
event.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- event.setAAI(new HashMap<>());
- event.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ event.setAai(new HashMap<>());
+ event.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
// Null YAML should fail
VirtualControlLoopNotification notificationNull = manager.activate(null, event);
@@ -562,15 +562,15 @@ public class ControlLoopEventManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.setClosedLoopControlName("TwoOnsetTest");
- event.setRequestID(requestId);
+ event.setRequestId(requestId);
event.setTarget("generic-vnf.vnf-id");
event.setClosedLoopAlarmStart(Instant.now());
event.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- event.setAAI(new HashMap<>());
- event.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ event.setAai(new HashMap<>());
+ event.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
try {
manager.isControlLoopFinal();
fail("test should throw an exception here");
@@ -599,7 +599,7 @@ public class ControlLoopEventManagerTest {
assertNotNull(clfNotification);
assertEquals(ControlLoopNotificationType.FINAL_SUCCESS, clfNotification.getNotification());
- manager = new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ manager = new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
notification = manager.activate(yamlString, event);
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification());
@@ -609,7 +609,7 @@ public class ControlLoopEventManagerTest {
assertNotNull(clfNotification);
assertEquals(ControlLoopNotificationType.FINAL_FAILURE, clfNotification.getNotification());
- manager = new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ manager = new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
notification = manager.activate(yamlString, event);
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification());
@@ -633,15 +633,15 @@ public class ControlLoopEventManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.setClosedLoopControlName("TwoOnsetTest");
- event.setRequestID(requestId);
+ event.setRequestId(requestId);
event.setTarget("generic-vnf.vnf-id");
event.setClosedLoopAlarmStart(Instant.now());
event.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- event.setAAI(new HashMap<>());
- event.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ event.setAai(new HashMap<>());
+ event.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
try {
manager.processControlLoop();
fail("test should throw an exception here");
@@ -674,7 +674,7 @@ public class ControlLoopEventManagerTest {
assertEquals("Already working an Operation, do not call this method.", e.getMessage());
}
- manager = new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ manager = new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
notification = manager.activate(yamlString, event);
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification());
@@ -692,7 +692,7 @@ public class ControlLoopEventManagerTest {
assertEquals("Control Loop is in FINAL state, do not call this method.", e.getMessage());
}
- manager = new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ manager = new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
notification = manager.activate(yamlString, event);
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification());
@@ -718,15 +718,15 @@ public class ControlLoopEventManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.setClosedLoopControlName("TwoOnsetTest");
- event.setRequestID(requestId);
+ event.setRequestId(requestId);
event.setTarget("generic-vnf.vnf-id");
event.setClosedLoopAlarmStart(Instant.now());
event.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- event.setAAI(new HashMap<>());
- event.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ event.setAai(new HashMap<>());
+ event.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
try {
manager.finishOperation(null);
fail("test should throw an exception here");
@@ -781,7 +781,7 @@ public class ControlLoopEventManagerTest {
manager.finishOperation(clom);
ControlLoopEventManager otherManager =
- new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestID());
+ new ControlLoopEventManager(event.getClosedLoopControlName(), event.getRequestId());
VirtualControlLoopNotification otherNotification = otherManager.activate(yamlStringStd, event);
assertNotNull(otherNotification);
assertEquals(ControlLoopNotificationType.ACTIVE, otherNotification.getNotification());
@@ -801,24 +801,24 @@ public class ControlLoopEventManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent onsetEvent = new VirtualControlLoopEvent();
onsetEvent.setClosedLoopControlName("TwoOnsetTest");
- onsetEvent.setRequestID(requestId);
+ onsetEvent.setRequestId(requestId);
onsetEvent.setTarget("generic-vnf.vnf-id");
onsetEvent.setClosedLoopAlarmStart(Instant.now());
onsetEvent.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- onsetEvent.setAAI(new HashMap<>());
- onsetEvent.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ onsetEvent.setAai(new HashMap<>());
+ onsetEvent.getAai().put("generic-vnf.vnf-name", "onsetOne");
VirtualControlLoopEvent abatedEvent = new VirtualControlLoopEvent();
abatedEvent.setClosedLoopControlName("TwoOnsetTest");
- abatedEvent.setRequestID(requestId);
+ abatedEvent.setRequestId(requestId);
abatedEvent.setTarget("generic-vnf.vnf-id");
abatedEvent.setClosedLoopAlarmStart(Instant.now());
abatedEvent.setClosedLoopEventStatus(ControlLoopEventStatus.ABATED);
- abatedEvent.setAAI(new HashMap<>());
- abatedEvent.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ abatedEvent.setAai(new HashMap<>());
+ abatedEvent.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestID());
+ new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestId());
VirtualControlLoopNotification notification = manager.activate(yamlString, onsetEvent);
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification());
@@ -828,7 +828,7 @@ public class ControlLoopEventManagerTest {
assertEquals(NEW_EVENT_STATUS.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent));
VirtualControlLoopEvent checkSyntaxEvent = new VirtualControlLoopEvent();
- checkSyntaxEvent.setAAI(null);
+ checkSyntaxEvent.setAai(null);
checkSyntaxEvent.setClosedLoopAlarmEnd(null);
checkSyntaxEvent.setClosedLoopAlarmStart(null);
checkSyntaxEvent.setClosedLoopControlName(null);
@@ -838,7 +838,7 @@ public class ControlLoopEventManagerTest {
checkSyntaxEvent.setPolicyName(null);
checkSyntaxEvent.setPolicyScope(null);
checkSyntaxEvent.setPolicyVersion(null);
- checkSyntaxEvent.setRequestID(null);
+ checkSyntaxEvent.setRequestId(null);
checkSyntaxEvent.setTarget(null);
checkSyntaxEvent.setTargetType(null);
checkSyntaxEvent.setVersion(null);
@@ -857,16 +857,16 @@ public class ControlLoopEventManagerTest {
checkSyntaxEvent.setClosedLoopControlName("TwoOnsetTest");
assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent));
- checkSyntaxEvent.setRequestID(null);
+ checkSyntaxEvent.setRequestId(null);
assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent));
- checkSyntaxEvent.setRequestID(requestId);
+ checkSyntaxEvent.setRequestId(requestId);
assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent));
- checkSyntaxEvent.setAAI(null);
+ checkSyntaxEvent.setAai(null);
assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent));
- checkSyntaxEvent.setAAI(new HashMap<>());
+ checkSyntaxEvent.setAai(new HashMap<>());
assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent));
checkSyntaxEvent.setTarget("");
@@ -896,19 +896,19 @@ public class ControlLoopEventManagerTest {
checkSyntaxEvent.setTarget("generic-vnf.vnf-name");
assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent));
- checkSyntaxEvent.setAAI(null);
+ checkSyntaxEvent.setAai(null);
assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent));
- checkSyntaxEvent.setAAI(new HashMap<>());
+ checkSyntaxEvent.setAai(new HashMap<>());
assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent));
- checkSyntaxEvent.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ checkSyntaxEvent.getAai().put("generic-vnf.vnf-name", "onsetOne");
assertEquals(NEW_EVENT_STATUS.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent));
- checkSyntaxEvent.getAAI().put("vserver.vserver-name", "onsetOne");
+ checkSyntaxEvent.getAai().put("vserver.vserver-name", "onsetOne");
assertEquals(NEW_EVENT_STATUS.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent));
- checkSyntaxEvent.getAAI().put("generic-vnf.vnf-id", "onsetOne");
+ checkSyntaxEvent.getAai().put("generic-vnf.vnf-id", "onsetOne");
assertEquals(NEW_EVENT_STATUS.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent));
}
@@ -920,15 +920,15 @@ public class ControlLoopEventManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent onsetEvent = new VirtualControlLoopEvent();
onsetEvent.setClosedLoopControlName("TwoOnsetTest");
- onsetEvent.setRequestID(requestId);
+ onsetEvent.setRequestId(requestId);
onsetEvent.setTarget("generic-vnf.vnf-id");
onsetEvent.setClosedLoopAlarmStart(Instant.now());
onsetEvent.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- onsetEvent.setAAI(new HashMap<>());
- onsetEvent.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ onsetEvent.setAai(new HashMap<>());
+ onsetEvent.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestID());
+ new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestId());
assertTrue(0 == manager.getControlLoopTimeout(null));
assertTrue(120 == manager.getControlLoopTimeout(120));
@@ -947,15 +947,15 @@ public class ControlLoopEventManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent onsetEvent = new VirtualControlLoopEvent();
onsetEvent.setClosedLoopControlName("TwoOnsetTest");
- onsetEvent.setRequestID(requestId);
+ onsetEvent.setRequestId(requestId);
onsetEvent.setTarget("generic-vnf.vnf-id");
onsetEvent.setClosedLoopAlarmStart(Instant.now());
onsetEvent.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- onsetEvent.setAAI(new HashMap<>());
- onsetEvent.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ onsetEvent.setAai(new HashMap<>());
+ onsetEvent.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestID());
+ new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestId());
manager.queryAai(onsetEvent);
VirtualControlLoopNotification notification = manager.activate(yamlString, onsetEvent);
@@ -964,53 +964,53 @@ public class ControlLoopEventManagerTest {
manager.queryAai(onsetEvent);
- onsetEvent.getAAI().put("generic-vnf.is-closed-loop-disabled", "true");
+ onsetEvent.getAai().put("generic-vnf.is-closed-loop-disabled", "true");
try {
manager.queryAai(onsetEvent);
fail("test should throw an exception here");
} catch (Exception e) {
assertEquals("is-closed-loop-disabled is set to true on VServer or VNF", e.getMessage());
}
- onsetEvent.getAAI().put("vserver.is-closed-loop-disabled", "true");
+ onsetEvent.getAai().put("vserver.is-closed-loop-disabled", "true");
try {
manager.queryAai(onsetEvent);
fail("test should throw an exception here");
} catch (Exception e) {
assertEquals("is-closed-loop-disabled is set to true on VServer or VNF", e.getMessage());
}
- onsetEvent.getAAI().remove("generic-vnf.is-closed-loop-disabled");
+ onsetEvent.getAai().remove("generic-vnf.is-closed-loop-disabled");
try {
manager.queryAai(onsetEvent);
fail("test should throw an exception here");
} catch (Exception e) {
assertEquals("is-closed-loop-disabled is set to true on VServer or VNF", e.getMessage());
}
- onsetEvent.getAAI().remove("vserver.is-closed-loop-disabled");
+ onsetEvent.getAai().remove("vserver.is-closed-loop-disabled");
manager.queryAai(onsetEvent);
- onsetEvent.getAAI().put("generic-vnf.is-closed-loop-disabled", "false");
+ onsetEvent.getAai().put("generic-vnf.is-closed-loop-disabled", "false");
manager.queryAai(onsetEvent);
- onsetEvent.getAAI().put("vserver.is-closed-loop-disabled", "false");
+ onsetEvent.getAai().put("vserver.is-closed-loop-disabled", "false");
manager.queryAai(onsetEvent);
- onsetEvent.getAAI().remove("generic-vnf.vnf-id");
- onsetEvent.getAAI().remove("generic-vnf.vnf-name");
- onsetEvent.getAAI().remove("vserver.vserver-name");
+ onsetEvent.getAai().remove("generic-vnf.vnf-id");
+ onsetEvent.getAai().remove("generic-vnf.vnf-name");
+ onsetEvent.getAai().remove("vserver.vserver-name");
manager.queryAai(onsetEvent);
- onsetEvent.getAAI().put("vserver.vserver-name", "AVserver");
+ onsetEvent.getAai().put("vserver.vserver-name", "AVserver");
manager.queryAai(onsetEvent);
- onsetEvent.getAAI().put("generic-vnf.vnf-name", "AVNFName");
+ onsetEvent.getAai().put("generic-vnf.vnf-name", "AVNFName");
manager.queryAai(onsetEvent);
- onsetEvent.getAAI().put("generic-vnf.vnf-id", "AVNFID");
+ onsetEvent.getAai().put("generic-vnf.vnf-id", "AVNFID");
manager.queryAai(onsetEvent);
- onsetEvent.getAAI().remove("vserver.vserver-name");
+ onsetEvent.getAai().remove("vserver.vserver-name");
manager.queryAai(onsetEvent);
- onsetEvent.getAAI().remove("generic-vnf.vnf-name");
+ onsetEvent.getAai().remove("generic-vnf.vnf-name");
manager.queryAai(onsetEvent);
// Force AAI errors
@@ -1024,8 +1024,8 @@ public class ControlLoopEventManagerTest {
+ "(query by vnf-id)", e.getMessage());
}
- onsetEvent.getAAI().remove("generic-vnf.vnf-id");
- onsetEvent.getAAI().put("generic-vnf.vnf-name", "AVNFName");
+ onsetEvent.getAai().remove("generic-vnf.vnf-id");
+ onsetEvent.getAai().put("generic-vnf.vnf-name", "AVNFName");
try {
manager.queryAai(onsetEvent);
fail("test should throw an exception here");
@@ -1034,8 +1034,8 @@ public class ControlLoopEventManagerTest {
+ "(query by vnf-name)", e.getMessage());
}
- onsetEvent.getAAI().remove("generic-vnf.vnf-name");
- onsetEvent.getAAI().put("vserver.vserver-name", "AVserver");
+ onsetEvent.getAai().remove("generic-vnf.vnf-name");
+ onsetEvent.getAai().put("vserver.vserver-name", "AVserver");
try {
manager.queryAai(onsetEvent);
fail("test should throw an exception here");
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 8efa3706d..fd4405d61 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
@@ -45,11 +45,11 @@ import org.onap.policy.appc.CommonHeader;
import org.onap.policy.appc.Response;
import org.onap.policy.appc.ResponseCode;
import org.onap.policy.appc.ResponseStatus;
-import org.onap.policy.appclcm.LCMCommonHeader;
-import org.onap.policy.appclcm.LCMRequest;
-import org.onap.policy.appclcm.LCMRequestWrapper;
-import org.onap.policy.appclcm.LCMResponse;
-import org.onap.policy.appclcm.LCMResponseWrapper;
+import org.onap.policy.appclcm.LcmCommonHeader;
+import org.onap.policy.appclcm.LcmRequest;
+import org.onap.policy.appclcm.LcmRequestWrapper;
+import org.onap.policy.appclcm.LcmResponse;
+import org.onap.policy.appclcm.LcmResponseWrapper;
import org.onap.policy.controlloop.ControlLoopEventStatus;
import org.onap.policy.controlloop.ControlLoopException;
import org.onap.policy.controlloop.ControlLoopNotificationType;
@@ -80,12 +80,12 @@ public class ControlLoopOperationManagerTest {
static {
onset = new VirtualControlLoopEvent();
- onset.setRequestID(UUID.randomUUID());
+ onset.setRequestId(UUID.randomUUID());
onset.setTarget("generic-vnf.vnf-name");
onset.setTargetType(ControlLoopTargetType.VNF);
onset.setClosedLoopAlarmStart(Instant.now());
- onset.setAAI(new HashMap<>());
- onset.getAAI().put("generic-vnf.vnf-name", "testTriggerSource");
+ onset.setAai(new HashMap<>());
+ onset.getAai().put("generic-vnf.vnf-name", "testTriggerSource");
onset.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
/* Set environment properties */
@@ -127,7 +127,7 @@ public class ControlLoopOperationManagerTest {
// create the manager
//
ControlLoopEventManager eventManager =
- new ControlLoopEventManager(onset.getClosedLoopControlName(), onset.getRequestID());
+ new ControlLoopEventManager(onset.getClosedLoopControlName(), onset.getRequestId());
VirtualControlLoopNotification notification = eventManager.activate(onset);
assertNotNull(notification);
@@ -157,17 +157,17 @@ public class ControlLoopOperationManagerTest {
Object request = manager.startOperation(onset);
logger.debug("{}", manager);
assertNotNull(request);
- assertTrue(request instanceof LCMRequestWrapper);
- LCMRequestWrapper dmaapRequest = (LCMRequestWrapper) request;
- LCMRequest appcRequest = dmaapRequest.getBody();
+ assertTrue(request instanceof LcmRequestWrapper);
+ LcmRequestWrapper dmaapRequest = (LcmRequestWrapper) request;
+ LcmRequest appcRequest = dmaapRequest.getBody();
assertTrue(appcRequest.getCommonHeader().getSubRequestId().contentEquals("1"));
assertFalse(manager.isOperationComplete());
assertTrue(manager.isOperationRunning());
//
// Accept
//
- LCMResponseWrapper dmaapResponse = new LCMResponseWrapper();
- LCMResponse appcResponse = new LCMResponse(appcRequest);
+ LcmResponseWrapper dmaapResponse = new LcmResponseWrapper();
+ LcmResponse appcResponse = new LcmResponse(appcRequest);
appcResponse.getStatus().setCode(100);
appcResponse.getStatus().setMessage("ACCEPT");
dmaapResponse.setBody(appcResponse);
@@ -182,7 +182,7 @@ public class ControlLoopOperationManagerTest {
//
// Now we are going to Fail it
//
- appcResponse = new LCMResponse(appcRequest);
+ appcResponse = new LcmResponse(appcRequest);
appcResponse.getStatus().setCode(401);
appcResponse.getStatus().setMessage("AppC failed for some reason");
dmaapResponse.setBody(appcResponse);
@@ -197,8 +197,8 @@ public class ControlLoopOperationManagerTest {
request = manager.startOperation(onset);
logger.debug("{}", manager);
assertNotNull(request);
- assertTrue(request instanceof LCMRequestWrapper);
- dmaapRequest = (LCMRequestWrapper) request;
+ assertTrue(request instanceof LcmRequestWrapper);
+ dmaapRequest = (LcmRequestWrapper) request;
appcRequest = dmaapRequest.getBody();
assertTrue(appcRequest.getCommonHeader().getSubRequestId().contentEquals("2"));
assertFalse(manager.isOperationComplete());
@@ -206,7 +206,7 @@ public class ControlLoopOperationManagerTest {
//
//
//
- appcResponse = new LCMResponse(appcRequest);
+ appcResponse = new LcmResponse(appcRequest);
logger.debug("{}", manager);
appcResponse.getStatus().setCode(100);
appcResponse.getStatus().setMessage("ACCEPT");
@@ -222,7 +222,7 @@ public class ControlLoopOperationManagerTest {
//
// Now we are going to Fail it
//
- appcResponse = new LCMResponse(appcRequest);
+ appcResponse = new LcmResponse(appcRequest);
appcResponse.getStatus().setCode(401);
appcResponse.getStatus().setMessage("AppC failed for some reason");
dmaapResponse.setBody(appcResponse);
@@ -258,7 +258,7 @@ public class ControlLoopOperationManagerTest {
// create the manager
//
ControlLoopEventManager eventManager =
- new ControlLoopEventManager(onset.getClosedLoopControlName(), onset.getRequestID());
+ new ControlLoopEventManager(onset.getClosedLoopControlName(), onset.getRequestId());
VirtualControlLoopNotification notification = eventManager.activate(onset);
assertNotNull(notification);
@@ -288,17 +288,17 @@ public class ControlLoopOperationManagerTest {
Object request = manager.startOperation(onset);
logger.debug("{}", manager);
assertNotNull(request);
- assertTrue((request) instanceof LCMRequestWrapper);
- LCMRequestWrapper dmaapRequest = (LCMRequestWrapper) request;
- LCMRequest appcRequest = dmaapRequest.getBody();
+ assertTrue((request) instanceof LcmRequestWrapper);
+ LcmRequestWrapper dmaapRequest = (LcmRequestWrapper) request;
+ LcmRequest appcRequest = dmaapRequest.getBody();
assertTrue((appcRequest).getCommonHeader().getSubRequestId().contentEquals("1"));
assertFalse(manager.isOperationComplete());
assertTrue(manager.isOperationRunning());
//
// Accept
//
- LCMResponseWrapper dmaapResponse = new LCMResponseWrapper();
- LCMResponse appcResponse = new LCMResponse(appcRequest);
+ LcmResponseWrapper dmaapResponse = new LcmResponseWrapper();
+ LcmResponse appcResponse = new LcmResponse(appcRequest);
dmaapResponse.setBody(appcResponse);
appcResponse.getStatus().setCode(100);
appcResponse.getStatus().setMessage("ACCEPT");
@@ -322,7 +322,7 @@ public class ControlLoopOperationManagerTest {
//
// Now we are going to Fail the previous request
//
- appcResponse = new LCMResponse(appcRequest);
+ appcResponse = new LcmResponse(appcRequest);
appcResponse.getStatus().setCode(401);
appcResponse.getStatus().setMessage("AppC failed for some reason");
dmaapResponse.setBody(appcResponse);
@@ -348,15 +348,15 @@ public class ControlLoopOperationManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent onsetEvent = new VirtualControlLoopEvent();
onsetEvent.setClosedLoopControlName("TwoOnsetTest");
- onsetEvent.setRequestID(requestId);
+ onsetEvent.setRequestId(requestId);
onsetEvent.setTarget("generic-vnf.vnf-id");
onsetEvent.setClosedLoopAlarmStart(Instant.now());
onsetEvent.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- onsetEvent.setAAI(new HashMap<>());
- onsetEvent.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ onsetEvent.setAai(new HashMap<>());
+ onsetEvent.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestID());
+ new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestId());
VirtualControlLoopNotification notification = manager.activate(yamlString, onsetEvent);
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification());
@@ -406,9 +406,9 @@ public class ControlLoopOperationManagerTest {
}
onsetEvent.setTarget("Oz");
- onsetEvent.getAAI().remove("generic-vnf.vnf-name");
- onsetEvent.getAAI().remove("generic-vnf.vnf-id");
- onsetEvent.getAAI().remove("vserver.vserver-name");
+ onsetEvent.getAai().remove("generic-vnf.vnf-name");
+ onsetEvent.getAai().remove("generic-vnf.vnf-id");
+ onsetEvent.getAai().remove("vserver.vserver-name");
policy.getTarget().setType(TargetType.VNF);
try {
@@ -419,12 +419,12 @@ public class ControlLoopOperationManagerTest {
}
onsetEvent.setTarget("vserver.vserver-name");
- onsetEvent.getAAI().put("vserver.vserver-name", "OzVServer");
+ onsetEvent.getAai().put("vserver.vserver-name", "OzVServer");
assertEquals("OzVServer", clom.getTarget(policy));
- onsetEvent.getAAI().remove("vserver.vserver-name");
+ onsetEvent.getAai().remove("vserver.vserver-name");
onsetEvent.setTarget("generic-vnf.vnf-id");
- onsetEvent.getAAI().put("generic-vnf.vnf-id", "OzVNF");
+ onsetEvent.getAai().put("generic-vnf.vnf-id", "OzVNF");
assertEquals("OzVNF", clom.getTarget(policy));
onsetEvent.setTarget("generic-vnf.vnf-name");
@@ -432,7 +432,7 @@ public class ControlLoopOperationManagerTest {
manager.onNewEvent(onsetEvent);
- onsetEvent.getAAI().remove("generic-vnf.vnf-id");
+ onsetEvent.getAai().remove("generic-vnf.vnf-id");
manager.getVnfResponse();
clom.getEventManager().getVnfResponse().setVnfId("generic-vnf.vnf-id");
assertEquals("generic-vnf.vnf-id", clom.getTarget(policy));
@@ -475,15 +475,15 @@ public class ControlLoopOperationManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent onsetEvent = new VirtualControlLoopEvent();
onsetEvent.setClosedLoopControlName("TwoOnsetTest");
- onsetEvent.setRequestID(requestId);
+ onsetEvent.setRequestId(requestId);
onsetEvent.setTarget("generic-vnf.vnf-id");
onsetEvent.setClosedLoopAlarmStart(Instant.now());
onsetEvent.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- onsetEvent.setAAI(new HashMap<>());
- onsetEvent.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ onsetEvent.setAai(new HashMap<>());
+ onsetEvent.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestID());
+ new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestId());
VirtualControlLoopNotification notification = manager.activate(yamlString, onsetEvent);
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification());
@@ -530,15 +530,15 @@ public class ControlLoopOperationManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent onsetEvent = new VirtualControlLoopEvent();
onsetEvent.setClosedLoopControlName("TwoOnsetTest");
- onsetEvent.setRequestID(requestId);
+ onsetEvent.setRequestId(requestId);
onsetEvent.setTarget("generic-vnf.vnf-id");
onsetEvent.setClosedLoopAlarmStart(Instant.now());
onsetEvent.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- onsetEvent.setAAI(new HashMap<>());
- onsetEvent.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ onsetEvent.setAai(new HashMap<>());
+ onsetEvent.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestID());
+ new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestId());
VirtualControlLoopNotification notification = manager.activate(yamlString, onsetEvent);
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification());
@@ -634,15 +634,15 @@ public class ControlLoopOperationManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent onsetEvent = new VirtualControlLoopEvent();
onsetEvent.setClosedLoopControlName("TwoOnsetTest");
- onsetEvent.setRequestID(requestId);
+ onsetEvent.setRequestId(requestId);
onsetEvent.setTarget("generic-vnf.vnf-id");
onsetEvent.setClosedLoopAlarmStart(Instant.now());
onsetEvent.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- onsetEvent.setAAI(new HashMap<>());
- onsetEvent.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ onsetEvent.setAai(new HashMap<>());
+ onsetEvent.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestID());
+ new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestId());
VirtualControlLoopNotification notification = manager.activate(yamlString, onsetEvent);
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification());
@@ -658,7 +658,7 @@ public class ControlLoopOperationManagerTest {
appcResponse.setCommonHeader(commonHeader);
assertEquals(PolicyResult.FAILURE_EXCEPTION, clom.onResponse(appcResponse));
- commonHeader.setSubRequestID("12345");
+ commonHeader.setSubRequestId("12345");
appcResponse.setStatus(null);
assertEquals(PolicyResult.FAILURE_EXCEPTION, clom.onResponse(appcResponse));
@@ -684,9 +684,9 @@ public class ControlLoopOperationManagerTest {
responseStatus.setCode(ResponseCode.SUCCESS.getValue());
assertEquals(PolicyResult.SUCCESS, clom.onResponse(appcResponse));
- LCMResponseWrapper lrw = new LCMResponseWrapper();
- LCMResponse body = new LCMResponse();
- LCMCommonHeader lcmCh = new LCMCommonHeader();
+ LcmResponseWrapper lrw = new LcmResponseWrapper();
+ LcmResponse body = new LcmResponse();
+ LcmCommonHeader lcmCh = new LcmCommonHeader();
body.setCommonHeader(lcmCh);
lrw.setBody(body);
@@ -727,15 +727,15 @@ public class ControlLoopOperationManagerTest {
UUID requestId = UUID.randomUUID();
VirtualControlLoopEvent onsetEvent = new VirtualControlLoopEvent();
onsetEvent.setClosedLoopControlName("TwoOnsetTest");
- onsetEvent.setRequestID(requestId);
+ onsetEvent.setRequestId(requestId);
onsetEvent.setTarget("generic-vnf.vnf-id");
onsetEvent.setClosedLoopAlarmStart(Instant.now());
onsetEvent.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
- onsetEvent.setAAI(new HashMap<>());
- onsetEvent.getAAI().put("generic-vnf.vnf-name", "onsetOne");
+ onsetEvent.setAai(new HashMap<>());
+ onsetEvent.getAai().put("generic-vnf.vnf-name", "onsetOne");
ControlLoopEventManager manager =
- new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestID());
+ new ControlLoopEventManager(onsetEvent.getClosedLoopControlName(), onsetEvent.getRequestId());
VirtualControlLoopNotification notification = manager.activate(yamlString, onsetEvent);
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification());
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/drools/DroolsPolicyEngineTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/drools/DroolsPolicyEngineTest.java
index 13d5f3679..dcf3e6c95 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/drools/DroolsPolicyEngineTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/drools/DroolsPolicyEngineTest.java
@@ -26,9 +26,9 @@ import static org.junit.Assert.assertNotNull;
import org.junit.Test;
import org.onap.policy.appc.CommonHeader;
import org.onap.policy.appc.Request;
-import org.onap.policy.appclcm.LCMCommonHeader;
-import org.onap.policy.appclcm.LCMRequest;
-import org.onap.policy.appclcm.LCMRequestWrapper;
+import org.onap.policy.appclcm.LcmCommonHeader;
+import org.onap.policy.appclcm.LcmRequest;
+import org.onap.policy.appclcm.LcmRequestWrapper;
import org.onap.policy.controlloop.ControlLoopNotification;
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.drools.impl.PolicyEngineJUnitImpl;
@@ -54,12 +54,12 @@ public class DroolsPolicyEngineTest {
Request request = new Request();
request.setCommonHeader(new CommonHeader());
- request.getCommonHeader().setSubRequestID("12321");
+ request.getCommonHeader().setSubRequestId("12321");
pe.deliver("OmniBus", "TheWizardOfOz", request);
- LCMRequestWrapper lcmRw = new LCMRequestWrapper();
- lcmRw.setBody(new LCMRequest());
- lcmRw.getBody().setCommonHeader(new LCMCommonHeader());
+ LcmRequestWrapper lcmRw = new LcmRequestWrapper();
+ lcmRw.setBody(new LcmRequest());
+ lcmRw.getBody().setCommonHeader(new LcmCommonHeader());
lcmRw.getBody().getCommonHeader().setSubRequestId("54321");
pe.deliver("OmniBus", "TheWizardOfOz", lcmRw);
}