This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a commit to branch UNOMI-419-segment-it
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/UNOMI-419-segment-it by this 
push:
     new b41dd79  UNOMI-419 Add IT for bad parameter type (string instead 
integer)
b41dd79 is described below

commit b41dd7947dc80b0413829af866b9a67046c2c7e2
Author: Kevan <[email protected]>
AuthorDate: Tue Feb 23 18:18:10 2021 +0100

    UNOMI-419 Add IT for bad parameter type (string instead integer)
---
 .../src/test/java/org/apache/unomi/itests/SegmentIT.java   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java 
b/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
index aa99574..fceb70c 100644
--- a/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
@@ -82,6 +82,20 @@ public class SegmentIT extends BaseIT {
         segmentService.setSegmentDefinition(segment);
     }
 
+    @Test(expected = BadSegmentConditionException.class)
+    public void testSegmentWithInvalidConditionParameterTypes() {
+        Metadata segmentMetadata = new Metadata(SEGMENT_ID);
+        Segment segment = new Segment(segmentMetadata);
+        Condition segmentCondition = new 
Condition(definitionsService.getConditionType("pastEventCondition"));
+        segmentCondition.setParameter("minimumEventCount", "2");
+        segmentCondition.setParameter("numberOfDays", "10");
+        Condition pastEventEventCondition = new 
Condition(definitionsService.getConditionType("eventTypeCondition"));
+        pastEventEventCondition.setParameter("eventTypeId", "test-event-type");
+        segmentCondition.setParameter("eventCondition", 
pastEventEventCondition);
+        segment.setCondition(segmentCondition);
+        segmentService.setSegmentDefinition(segment);
+    }
+
     @Test
     public void testSegmentWithValidCondition() {
         Metadata segmentMetadata = new Metadata(SEGMENT_ID);

Reply via email to