From 892e09327045d28d7bb633f9ed37817d75dc9300 Mon Sep 17 00:00:00 2001 From: "Singla, Rajiv (rs153v)" Date: Thu, 12 Oct 2017 13:44:30 -0400 Subject: TCA:Support for string & decimal policy FieldPath Change-Id: I37a236be2cb4afccffbcf72e3914fb75dadbbb88 Signed-off-by: Singla, Rajiv (rs153v) Issue-Id: DCAEGEN2-158 --- .../openecomp/dcae/apod/analytics/tca/utils/TCAUtilsTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'dcae-analytics-tca/src/test') 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 853ac54..426bd1e 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 @@ -53,6 +53,7 @@ import org.quartz.Scheduler; import org.quartz.SimpleTrigger; import org.quartz.impl.StdSchedulerFactory; +import java.math.BigDecimal; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -147,8 +148,9 @@ public class TCAUtilsTest extends BaseAnalyticsTCAUnitTest { final String jsonPath = "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"; final ImmutableSet fieldPaths = ImmutableSet.of(jsonPath); - final Map> jsonPathValueMap = TCAUtils.getJsonPathValue(cefMessageString, fieldPaths); - assertThat("Json Path value must match", jsonPathValueMap.get(jsonPath).get(0), is(5000L)); + final Map> jsonPathValueMap = TCAUtils.getJsonPathValue(cefMessageString, fieldPaths); + assertThat("Json Path value must match", + jsonPathValueMap.get(jsonPath).get(0), is(new BigDecimal(5000))); } @@ -157,7 +159,7 @@ public class TCAUtilsTest extends BaseAnalyticsTCAUnitTest { final String cefMessageString = fromStream(CEF_MESSAGE_JSON_FILE_LOCATION); final String jsonPath = "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].invalid"; final ImmutableSet fieldPaths = ImmutableSet.of(jsonPath); - final Map> jsonPathValueMap = TCAUtils.getJsonPathValue(cefMessageString, fieldPaths); + final Map> jsonPathValueMap = TCAUtils.getJsonPathValue(cefMessageString, fieldPaths); assertThat("Json path value must be empty", jsonPathValueMap.size(), is(0)); } @@ -400,7 +402,7 @@ public class TCAUtilsTest extends BaseAnalyticsTCAUnitTest { violatedThreshold.setSeverity(severity); violatedThreshold.setDirection(Direction.GREATER); violatedThreshold.setClosedLoopControlName("violatedThresholdClosedLoopName"); - violatedThreshold.setActualFieldValue(100L); + violatedThreshold.setActualFieldValue(new BigDecimal(100L)); violatedThreshold.setFieldPath("violatedThresholdFieldPath"); violatedThreshold.setVersion("violatedThresholdVersion"); violatedThreshold.setClosedLoopEventStatus(ClosedLoopEventStatus.ONSET); -- cgit 1.2.3-korg