summaryrefslogtreecommitdiffstats
path: root/xacml-test
diff options
context:
space:
mode:
Diffstat (limited to 'xacml-test')
-rw-r--r--xacml-test/src/main/java/org/onap/policy/pdp/xacml/xacmltest/TestUtils.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/xacml-test/src/main/java/org/onap/policy/pdp/xacml/xacmltest/TestUtils.java b/xacml-test/src/main/java/org/onap/policy/pdp/xacml/xacmltest/TestUtils.java
index fa7459dc..16bea1d1 100644
--- a/xacml-test/src/main/java/org/onap/policy/pdp/xacml/xacmltest/TestUtils.java
+++ b/xacml-test/src/main/java/org/onap/policy/pdp/xacml/xacmltest/TestUtils.java
@@ -50,11 +50,10 @@ public class TestUtils {
*
* @param resourceFile resource file
* @param service XacmlApplicationServiceProvider
- * @throws CoderException exception if it cannot be decoded
* @throws XacmlApplicationException If the application cannot load the policy
*/
public static List<ToscaPolicy> loadPolicies(String resourceFile, XacmlApplicationServiceProvider service)
- throws CoderException, XacmlApplicationException {
+ throws XacmlApplicationException {
//
// Our return object
//
@@ -66,7 +65,13 @@ public class TestUtils {
//
// Serialize it into a class
//
- ToscaServiceTemplate serviceTemplate = yamlCoder.decode(policyYaml, ToscaServiceTemplate.class);
+ ToscaServiceTemplate serviceTemplate;
+ try {
+ serviceTemplate = yamlCoder.decode(policyYaml, ToscaServiceTemplate.class);
+ } catch (CoderException e) {
+ throw new XacmlApplicationException("Failed to decode policy from resource file "
+ + e.getLocalizedMessage());
+ }
//
// Make sure all the fields are setup properly
//