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%2Fcontroller%2FSafePolicyControllerTest.java;fp=ONAP-PAP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcontroller%2FSafePolicyControllerTest.java;h=7d23475a16048e21b3cb683deaa38f2890718cb4;hb=9ffce7748d288fde9e55d92367a858020e5a32fc;hp=48af2442c179bad1180847d5e82ab4068cb3a1ef;hpb=0b437d897ed2f18df6d89987056faa945531c033;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/SafePolicyControllerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/SafePolicyControllerTest.java index 48af2442c..7d23475a1 100644 --- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/SafePolicyControllerTest.java +++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/SafePolicyControllerTest.java @@ -22,6 +22,7 @@ package org.onap.policy.pap.xacml.rest.controller; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.BufferedReader; @@ -36,6 +37,7 @@ import org.junit.Test; import org.mockito.Mockito; import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; +import org.onap.policy.pap.xacml.rest.util.DictionaryUtils; import org.onap.policy.rest.dao.CommonClassDao; import org.onap.policy.rest.jpa.RiskType; import org.onap.policy.rest.jpa.SafePolicyWarning; @@ -57,20 +59,22 @@ public class SafePolicyControllerTest { public void setUp() throws Exception { logger.info("setUp: Entering"); commonClassDao = Mockito.mock(CommonClassDao.class); - + data = new ArrayList<>(); data.add("Test"); - + userInfo = new UserInfo(); userInfo.setUserLoginId("Test"); userInfo.setUserName("Test"); - + doNothing().when(commonClassDao).delete(new RiskType()); doNothing().when(commonClassDao).save(new RiskType()); - + controller = new SafePolicyController(); controller.setCommonClassDao(commonClassDao); - + new DictionaryUtils(commonClassDao); + DictionaryUtils.setDictionaryUtils(new DictionaryUtils()); + mock(DictionaryUtils.class); request = Mockito.mock(HttpServletRequest.class); response = new MockHttpServletResponse(); logger.info("setUp: exit");