diff options
Diffstat (limited to 'dcae-analytics-common/src/test')
4 files changed, 10 insertions, 47 deletions
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<String, Set<String>> 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); diff --git a/dcae-analytics-common/src/test/resources/data/json/cef_message.json b/dcae-analytics-common/src/test/resources/data/json/cef_message.json deleted file mode 100644 index 52cf53b..0000000 --- a/dcae-analytics-common/src/test/resources/data/json/cef_message.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "event": { - "measurementsForVfScalingFields": { - "measurementInterval": 10, - "measurementsForVfScalingVersion": 1.1, - "vNicUsageArray": [ - { - "bytesIn": 6086, - "multicastPacketsIn": 0, - "multicastPacketsOut": 0, - "unicastPacketsIn": 0, - "broadcastPacketsOut": 0, - "packetsOut": 42, - "bytesOut": 7156, - "packetsIn": 93, - "broadcastPacketsIn": 0, - "vNicIdentifier": "eth0", - "unicastPacketsOut": 0 - } - ] - }, - "commonEventHeader": { - "reportingEntityName": "vpp-test", - "startEpochMicrosec": 1477070210290442, - "eventId": "375", - "lastEpochMicrosec": 1477070220290442, - "priority": "Normal", - "sequence": 375, - "sourceName": "Dummy VM name - No Metadata available", - "domain": "measurementsForVfScaling", - "functionalRole": "vFirewall", - "reportingEntityId": "No UUID available", - "version": 1.1, - "sourceId": "Dummy VM UUID - No Metadata available" - } - } -} |