You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2021/07/01 07:49:48 UTC

[unomi] 01/01: UNOMI-493 Fix missing profile ID on Segment integration tests. This is fixed by adding a dummy profile ID for validation purposes

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

shuber pushed a commit to branch UNOMI-493-segmentvalidation-bug
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 3ee2c36813975c54aae1ba697f037bcd2a5df50c
Author: Serge Huber <sh...@jahia.com>
AuthorDate: Thu Jul 1 09:49:40 2021 +0200

    UNOMI-493 Fix missing profile ID on Segment integration tests.
    This is fixed by adding a dummy profile ID for validation purposes
---
 .../org/apache/unomi/services/impl/segments/SegmentServiceImpl.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/services/src/main/java/org/apache/unomi/services/impl/segments/SegmentServiceImpl.java b/services/src/main/java/org/apache/unomi/services/impl/segments/SegmentServiceImpl.java
index fba8e16..ec85e2a 100644
--- a/services/src/main/java/org/apache/unomi/services/impl/segments/SegmentServiceImpl.java
+++ b/services/src/main/java/org/apache/unomi/services/impl/segments/SegmentServiceImpl.java
@@ -63,6 +63,7 @@ public class SegmentServiceImpl extends AbstractServiceImpl implements SegmentSe
 
     private static final Logger logger = LoggerFactory.getLogger(SegmentServiceImpl.class.getName());
 
+    private static final String VALIDATION_PROFILE_ID = "validation-profile-id";
     private BundleContext bundleContext;
 
     private EventService eventService;
@@ -258,7 +259,7 @@ public class SegmentServiceImpl extends AbstractServiceImpl implements SegmentSe
 
     public void setSegmentDefinition(Segment segment) {
         ParserHelper.resolveConditionType(definitionsService, segment.getCondition(), "segment " + segment.getItemId());
-        if (!persistenceService.isValidCondition(segment.getCondition(), new Profile())) {
+        if (!persistenceService.isValidCondition(segment.getCondition(), new Profile(VALIDATION_PROFILE_ID))) {
             throw new BadSegmentConditionException();
         }