From 4edf0fa48892bf38d0e3838d125e9bf2324b38e0 Mon Sep 17 00:00:00 2001 From: an4828 Date: Fri, 15 Sep 2017 15:28:53 -0400 Subject: Add support for ABATED alerts within CDAP TCA Change-Id: Iae560a2d0a47b30b41cd31206dc481a08e4930f7 Signed-off-by: an4828 Issue-ID: DCAEGEN2-107 Signed-off-by: an4828 --- .../apod/analytics/common/BaseAnalyticsCommonUnitTest.java | 2 +- .../service/filter/GenericJsonMessageFilterTest.java | 14 +++++++------- .../analytics/common/utils/MessageProcessorUtilsTest.java | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'dcae-analytics-common/src/test/java/org/openecomp/dcae') diff --git a/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/BaseAnalyticsCommonUnitTest.java b/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/BaseAnalyticsCommonUnitTest.java index 9a42a97..81c8b57 100644 --- a/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/BaseAnalyticsCommonUnitTest.java +++ b/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/BaseAnalyticsCommonUnitTest.java @@ -35,7 +35,7 @@ public abstract class BaseAnalyticsCommonUnitTest extends BaseDCAEAnalyticsUnitT protected static final String TEST_MESSAGE_PROCESSOR_MESSAGE = "Test Processor Message"; - protected static final String CEF_MESSAGE_FILE_PATH = "data/json/cef_message.json"; + protected static final String CEF_MESSAGE_FILE_PATH = "data/json/cef/cef_message.json"; /* * Test implementation for {@link CDAPAppSettings} diff --git a/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilterTest.java b/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilterTest.java index 3a0d8bd..db72a03 100644 --- a/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilterTest.java +++ b/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilterTest.java @@ -48,7 +48,7 @@ public class GenericJsonMessageFilterTest extends BaseAnalyticsCommonUnitTest { final JsonMessageFilterProcessorContext finalMessageProcessorContext = processJsonMessageFilterChain(jsonMessage, "domainFilter", "$.event.commonEventHeader.domain", "measurementsForVfScaling", - "functionalRoleFilter", "$.event.commonEventHeader.functionalRole", "vFirewall"); + "eventNameFilter", "$.event.commonEventHeader.eventName", "Mfvs_eNodeB_RANKPI"); assertJsonMessageAssertions(jsonMessage, finalMessageProcessorContext, true, true, 2); @@ -59,8 +59,8 @@ public class GenericJsonMessageFilterTest extends BaseAnalyticsCommonUnitTest { final JsonMessageFilterProcessorContext finalMessageProcessorContext = processJsonMessageFilterChain(jsonMessage, - "domainFilter", "$.event.commonEventHeader.sequence", "375", - "functionalRoleFilter", "$.event.commonEventHeader.functionalRole", "vFirewall"); + "domainFilter", "$.event.commonEventHeader.sequence", "0", + "eventNameFilter", "$.event.commonEventHeader.eventName", "Mfvs_eNodeB_RANKPI"); assertJsonMessageAssertions(jsonMessage, finalMessageProcessorContext, true, true, 2); } @@ -71,7 +71,7 @@ public class GenericJsonMessageFilterTest extends BaseAnalyticsCommonUnitTest { final JsonMessageFilterProcessorContext finalMessageProcessorContext = processJsonMessageFilterChain(jsonMessage, "domainFilter", "$.event.commonEventHeader.domain", "xxxxxxxxxxx", - "functionalRoleFilter", "$.event.commonEventHeader.functionalRole", "vFirewall"); + "functionalRoleFilter", "$.event.commonEventHeader.eventName", "vFirewall"); assertJsonMessageAssertions(jsonMessage, finalMessageProcessorContext, false, false, 1); } @@ -82,7 +82,7 @@ public class GenericJsonMessageFilterTest extends BaseAnalyticsCommonUnitTest { final JsonMessageFilterProcessorContext finalMessageProcessorContext = processJsonMessageFilterChain(jsonMessage, "domainFilter", "$.event.commonEventHeader.xxxxxxx", "measurementsForVfScaling", - "functionalRoleFilter", "$.event.commonEventHeader.functionalRole", "vFirewall"); + "functionalRoleFilter", "$.event.commonEventHeader.eventName", "vFirewall"); assertJsonMessageAssertions(jsonMessage, finalMessageProcessorContext, false, false, 1); } @@ -93,7 +93,7 @@ public class GenericJsonMessageFilterTest extends BaseAnalyticsCommonUnitTest { final JsonMessageFilterProcessorContext finalMessageProcessorContext = processJsonMessageFilterChain("", "domainFilter", "$.event.commonEventHeader.domain", "measurementsForVfScaling", - "functionalRoleFilter", "$.event.commonEventHeader.functionalRole", "vFirewall"); + "functionalRoleFilter", "$.event.commonEventHeader.eventName", "vFirewall"); assertJsonMessageAssertions("", finalMessageProcessorContext, false, null, 1); @@ -105,7 +105,7 @@ public class GenericJsonMessageFilterTest extends BaseAnalyticsCommonUnitTest { final JsonMessageFilterProcessorContext finalMessageProcessorContext = processJsonMessageFilterChain("invalidJson", "domainFilter", "$.event.commonEventHeader.domain", "measurementsForVfScaling", - "functionalRoleFilter", "$.event.commonEventHeader.functionalRole", "vFirewall"); + "functionalRoleFilter", "$.event.commonEventHeader.eventName", "vFirewall"); assertJsonMessageAssertions("invalidJson", finalMessageProcessorContext, false, null, 1); diff --git a/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/utils/MessageProcessorUtilsTest.java b/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/utils/MessageProcessorUtilsTest.java index 8f8c68f..5333150 100644 --- a/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/utils/MessageProcessorUtilsTest.java +++ b/dcae-analytics-common/src/test/java/org/openecomp/dcae/apod/analytics/common/utils/MessageProcessorUtilsTest.java @@ -42,8 +42,8 @@ public class MessageProcessorUtilsTest extends BaseAnalyticsCommonUnitTest { final Map> jsonFilterMappings = new HashMap<>(); jsonFilterMappings.put("$.event.commonEventHeader.domain", ImmutableSet.of("measurementsForVfScaling")); - jsonFilterMappings.put( - "$.event.commonEventHeader.functionalRole", ImmutableSet.of("vFirewall", "vLoadBalancer")); + jsonFilterMappings.put("$.event.commonEventHeader.eventName", + ImmutableSet.of("vFirewall", "vLoadBalancer", "Mfvs_eNodeB_RANKPI")); final JsonMessageFilterProcessorContext jsonMessageFilterProcessorContext = MessageProcessorUtils.processJsonFilterMappings(jsonMessage, jsonFilterMappings); -- cgit 1.2.3-korg