diff options
Diffstat (limited to 'dcae-analytics-tca/src')
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
|