From b0a27abb7d8812d5a73f65645df0bdbf06e4d64d Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Tue, 10 Mar 2020 07:54:05 -0400 Subject: Fix optimization bug add coverage plus Fix a NPE bug and add more code coverage. Also is missing returning of context details for subscriber policies. This code is a bit ad-hoc and there is a separate JIRA POLICY-2147 to support re-factoring this codebase. Added scanning for advice to be returned. For optimization, because of the need for some changes in XACML github dependency, we are stuck with a little narly code to get it to fully work. POLICY-2417 is created to address this in Guilen. Upgraded to released XACML artifact - this has been tested locally for a few weeks with naming, guard and this optimzation code. It removed Jackson in lieu of Json, cleaned up some security fixes, upgraded dependencies, and added more code coverage. Issue-ID: POLICY-2066 Change-Id: I3cae99de265c815200ec2ce71e471338772bdb5b Signed-off-by: Pamela Dragosh --- .../xacml/application/common/std/StdBaseTranslatorTest.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'applications/common/src/test') diff --git a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdBaseTranslatorTest.java b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdBaseTranslatorTest.java index a7391fab..8039a9cf 100644 --- a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdBaseTranslatorTest.java +++ b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdBaseTranslatorTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import com.att.research.xacml.api.Advice; import com.att.research.xacml.api.AttributeAssignment; import com.att.research.xacml.api.Decision; import com.att.research.xacml.api.IdReference; @@ -249,6 +250,10 @@ public class StdBaseTranslatorTest { protected void scanObligations(Collection obligations, DecisionResponse decisionResponse) { } + @Override + protected void scanAdvice(Collection advice, DecisionResponse decisionResponse) { + } + } private class TestTranslator extends StdBaseTranslator { @@ -258,6 +263,10 @@ public class StdBaseTranslatorTest { protected void scanObligations(Collection obligations, DecisionResponse decisionResponse) { } + @Override + protected void scanAdvice(Collection advice, DecisionResponse decisionResponse) { + } + @Override public PolicyType convertPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException { PolicyType xacmlPolicy = new PolicyType(); -- cgit 1.2.3-korg