aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-05-22 17:07:54 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-22 17:07:54 +0000
commit1d0e4ce3e6a47d203c06731178d2c4c62cc2640d (patch)
treec3d81fad9f46f8ca99987949024acb724d92c2b3
parent6dec4f14de4d630b8687ac70d64d8b5f25a7d36f (diff)
parent85e47aa6a194bc8069a628390708a62711a6197b (diff)
Merge "Reserve version integer check and delete eligibility check"
-rw-r--r--main/src/main/java/org/onap/policy/api/main/rest/provider/LegacyGuardPolicyProvider.java2
-rw-r--r--main/src/main/java/org/onap/policy/api/main/rest/provider/LegacyOperationalPolicyProvider.java2
-rw-r--r--main/src/test/java/org/onap/policy/api/main/rest/provider/TestLegacyGuardPolicyProvider.java2
-rw-r--r--main/src/test/java/org/onap/policy/api/main/rest/provider/TestLegacyOperationalPolicyProvider.java2
4 files changed, 4 insertions, 4 deletions
diff --git a/main/src/main/java/org/onap/policy/api/main/rest/provider/LegacyGuardPolicyProvider.java b/main/src/main/java/org/onap/policy/api/main/rest/provider/LegacyGuardPolicyProvider.java
index 236d26eb..44cc046f 100644
--- a/main/src/main/java/org/onap/policy/api/main/rest/provider/LegacyGuardPolicyProvider.java
+++ b/main/src/main/java/org/onap/policy/api/main/rest/provider/LegacyGuardPolicyProvider.java
@@ -98,8 +98,8 @@ public class LegacyGuardPolicyProvider implements AutoCloseable {
public Map<String, LegacyGuardPolicyOutput> deleteGuardPolicy(String policyId, String policyVersion)
throws PfModelException {
- validateDeleteEligibility(policyId, policyVersion);
validateLegacyGuardPolicyVersion(policyVersion);
+ validateDeleteEligibility(policyId, policyVersion);
return modelsProvider.deleteGuardPolicy(policyId, policyVersion);
}
diff --git a/main/src/main/java/org/onap/policy/api/main/rest/provider/LegacyOperationalPolicyProvider.java b/main/src/main/java/org/onap/policy/api/main/rest/provider/LegacyOperationalPolicyProvider.java
index 5b9fdcf8..a931f593 100644
--- a/main/src/main/java/org/onap/policy/api/main/rest/provider/LegacyOperationalPolicyProvider.java
+++ b/main/src/main/java/org/onap/policy/api/main/rest/provider/LegacyOperationalPolicyProvider.java
@@ -95,8 +95,8 @@ public class LegacyOperationalPolicyProvider implements AutoCloseable {
public LegacyOperationalPolicy deleteOperationalPolicy(String policyId, String policyVersion)
throws PfModelException {
- validateDeleteEligibility(policyId, policyVersion);
validateLegacyOperationalPolicyVersion(policyVersion);
+ validateDeleteEligibility(policyId, policyVersion);
return modelsProvider.deleteOperationalPolicy(policyId, policyVersion);
}
diff --git a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestLegacyGuardPolicyProvider.java b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestLegacyGuardPolicyProvider.java
index 93144119..e892d417 100644
--- a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestLegacyGuardPolicyProvider.java
+++ b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestLegacyGuardPolicyProvider.java
@@ -189,7 +189,7 @@ public class TestLegacyGuardPolicyProvider {
assertThatThrownBy(() -> {
guardPolicyProvider.deleteGuardPolicy("dummy", null);
- }).hasMessage("version is marked @NonNull but is null");
+ }).hasMessage("legacy policy version is not an integer");
assertThatThrownBy(() -> {
guardPolicyProvider.deleteGuardPolicy("dummy", "1.0.0");
diff --git a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestLegacyOperationalPolicyProvider.java b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestLegacyOperationalPolicyProvider.java
index 5eee1e67..4b7827a9 100644
--- a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestLegacyOperationalPolicyProvider.java
+++ b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestLegacyOperationalPolicyProvider.java
@@ -178,7 +178,7 @@ public class TestLegacyOperationalPolicyProvider {
assertThatThrownBy(() -> {
operationalPolicyProvider.deleteOperationalPolicy("dummy", null);
- }).hasMessage("version is marked @NonNull but is null");
+ }).hasMessage("legacy policy version is not an integer");
assertThatThrownBy(() -> {
operationalPolicyProvider.deleteOperationalPolicy("dummy", "dummy");