From 3a228ca91c313990741ef6a537d9f9615a0e0215 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Wed, 22 May 2019 02:38:32 +0000 Subject: Fix name/version regexp in model keys The regular expressions for checking names and versions in policy key names and versions were not expressive enough to restrict all error names and versions. Issue-ID: POLICY-1777 Change-Id: I037eca051f6c7a9f1e7182150d40d8b8d906a75c Signed-off-by: liamfallon --- .../models/tosca/legacy/provider/LegacyProvider4LegacyGuardTest.java | 4 ++-- .../tosca/legacy/provider/LegacyProvider4LegacyOperationalTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'models-tosca/src/test/java') diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider4LegacyGuardTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider4LegacyGuardTest.java index 9487ed8aa..be5fa5dc3 100644 --- a/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider4LegacyGuardTest.java +++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider4LegacyGuardTest.java @@ -311,8 +311,8 @@ public class LegacyProvider4LegacyGuardTest { }).hasMessage("policyVersion is marked @NonNull but is null"); assertThatThrownBy(() -> { - new LegacyProvider().deleteGuardPolicy(pfDao, "IDontExist", ""); - }).hasMessage("no policy found for policy: IDontExist:"); + new LegacyProvider().deleteGuardPolicy(pfDao, "IDontExist", "0"); + }).hasMessage("no policy found for policy: IDontExist:0"); createPolicyTypes(); diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider4LegacyOperationalTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider4LegacyOperationalTest.java index 17b912826..636063641 100644 --- a/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider4LegacyOperationalTest.java +++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider4LegacyOperationalTest.java @@ -250,8 +250,8 @@ public class LegacyProvider4LegacyOperationalTest { }).hasMessage("policyVersion is marked @NonNull but is null"); assertThatThrownBy(() -> { - new LegacyProvider().deleteOperationalPolicy(pfDao, "IDontExist", ""); - }).hasMessage("no policy found for policy: IDontExist:"); + new LegacyProvider().deleteOperationalPolicy(pfDao, "IDontExist", "0"); + }).hasMessage("no policy found for policy: IDontExist:0"); createPolicyTypes(); -- cgit 1.2.3-korg