diff options
Diffstat (limited to 'POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyControllerTest.java')
-rw-r--r-- | POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyControllerTest.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyControllerTest.java index 65077ae01..554c40f90 100644 --- a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyControllerTest.java +++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyControllerTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP Policy Engine * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Modifications Copyright (C) 2019 Samsung * ================================================================================ @@ -19,15 +19,19 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.policy.controller; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; + import java.util.ArrayList; import java.util.List; + import javax.script.SimpleBindings; + import org.apache.commons.io.IOUtils; import org.junit.Before; import org.junit.Test; @@ -43,17 +47,20 @@ public class PolicyControllerTest { private static Logger logger = FlexLogger.getLogger(PolicyControllerTest.class); private static CommonClassDao commonClassDao; + /** + * setUp. + * + * @throws Exception Should not throw one + */ @Before public void setUp() throws Exception { logger.info("setUp: Entering"); commonClassDao = mock(CommonClassDao.class); PolicyController.setCommonClassDao(commonClassDao); - List<Object> data = new ArrayList<>(); String policyData = ""; try { ClassLoader classLoader = getClass().getClassLoader(); - policyData = IOUtils - .toString(classLoader.getResourceAsStream("Config_SampleTest1206.1.xml")); + policyData = IOUtils.toString(classLoader.getResourceAsStream("Config_SampleTest1206.1.xml")); } catch (Exception e1) { e1.printStackTrace(); } @@ -61,6 +68,7 @@ public class PolicyControllerTest { entity.setPolicyName("Config_SampleTest.1.xml"); entity.setPolicyData(policyData); entity.setScope("com"); + List<Object> data = new ArrayList<>(); data.add(entity); when(commonClassDao.getDataByQuery( |