summaryrefslogtreecommitdiffstats
path: root/dcae-analytics-tca/src
diff options
context:
space:
mode:
authorSingla, Rajiv (rs153v) <rs153v@att.com>2017-10-23 13:48:16 -0400
committerSingla, Rajiv (rs153v) <rs153v@att.com>2017-10-23 13:55:04 -0400
commit183f1e104940be50c93890a29384e09c0b037c84 (patch)
treedaf11d634e8cae3de119787e369fff3ca6e5dbbb /dcae-analytics-tca/src
parent3ef6ad7ce7162e4406e0ba42dbfe1e4b4fea4a6e (diff)
TCA:Changed VNF alert vnf-id to vnf-name
Change-Id: I308ba9b6079a964b7326a0fe5e1a62eff15d710b Signed-off-by: Singla, Rajiv (rs153v) <rs153v@att.com> Issue-Id: DCAEGEN2-175
Diffstat (limited to 'dcae-analytics-tca/src')
-rw-r--r--dcae-analytics-tca/src/main/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtils.java14
-rw-r--r--dcae-analytics-tca/src/test/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtilsTest.java11
2 files changed, 12 insertions, 13 deletions
diff --git a/dcae-analytics-tca/src/main/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtils.java b/dcae-analytics-tca/src/main/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtils.java
index 4011e52..e6e96f1 100644
--- a/dcae-analytics-tca/src/main/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtils.java
+++ b/dcae-analytics-tca/src/main/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtils.java
@@ -540,15 +540,15 @@ public abstract class TCAUtils extends AnalyticsModelJsonUtils {
// Hard Coded - "vserver.vserver-name"
tcavesResponse.setTarget(AnalyticsConstants.TCA_VES_RESPONSE_VM_TARGET);
// commonEventHeader.sourceName from the received VES message
- aai.setGenericServerId(commonEventHeader.getSourceName());
+ aai.setGenericServerName(commonEventHeader.getSourceName());
} else {
// VNF specific settings
// Hard Coded - "VNF"
tcavesResponse.setTargetType(AnalyticsConstants.TCA_VES_RESPONSE_VNF_TARGET_TYPE);
- // Hard Coded - "generic-vnf.vnf-id"
+ // Hard Coded - "generic-vnf.vnf-name"
tcavesResponse.setTarget(AnalyticsConstants.TCA_VES_RESPONSE_VNF_TARGET);
// commonEventHeader.sourceName from the received VES message
- aai.setGenericVNFId(commonEventHeader.getSourceName());
+ aai.setGenericVNFName(commonEventHeader.getSourceName());
}
// Hard Coded - "DCAE"
@@ -575,7 +575,7 @@ public abstract class TCAUtils extends AnalyticsModelJsonUtils {
*/
public static ControlLoopSchemaType determineControlLoopSchemaType(final TCAVESResponse tcavesResponse) {
final AAI aai = tcavesResponse.getAai();
- if (aai.getGenericServerId() != null) {
+ if (aai.getGenericServerName() != null) {
return ControlLoopSchemaType.VM;
} else {
return ControlLoopSchemaType.VNF;
@@ -591,10 +591,10 @@ public abstract class TCAUtils extends AnalyticsModelJsonUtils {
*/
public static String determineSourceName(final TCAVESResponse tcavesResponse) {
final AAI aai = tcavesResponse.getAai();
- if (aai.getGenericServerId() != null) {
- return aai.getGenericServerId();
+ if (aai.getGenericServerName() != null) {
+ return aai.getGenericServerName();
} else {
- return aai.getGenericVNFId();
+ return aai.getGenericVNFName();
}
}
diff --git a/dcae-analytics-tca/src/test/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtilsTest.java b/dcae-analytics-tca/src/test/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtilsTest.java
index 426bd1e..c218de6 100644
--- a/dcae-analytics-tca/src/test/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtilsTest.java
+++ b/dcae-analytics-tca/src/test/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtilsTest.java
@@ -20,7 +20,6 @@
package org.openecomp.dcae.apod.analytics.tca.utils;
-import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Table;
@@ -42,7 +41,6 @@ import org.openecomp.dcae.apod.analytics.model.domain.policy.tca.Direction;
import org.openecomp.dcae.apod.analytics.model.domain.policy.tca.MetricsPerEventName;
import org.openecomp.dcae.apod.analytics.model.domain.policy.tca.TCAPolicy;
import org.openecomp.dcae.apod.analytics.model.domain.policy.tca.Threshold;
-import org.openecomp.dcae.apod.analytics.model.facade.tca.AAI;
import org.openecomp.dcae.apod.analytics.model.facade.tca.TCAVESResponse;
import org.openecomp.dcae.apod.analytics.tca.BaseAnalyticsTCAUnitTest;
import org.openecomp.dcae.apod.analytics.tca.processor.TCACEFProcessorContext;
@@ -184,8 +182,8 @@ public class TCAUtilsTest extends BaseAnalyticsTCAUnitTest {
is("CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1A"));
assertThat(tcaVESResponse.getVersion(), is("Test Version"));
assertThat(tcaVESResponse.getPolicyScope(), is("Test Policy scope"));
- assertNull(tcaVESResponse.getAai().getGenericVNFId());
- assertNotNull(tcaVESResponse.getAai().getGenericServerId());
+ assertNull(tcaVESResponse.getAai().getGenericVNFName());
+ assertNotNull(tcaVESResponse.getAai().getGenericServerName());
}
@Test
@@ -206,8 +204,9 @@ public class TCAUtilsTest extends BaseAnalyticsTCAUnitTest {
is("CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1A"));
assertThat(tcaVESResponse.getVersion(), is("Test Version"));
assertThat(tcaVESResponse.getPolicyScope(), is("Test Policy scope"));
- assertNotNull(tcaVESResponse.getAai().getGenericVNFId());
- assertNull(tcaVESResponse.getAai().getGenericServerId());
+ assertNotNull(tcaVESResponse.getAai().getGenericVNFName());
+ assertNull(tcaVESResponse.getAai().getGenericServerName());
+
}
@Rule