aboutsummaryrefslogtreecommitdiffstats
path: root/applications/guard/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'applications/guard/src/main/java')
-rw-r--r--applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java
index b3ee36bc..2b713740 100644
--- a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java
+++ b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -129,6 +130,12 @@ public class GuardTranslator implements ToscaPolicyTranslator {
//
this.fillMetadataSection(newPolicyType, toscaPolicy.getMetadata());
//
+ // There should be properties metadata section
+ //
+ if (toscaPolicy.getProperties() == null) {
+ throw new ToscaPolicyConversionException("no properties specified on guard policy: " + policyName);
+ }
+ //
// Generate the TargetType - add true if not blacklist
//
newPolicyType.setTarget(this.generateTargetType(toscaPolicy.getProperties(),
@@ -694,4 +701,4 @@ public class GuardTranslator implements ToscaPolicyTranslator {
return rule;
}
-} \ No newline at end of file
+}