From 7132ec3c167fc5e11e280b54be7b2c6dfcb2d320 Mon Sep 17 00:00:00 2001 From: Mengyi Zhou Date: Mon, 6 Mar 2017 17:09:54 +0800 Subject: [PATCH] bug fix --- .../service/model/validation/DefaultGroupValidator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ctrip/zeus/service/model/validation/DefaultGroupValidator.java b/src/main/java/com/ctrip/zeus/service/model/validation/DefaultGroupValidator.java index e99053e5..ec9d6dfd 100644 --- a/src/main/java/com/ctrip/zeus/service/model/validation/DefaultGroupValidator.java +++ b/src/main/java/com/ctrip/zeus/service/model/validation/DefaultGroupValidator.java @@ -29,6 +29,8 @@ public class DefaultGroupValidator implements GroupValidator { private GroupDao groupDao; @Resource private TrafficPolicyQuery trafficPolicyQuery; + @Resource + private PathValidator pathValidator; @Override public void validateFields(Group group, ValidationContext context) { @@ -117,8 +119,8 @@ public class DefaultGroupValidator implements GroupValidator { if (gvs.getPriority() > e.getPriority()) { throw new ValidationException("Group has higher `priority` than its traffic policy " + e.getEntryId() + " on vs " + vsId + "."); } - if (!gvs.getPath().equals(e.getPath())) { - throw new ValidationException("Group and its traffic policy " + e.getEntryId() + " do not have the same `path` value on vs " + vsId + "."); + if (!pathValidator.contains(gvs.getPath(), e.getPath())) { + throw new ValidationException("Traffic policy " + e.getEntryId() + " is neither sharing the same `path` with nor containing part of the `path` of the current group on vs " + vsId + "."); } } }