From 183f1e104940be50c93890a29384e09c0b037c84 Mon Sep 17 00:00:00 2001 From: "Singla, Rajiv (rs153v)" Date: Mon, 23 Oct 2017 13:48:16 -0400 Subject: TCA:Changed VNF alert vnf-id to vnf-name Change-Id: I308ba9b6079a964b7326a0fe5e1a62eff15d710b Signed-off-by: Singla, Rajiv (rs153v) Issue-Id: DCAEGEN2-175 --- .../openecomp/dcae/apod/analytics/tca/utils/TCAUtils.java | 14 +++++++------- .../dcae/apod/analytics/tca/utils/TCAUtilsTest.java | 11 +++++------ 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'dcae-analytics-tca/src') 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 -- cgit 1.2.3-korg