diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2020-03-10 07:54:05 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2020-03-10 09:37:44 -0400 |
commit | b0a27abb7d8812d5a73f65645df0bdbf06e4d64d (patch) | |
tree | 966f321e7d7259a6816ebeac28680ca1571752b6 /applications/common/src/test/java/org | |
parent | a0ad29cdb6d6f541aac59f9e265f79d3ad085560 (diff) |
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 <pdragosh@research.att.com>
Diffstat (limited to 'applications/common/src/test/java/org')
-rw-r--r-- | applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdBaseTranslatorTest.java | 11 |
1 files changed, 10 insertions, 1 deletions
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<Obligation> obligations, DecisionResponse decisionResponse) { } + @Override + protected void scanAdvice(Collection<Advice> advice, DecisionResponse decisionResponse) { + } + } private class TestTranslator extends StdBaseTranslator { @@ -259,6 +264,10 @@ public class StdBaseTranslatorTest { } @Override + protected void scanAdvice(Collection<Advice> advice, DecisionResponse decisionResponse) { + } + + @Override public PolicyType convertPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException { PolicyType xacmlPolicy = new PolicyType(); this.fillMetadataSection(xacmlPolicy, metadata); |