X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FDecisionPolicyTest.java;h=e16dd98896a5cd512df22ec081911ad8009f962f;hb=9bf8e18042746f52b96155bb2654dfb472f09e14;hp=3854ab984c483d94278d22b2fae30635a248dbff;hpb=2e138a7997326fcf47c7d1be230dab24a4ca8cd1;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicyTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicyTest.java index 3854ab984..e16dd9889 100644 --- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicyTest.java +++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicyTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 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. @@ -19,7 +19,6 @@ */ package org.onap.policy.pap.xacml.rest.components; -import static org.junit.Assert.*; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.when; @@ -30,7 +29,6 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; @@ -72,8 +70,7 @@ public class DecisionPolicyTest { policyAdapter.setRuleCombiningAlgId("urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-overrides"); policyAdapter.setPolicyType("Decision"); policyAdapter.setEditPolicy(false); - policyAdapter.setDomainDir("src/test/resources/client.properties"); - policyAdapter.setDomain("Test"); + policyAdapter.setDomainDir("Test"); policyAdapter.setNewFileName("/src/test/resources/Test/client.properties"); policyAdapter.setHighestVersion(1); policyAdapter.setPolicyID("urn:xacml:policy:id:"+UUID.randomUUID()); @@ -102,18 +99,11 @@ public class DecisionPolicyTest { policyAdapter.setRainydayMap(treatmentMap); policyAdapter.setRainyday(rainyday); - component = new DecisionPolicy(policyAdapter); + component = new DecisionPolicy(policyAdapter, null); logger.info("setUp: exit"); } - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - /** * Test method for {@link org.openecomp.policy.pap.xacml.rest.components.DecisionPolicy#savePolicies()}. */ @@ -141,25 +131,7 @@ public class DecisionPolicyTest { public void testPrepareToSaveRainyDay() { logger.debug("test PrepareToSave Policy: enter"); policyAdapter.setRuleProvider("Rainy_Day"); - component = new DecisionPolicy(policyAdapter); - boolean response = false; - - try { - response = component.prepareToSave(); - } catch (Exception e) { - logger.error("Exception Occured"+e); - } - assertTrue(response); - } - - /** - * Test method for {@link org.openecomp.policy.pap.xacml.rest.components.DecisionPolicy#prepareToSave()}. - */ - @Test - public void testPrepareToSaveCustom() { - logger.debug("test PrepareToSave Policy: enter"); - policyAdapter.setRuleProvider("Custom"); - component = new DecisionPolicy(policyAdapter); + component = new DecisionPolicy(policyAdapter, null); boolean response = false; try { @@ -169,6 +141,4 @@ public class DecisionPolicyTest { } assertTrue(response); } - - } \ No newline at end of file