From 24446884306a87a1d22fb8d0b28efbf41201a87c Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Mon, 19 Jul 2021 14:37:41 -0400 Subject: Include returned attributes in Decision Adds new method to return attributes in a decision, which can be configurable. By default it is turned off which ensures that the current functionality is maintained for our client applications. Enhanced the JUnits for the applications to ensure that no extra information is passed, thus maintaining backward compatibility. Issue-ID: POLICY-2865 Change-Id: Ia533e5462c0cb475cb1f72f34e95f128d6c52678 Signed-off-by: Pamela Dragosh --- .../optimization/OptimizationPdpApplicationTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'applications/optimization/src/test') diff --git a/applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java b/applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java index a3b218c6..00855f40 100644 --- a/applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java +++ b/applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java @@ -209,6 +209,13 @@ public class OptimizationPdpApplicationTest { assertThat(decision.getKey()).isNotNull(); assertThat(decision.getKey().getPolicies()).isEmpty(); + // + // Optimization applications should not have this information returned. Except advice + // for subscriber details, which does get checked in the tests following. + // + assertThat(decision.getKey().getAdvice()).isNull(); + assertThat(decision.getKey().getObligations()).isNull(); + assertThat(decision.getKey().getAttributes()).isNull(); } /** @@ -431,6 +438,11 @@ public class OptimizationPdpApplicationTest { assertThat(response).isNotNull(); assertThat(response.getPolicies()).hasSize(expectedPolicyCount); // + // Optimization applications should not have this information returned + // + assertThat(response.getObligations()).isNull(); + assertThat(response.getAttributes()).isNull(); + // // Validate it // validateDecision(response, baseRequest); -- cgit 1.2.3-korg