summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/eventmanager')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java68
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java14
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java56
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java22
4 files changed, 80 insertions, 80 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 224e33559..39a4886a2 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
@@ -28,10 +28,10 @@ import java.util.Collection;
import java.util.LinkedList;
import java.util.UUID;
-import org.onap.policy.aai.AAIGETVnfResponse;
-import org.onap.policy.aai.AAIGETVserverResponse;
-import org.onap.policy.aai.AAIManager;
-import org.onap.policy.aai.util.AAIException;
+import org.onap.policy.aai.AaiGetVnfResponse;
+import org.onap.policy.aai.AaiGetVserverResponse;
+import org.onap.policy.aai.AaiManager;
+import org.onap.policy.aai.util.AaiException;
import org.onap.policy.controlloop.ControlLoopEventStatus;
import org.onap.policy.controlloop.ControlLoopException;
import org.onap.policy.controlloop.ControlLoopNotificationType;
@@ -78,8 +78,8 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
private LinkedList<ControlLoopOperation> controlLoopHistory = new LinkedList<>();
private ControlLoopOperationManager currentOperation = null;
private transient TargetLock targetLock = null;
- private AAIGETVnfResponse vnfResponse = null;
- private AAIGETVserverResponse vserverResponse = null;
+ private AaiGetVnfResponse vnfResponse = null;
+ private AaiGetVserverResponse vserverResponse = null;
private static String aaiHostURL;
private static String aaiUser;
private static String aaiPassword;
@@ -334,9 +334,9 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
*
* @return a ControlLoopOperationManager
* @throws ControlLoopException if an error occurs
- * @throws AAIException if an error occurs retrieving information from A&AI
+ * @throws AaiException if an error occurs retrieving information from A&AI
*/
- public ControlLoopOperationManager processControlLoop() throws ControlLoopException, AAIException {
+ public ControlLoopOperationManager processControlLoop() throws ControlLoopException, AaiException {
//
// Check if they activated us
//
@@ -497,9 +497,9 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
*
* @param event the event
* @return the status
- * @throws AAIException if an error occurs retrieving information from A&AI
+ * @throws AaiException if an error occurs retrieving information from A&AI
*/
- public NEW_EVENT_STATUS onNewEvent(VirtualControlLoopEvent event) throws AAIException {
+ public NEW_EVENT_STATUS onNewEvent(VirtualControlLoopEvent event) throws AaiException {
try {
this.checkEventSyntax(event);
if (event.getClosedLoopEventStatus() == ControlLoopEventStatus.ONSET) {
@@ -590,11 +590,11 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
return 0;
}
- public AAIGETVnfResponse getVnfResponse() {
+ public AaiGetVnfResponse getVnfResponse() {
return vnfResponse;
}
- public AAIGETVserverResponse getVserverResponse() {
+ public AaiGetVserverResponse getVserverResponse() {
return vserverResponse;
}
@@ -641,12 +641,12 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
* Query A&AI for an event.
*
* @param event the event
- * @throws AAIException if an error occurs retrieving information from A&AI
+ * @throws AaiException if an error occurs retrieving information from A&AI
*/
- public void queryAai(VirtualControlLoopEvent event) throws AAIException {
+ 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)) {
- throw new AAIException("is-closed-loop-disabled is set to true on VServer or VNF");
+ throw new AaiException("is-closed-loop-disabled is set to true on VServer or VNF");
}
try {
@@ -659,7 +659,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
}
} catch (Exception e) {
logger.error("Exception from queryAai: ", e);
- throw new AAIException("Exception from queryAai: " + e.toString());
+ throw new AaiException("Exception from queryAai: " + e.toString());
}
}
@@ -669,40 +669,40 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
* @param aaiResponse the response from A&AI
* @param queryByVnfId <code>true</code> if the query was based on vnf-id, <code>false</code> if
* the query was based on vnf-name
- * @throws AAIException if an error occurs processing the response
+ * @throws AaiException if an error occurs processing the response
*/
- private static void processVNFResponse(AAIGETVnfResponse aaiResponse, boolean queryByVNFID) throws AAIException {
+ private static void processVNFResponse(AaiGetVnfResponse aaiResponse, boolean queryByVNFID) throws AaiException {
String queryTypeString = (queryByVNFID ? "vnf-id" : "vnf-name");
if (aaiResponse == null) {
- throw new AAIException("AAI Response is null (query by " + queryTypeString + ")");
+ throw new AaiException("AAI Response is null (query by " + queryTypeString + ")");
}
if (aaiResponse.getRequestError() != null) {
- throw new AAIException("AAI Responded with a request error (query by " + queryTypeString + ")");
+ throw new AaiException("AAI Responded with a request error (query by " + queryTypeString + ")");
}
if (aaiResponse.getIsClosedLoopDisabled() != null) {
String value = aaiResponse.getIsClosedLoopDisabled();
if ("true".equalsIgnoreCase(value) || "T".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value)
|| "Y".equalsIgnoreCase(value)) {
- throw new AAIException("is-closed-loop-disabled is set to true (query by " + queryTypeString + ")");
+ throw new AaiException("is-closed-loop-disabled is set to true (query by " + queryTypeString + ")");
}
}
}
- private static void processVServerResponse(AAIGETVserverResponse aaiResponse) throws AAIException {
+ private static void processVServerResponse(AaiGetVserverResponse aaiResponse) throws AaiException {
if (aaiResponse == null) {
- throw new AAIException("AAI Response is null (query by vserver-name)");
+ throw new AaiException("AAI Response is null (query by vserver-name)");
}
if (aaiResponse.getRequestError() != null) {
- throw new AAIException("AAI responded with a request error (query by vserver-name)");
+ throw new AaiException("AAI responded with a request error (query by vserver-name)");
}
if (aaiResponse.getIsClosedLoopDisabled() != null) {
String value = aaiResponse.getIsClosedLoopDisabled();
if ("true".equalsIgnoreCase(value) || "T".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value)
|| "Y".equalsIgnoreCase(value)) {
- throw new AAIException("is-closed-loop-disabled is set to true (query by vserver-name)");
+ throw new AaiException("is-closed-loop-disabled is set to true (query by vserver-name)");
}
}
}
@@ -730,12 +730,12 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
* Get the A&AI VService information for an event.
*
* @param event the event
- * @return a AAIGETVserverResponse
+ * @return a AaiGetVserverResponse
* @throws ControlLoopException if an error occurs
*/
- public static AAIGETVserverResponse getAAIVserverInfo(VirtualControlLoopEvent event) throws ControlLoopException {
+ public static AaiGetVserverResponse getAAIVserverInfo(VirtualControlLoopEvent event) throws ControlLoopException {
UUID requestId = event.getRequestID();
- AAIGETVserverResponse response = null;
+ AaiGetVserverResponse response = null;
String vserverName = event.getAAI().get(VSERVER_VSERVER_NAME);
try {
@@ -746,7 +746,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
String aaiGetQueryByVserver = "/aai/v11/nodes/vservers?vserver-name=";
String url = aaiHostURL + aaiGetQueryByVserver;
logger.info("AAI Host URL by VServer: {}", url);
- response = new AAIManager(new RESTManager()).getQueryByVserverName(url, aaiUser, aaiPassword, requestId,
+ response = new AaiManager(new RESTManager()).getQueryByVserverName(url, aaiUser, aaiPassword, requestId,
vserverName);
}
} catch (Exception e) {
@@ -761,12 +761,12 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
* Get A&AI VNF information for an event.
*
* @param event the event
- * @return a AAIGETVnfResponse
+ * @return a AaiGetVnfResponse
* @throws ControlLoopException if an error occurs
*/
- public static AAIGETVnfResponse getAAIVnfInfo(VirtualControlLoopEvent event) throws ControlLoopException {
+ public static AaiGetVnfResponse getAAIVnfInfo(VirtualControlLoopEvent event) throws ControlLoopException {
UUID requestId = event.getRequestID();
- AAIGETVnfResponse response = null;
+ AaiGetVnfResponse response = null;
String vnfName = event.getAAI().get(GENERIC_VNF_VNF_NAME);
String vnfId = event.getAAI().get(GENERIC_VNF_VNF_ID);
@@ -779,14 +779,14 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
String aaiGetQueryByVnfName = "/aai/v11/network/generic-vnfs/generic-vnf?vnf-name=";
String url = aaiHostURL + aaiGetQueryByVnfName;
logger.info("AAI Host URL by VNF name: {}", url);
- response = new AAIManager(new RESTManager()).getQueryByVnfName(url, aaiUser, aaiPassword, requestId,
+ 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;
logger.info("AAI Host URL by VNF ID: {}", url);
response =
- new AAIManager(new RESTManager()).getQueryByVnfID(url, aaiUser, aaiPassword, requestId, vnfId);
+ new AaiManager(new RESTManager()).getQueryByVnfId(url, aaiUser, aaiPassword, requestId, vnfId);
}
} catch (Exception e) {
logger.error("getAAIVnfInfo exception: ", e);
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 7c900249c..97eaf9048 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
@@ -32,7 +32,7 @@ import javax.persistence.EntityManager;
import javax.persistence.Persistence;
import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.onap.policy.aai.util.AAIException;
+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;
@@ -134,9 +134,9 @@ public class ControlLoopOperationManager implements Serializable {
* @param policy the policy
* @return the target
* @throws ControlLoopException if an error occurs
- * @throws AAIException if an error occurs retrieving information from A&AI
+ * @throws AaiException if an error occurs retrieving information from A&AI
*/
- public String getTarget(Policy policy) throws ControlLoopException, AAIException {
+ public String getTarget(Policy policy) throws ControlLoopException, AaiException {
if (policy.getTarget() == null) {
throw new ControlLoopException("The target is null");
}
@@ -167,9 +167,9 @@ public class ControlLoopOperationManager implements Serializable {
* If the vnf-name was retrieved from the onset then the vnf-id must be obtained
* from the event manager's A&AI GET query
*/
- String vnfId = this.eventManager.getVnfResponse().getVnfID();
+ String vnfId = this.eventManager.getVnfResponse().getVnfId();
if (vnfId == null) {
- throw new AAIException("No vnf-id found");
+ throw new AaiException("No vnf-id found");
}
return vnfId;
}
@@ -186,10 +186,10 @@ public class ControlLoopOperationManager implements Serializable {
* @param policy the policy
* @param em the event manager
* @throws ControlLoopException if an error occurs
- * @throws AAIException if an error occurs retrieving information from A&AI
+ * @throws AaiException if an error occurs retrieving information from A&AI
*/
public ControlLoopOperationManager(ControlLoopEvent onset, Policy policy, ControlLoopEventManager em)
- throws ControlLoopException, AAIException {
+ throws ControlLoopException, AaiException {
this.onset = onset;
this.policy = policy;
this.guardApprovalStatus = "NONE";
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 ea057c9d9..4ff8338a6 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
@@ -39,15 +39,15 @@ import org.apache.commons.io.IOUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.onap.policy.aai.AAIGETVnfResponse;
-import org.onap.policy.aai.AAIGETVserverResponse;
+import org.onap.policy.aai.AaiGetVnfResponse;
+import org.onap.policy.aai.AaiGetVserverResponse;
import org.onap.policy.aai.RelatedToProperty;
import org.onap.policy.aai.RelatedToPropertyItem;
import org.onap.policy.aai.Relationship;
import org.onap.policy.aai.RelationshipData;
import org.onap.policy.aai.RelationshipDataItem;
import org.onap.policy.aai.RelationshipList;
-import org.onap.policy.aai.util.AAIException;
+import org.onap.policy.aai.util.AaiException;
import org.onap.policy.controlloop.ControlLoopEventStatus;
import org.onap.policy.controlloop.ControlLoopException;
import org.onap.policy.controlloop.ControlLoopNotificationType;
@@ -109,7 +109,7 @@ public class ControlLoopEventManagerTest {
final Util.Pair<ControlLoopPolicy, String> pair = Util.loadYaml("src/test/resources/test.yaml");
onset.setClosedLoopControlName(pair.key.getControlLoop().getControlLoopName());
try {
- AAIGETVnfResponse response = getQueryByVnfId2(
+ AaiGetVnfResponse response = getQueryByVnfId2(
PolicyEngine.manager.getEnvironmentProperty("aai.url")
+ "/aai/v11/network/generic-vnfs/generic-vnf/",
PolicyEngine.manager.getEnvironmentProperty("aai.username"),
@@ -128,7 +128,7 @@ public class ControlLoopEventManagerTest {
final Util.Pair<ControlLoopPolicy, String> pair = Util.loadYaml("src/test/resources/test.yaml");
onset.setClosedLoopControlName(pair.key.getControlLoop().getControlLoopName());
try {
- AAIGETVnfResponse response = getQueryByVnfName2(
+ AaiGetVnfResponse response = getQueryByVnfName2(
PolicyEngine.manager.getEnvironmentProperty("aai.url")
+ "/aai/v11/network/generic-vnfs/generic-vnf?vnf-name=",
PolicyEngine.manager.getEnvironmentProperty("aai.username"),
@@ -146,7 +146,7 @@ public class ControlLoopEventManagerTest {
final Util.Pair<ControlLoopPolicy, String> pair = Util.loadYaml("src/test/resources/test.yaml");
onset.setClosedLoopControlName(pair.key.getControlLoop().getControlLoopName());
try {
- AAIGETVserverResponse response = getQueryByVserverName2(
+ AaiGetVserverResponse response = getQueryByVserverName2(
PolicyEngine.manager.getEnvironmentProperty("aai.url") + "/aai/v11/nodes/vservers?vserver-name=",
PolicyEngine.manager.getEnvironmentProperty("aai.username"),
PolicyEngine.manager.getEnvironmentProperty("aai.password"), UUID.randomUUID(),
@@ -169,7 +169,7 @@ public class ControlLoopEventManagerTest {
try {
logger.info("testIsClosedLoopDisabled --");
- AAIGETVnfResponse response = getQueryByVnfId2(
+ AaiGetVnfResponse response = getQueryByVnfId2(
PolicyEngine.manager.getEnvironmentProperty("aai.url")
+ "/aai/v11/network/generic-vnfs/generic-vnf/",
PolicyEngine.manager.getEnvironmentProperty("aai.username"),
@@ -191,7 +191,7 @@ public class ControlLoopEventManagerTest {
// disabled = ControlLoopEventManager.isClosedLoopDisabled(response);
// logger.info("QueryByVnfName - isClosedLoopDisabled: " + disabled);
- AAIGETVserverResponse response2 = getQueryByVserverName2(
+ AaiGetVserverResponse response2 = getQueryByVserverName2(
PolicyEngine.manager.getEnvironmentProperty("aai.url") + "/aai/v11/nodes/vservers?vserver-name=",
PolicyEngine.manager.getEnvironmentProperty("aai.user"),
PolicyEngine.manager.getEnvironmentProperty("aai.password"), UUID.randomUUID(),
@@ -263,14 +263,14 @@ public class ControlLoopEventManagerTest {
ControlLoopEventManager.NEW_EVENT_STATUS status = null;
try {
status = manager.onNewEvent(event);
- } catch (AAIException e) {
+ } catch (AaiException e) {
logger.warn(e.toString());
fail("A&AI Query Failed");
}
assertNotNull(status);
assertEquals(ControlLoopEventManager.NEW_EVENT_STATUS.FIRST_ONSET, status);
- AAIGETVnfResponse response = manager.getVnfResponse();
+ AaiGetVnfResponse response = manager.getVnfResponse();
assertNotNull(response);
assertNull(manager.getVserverResponse());
@@ -286,12 +286,12 @@ public class ControlLoopEventManagerTest {
try {
status = manager.onNewEvent(event2);
- } catch (AAIException e) {
+ } catch (AaiException e) {
logger.warn(e.toString());
fail("A&AI Query Failed");
}
assertEquals(ControlLoopEventManager.NEW_EVENT_STATUS.SUBSEQUENT_ONSET, status);
- AAIGETVnfResponse response2 = manager.getVnfResponse();
+ AaiGetVnfResponse response2 = manager.getVnfResponse();
assertNotNull(response2);
// We should not have queried AAI, so the stored response should be the same
assertEquals(response, response2);
@@ -301,11 +301,11 @@ public class ControlLoopEventManagerTest {
/**
* Simulate a response.
*/
- public static AAIGETVnfResponse getQueryByVnfId2(String urlGet, String username, String password, UUID requestId,
+ public static AaiGetVnfResponse getQueryByVnfId2(String urlGet, String username, String password, UUID requestId,
String key) {
- AAIGETVnfResponse response = new AAIGETVnfResponse();
+ AaiGetVnfResponse response = new AaiGetVnfResponse();
- response.setVnfID("83f674e8-7555-44d7-9a39-bdc3770b0491");
+ response.setVnfId("83f674e8-7555-44d7-9a39-bdc3770b0491");
response.setVnfName("lll_vnf_010317");
response.setVnfType("Basa-122216-Service/VidVsamp12BaseVolume 1");
response.setServiceId("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
@@ -355,11 +355,11 @@ public class ControlLoopEventManagerTest {
/**
* Simulate a response.
*/
- public static AAIGETVnfResponse getQueryByVnfName2(String urlGet, String username, String password, UUID requestId,
+ public static AaiGetVnfResponse getQueryByVnfName2(String urlGet, String username, String password, UUID requestId,
String key) {
- AAIGETVnfResponse response = new AAIGETVnfResponse();
+ AaiGetVnfResponse response = new AaiGetVnfResponse();
- response.setVnfID("83f674e8-7555-44d7-9a39-bdc3770b0491");
+ response.setVnfId("83f674e8-7555-44d7-9a39-bdc3770b0491");
response.setVnfName("lll_vnf_010317");
response.setVnfType("Basa-122216-Service/VidVsamp12BaseVolume 1");
response.setServiceId("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
@@ -409,11 +409,11 @@ public class ControlLoopEventManagerTest {
/**
* Simulate a response.
*/
- public static AAIGETVserverResponse getQueryByVserverName2(String urlGet, String username, String password,
+ public static AaiGetVserverResponse getQueryByVserverName2(String urlGet, String username, String password,
UUID requestId, String key) {
- AAIGETVserverResponse response = new AAIGETVserverResponse();
+ AaiGetVserverResponse response = new AaiGetVserverResponse();
- response.setVserverID("d0668d4f-c25e-4a1b-87c4-83845c01efd8");
+ response.setVserverId("d0668d4f-c25e-4a1b-87c4-83845c01efd8");
response.setVserverName("USMSO1SX7NJ0103UJZZ01-vjunos0");
response.setVserverName2("vjunos0");
response.setVserverSelflink(
@@ -626,7 +626,7 @@ public class ControlLoopEventManagerTest {
}
@Test
- public void testProcessControlLoop() throws ControlLoopException, IOException, AAIException {
+ public void testProcessControlLoop() throws ControlLoopException, IOException, AaiException {
InputStream is = new FileInputStream(new File("src/test/resources/test.yaml"));
final String yamlString = IOUtils.toString(is, StandardCharsets.UTF_8);
@@ -708,7 +708,7 @@ public class ControlLoopEventManagerTest {
}
@Test
- public void testFinishOperation() throws IOException, ControlLoopException, AAIException {
+ public void testFinishOperation() throws IOException, ControlLoopException, AaiException {
InputStream is = new FileInputStream(new File("src/test/resources/testSOactor.yaml"));
final String yamlString = IOUtils.toString(is, StandardCharsets.UTF_8);
@@ -794,7 +794,7 @@ public class ControlLoopEventManagerTest {
}
@Test
- public void testOnNewEvent() throws IOException, AAIException {
+ public void testOnNewEvent() throws IOException, AaiException {
InputStream is = new FileInputStream(new File("src/test/resources/test.yaml"));
final String yamlString = IOUtils.toString(is, StandardCharsets.UTF_8);
@@ -940,7 +940,7 @@ public class ControlLoopEventManagerTest {
}
@Test
- public void testQueryAai() throws IOException, AAIException {
+ public void testQueryAai() throws IOException, AaiException {
InputStream is = new FileInputStream(new File("src/test/resources/test.yaml"));
final String yamlString = IOUtils.toString(is, StandardCharsets.UTF_8);
@@ -1020,7 +1020,7 @@ public class ControlLoopEventManagerTest {
manager.queryAai(onsetEvent);
fail("test should throw an exception here");
} catch (Exception e) {
- assertEquals("Exception from queryAai: org.onap.policy.aai.util.AAIException: AAI Response is null "
+ assertEquals("Exception from queryAai: org.onap.policy.aai.util.AaiException: AAI Response is null "
+ "(query by vnf-id)", e.getMessage());
}
@@ -1030,7 +1030,7 @@ public class ControlLoopEventManagerTest {
manager.queryAai(onsetEvent);
fail("test should throw an exception here");
} catch (Exception e) {
- assertEquals("Exception from queryAai: org.onap.policy.aai.util.AAIException: AAI Response is null "
+ assertEquals("Exception from queryAai: org.onap.policy.aai.util.AaiException: AAI Response is null "
+ "(query by vnf-name)", e.getMessage());
}
@@ -1040,7 +1040,7 @@ public class ControlLoopEventManagerTest {
manager.queryAai(onsetEvent);
fail("test should throw an exception here");
} catch (Exception e) {
- assertEquals("Exception from queryAai: org.onap.policy.aai.util.AAIException: AAI Response is null "
+ assertEquals("Exception from queryAai: org.onap.policy.aai.util.AaiException: AAI Response is null "
+ "(query by vserver-name)", e.getMessage());
}
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 0d811bbd8..8efa3706d 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
@@ -40,7 +40,7 @@ import org.apache.commons.io.IOUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.onap.policy.aai.util.AAIException;
+import org.onap.policy.aai.util.AaiException;
import org.onap.policy.appc.CommonHeader;
import org.onap.policy.appc.Response;
import org.onap.policy.appc.ResponseCode;
@@ -136,7 +136,7 @@ public class ControlLoopOperationManagerTest {
ControlLoopEventManager.NEW_EVENT_STATUS status = null;
try {
status = eventManager.onNewEvent(onset);
- } catch (AAIException e) {
+ } catch (AaiException e) {
logger.warn(e.toString());
fail("A&AI Query Failed");
}
@@ -237,7 +237,7 @@ public class ControlLoopOperationManagerTest {
assertNotNull(manager.getOperationResult());
assertTrue(manager.getOperationResult().equals(PolicyResult.FAILURE_RETRIES));
assertTrue(manager.getHistory().size() == 2);
- } catch (ControlLoopException | AAIException e) {
+ } catch (ControlLoopException | AaiException e) {
fail(e.getMessage());
}
}
@@ -267,7 +267,7 @@ public class ControlLoopOperationManagerTest {
ControlLoopEventManager.NEW_EVENT_STATUS status = null;
try {
status = eventManager.onNewEvent(onset);
- } catch (AAIException e) {
+ } catch (AaiException e) {
logger.warn(e.toString());
fail("A&AI Query Failed");
}
@@ -335,13 +335,13 @@ public class ControlLoopOperationManagerTest {
assertFalse(manager.isOperationRunning());
assertTrue(manager.getHistory().size() == 1);
assertTrue(manager.getOperationResult().equals(PolicyResult.FAILURE_TIMEOUT));
- } catch (ControlLoopException | AAIException e) {
+ } catch (ControlLoopException | AaiException e) {
fail(e.getMessage());
}
}
@Test
- public void testMethods() throws IOException, ControlLoopException, AAIException {
+ public void testMethods() throws IOException, ControlLoopException, AaiException {
InputStream is = new FileInputStream(new File("src/test/resources/testSOactor.yaml"));
final String yamlString = IOUtils.toString(is, StandardCharsets.UTF_8);
@@ -434,7 +434,7 @@ public class ControlLoopOperationManagerTest {
onsetEvent.getAAI().remove("generic-vnf.vnf-id");
manager.getVnfResponse();
- clom.getEventManager().getVnfResponse().setVnfID("generic-vnf.vnf-id");
+ clom.getEventManager().getVnfResponse().setVnfId("generic-vnf.vnf-id");
assertEquals("generic-vnf.vnf-id", clom.getTarget(policy));
policy.getTarget().setType(TargetType.VFC);
@@ -468,7 +468,7 @@ public class ControlLoopOperationManagerTest {
}
@Test
- public void testConstructor() throws IOException, ControlLoopException, AAIException {
+ public void testConstructor() throws IOException, ControlLoopException, AaiException {
InputStream is = new FileInputStream(new File("src/test/resources/test.yaml"));
final String yamlString = IOUtils.toString(is, StandardCharsets.UTF_8);
@@ -523,7 +523,7 @@ public class ControlLoopOperationManagerTest {
}
@Test
- public void testStartOperation() throws IOException, ControlLoopException, AAIException {
+ public void testStartOperation() throws IOException, ControlLoopException, AaiException {
InputStream is = new FileInputStream(new File("src/test/resources/test.yaml"));
final String yamlString = IOUtils.toString(is, StandardCharsets.UTF_8);
@@ -627,7 +627,7 @@ public class ControlLoopOperationManagerTest {
}
@Test
- public void testOnResponse() throws IOException, ControlLoopException, AAIException {
+ public void testOnResponse() throws IOException, ControlLoopException, AaiException {
InputStream is = new FileInputStream(new File("src/test/resources/test.yaml"));
final String yamlString = IOUtils.toString(is, StandardCharsets.UTF_8);
@@ -720,7 +720,7 @@ public class ControlLoopOperationManagerTest {
}
@Test
- public void testCompleteOperation() throws ControlLoopException, AAIException, IOException {
+ public void testCompleteOperation() throws ControlLoopException, AaiException, IOException {
InputStream is = new FileInputStream(new File("src/test/resources/test.yaml"));
final String yamlString = IOUtils.toString(is, StandardCharsets.UTF_8);