summaryrefslogtreecommitdiffstats
path: root/dcae-analytics-tca/src/test/java
diff options
context:
space:
mode:
authorSingla, Rajiv (rs153v) <rs153v@att.com>2017-10-12 13:44:30 -0400
committerSingla, Rajiv (rs153v) <rs153v@att.com>2017-10-12 14:07:49 -0400
commit892e09327045d28d7bb633f9ed37817d75dc9300 (patch)
treebbaa667f01062932782184ed307ea7bd7d88ef6f /dcae-analytics-tca/src/test/java
parent619add75ea412de8ef331d9ae898412818b203c6 (diff)
TCA:Support for string & decimal policy FieldPath
Change-Id: I37a236be2cb4afccffbcf72e3914fb75dadbbb88 Signed-off-by: Singla, Rajiv (rs153v) <rs153v@att.com> Issue-Id: DCAEGEN2-158
Diffstat (limited to 'dcae-analytics-tca/src/test/java')
-rw-r--r--dcae-analytics-tca/src/test/java/org/openecomp/dcae/apod/analytics/tca/utils/TCAUtilsTest.java10
1 files changed, 6 insertions, 4 deletions
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<String> fieldPaths = ImmutableSet.of(jsonPath);
- final Map<String, List<Long>> jsonPathValueMap = TCAUtils.getJsonPathValue(cefMessageString, fieldPaths);
- assertThat("Json Path value must match", jsonPathValueMap.get(jsonPath).get(0), is(5000L));
+ final Map<String, List<BigDecimal>> 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<String> fieldPaths = ImmutableSet.of(jsonPath);
- final Map<String, List<Long>> jsonPathValueMap = TCAUtils.getJsonPathValue(cefMessageString, fieldPaths);
+ final Map<String, List<BigDecimal>> 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);