diff options
Diffstat (limited to 'ECOMP-PAP-REST/src/test')
3 files changed, 29 insertions, 9 deletions
diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java index 3e1ef0469..2fef9a7cb 100644 --- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java +++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java @@ -447,4 +447,4 @@ public class DbAuditCompareEntriesTest { assertEquals(1, result.size()); logger.info("testResourceRegistrationEntity: Exit"); } -} +}
\ No newline at end of file diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/DictionaryControllerTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/DictionaryControllerTest.java index fa2899a79..82427e8cb 100644 --- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/DictionaryControllerTest.java +++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/DictionaryControllerTest.java @@ -25,24 +25,36 @@ import static org.junit.Assert.*; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; + import java.io.BufferedReader; import java.io.StringReader; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; + +import javax.json.Json; +import javax.json.JsonObject; import javax.servlet.http.HttpServletRequest; + +import org.json.JSONObject; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import org.openecomp.policy.common.logging.flexlogger.FlexLogger; import org.openecomp.policy.common.logging.flexlogger.Logger; +import org.openecomp.policy.rest.adapter.PolicyRestAdapter; import org.openecomp.policy.rest.dao.CommonClassDao; import org.openecomp.policy.rest.jpa.Attribute; import org.openecomp.policy.rest.jpa.MicroServiceModels; import org.openecomp.policy.rest.jpa.PolicyEditorScopes; import org.springframework.mock.web.MockHttpServletResponse; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.fge.jackson.JsonLoader; + /** * The class <code>DictionaryControllerTest</code> contains tests * for the class {@link <code>DictionaryController</code>}* @@ -51,7 +63,6 @@ import org.springframework.mock.web.MockHttpServletResponse; * where they have write privileges and can execute time-sensitive * tasks. */ - public class DictionaryControllerTest { private static Logger logger = FlexLogger.getLogger(DictionaryControllerTest.class); diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java index 87b5e3dbb..c1f2973d3 100644 --- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java +++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java @@ -21,12 +21,24 @@ package org.openecomp.policy.pap.xacml.rest.controller; +import static org.junit.Assert.assertEquals; +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; import java.io.StringReader; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; + import javax.servlet.http.HttpServletRequest; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import org.mockito.Mockito; import org.openecomp.policy.common.logging.flexlogger.FlexLogger; import org.openecomp.policy.common.logging.flexlogger.Logger; @@ -35,12 +47,7 @@ import org.openecomp.policy.rest.jpa.DCAEuuid; import org.openecomp.policy.rest.jpa.MicroServiceLocation; import org.openecomp.policy.rest.jpa.MicroServiceModels; import org.openecomp.policy.rest.jpa.UserInfo; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; import org.springframework.mock.web.MockHttpServletResponse; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; /** * The class <code>MicroServiceDictionaryControllerTest</code> contains tests @@ -50,6 +57,7 @@ import static org.mockito.Mockito.*; * where they have write privileges and can execute time-sensitive * tasks. */ + public class MicroServiceDictionaryControllerTest { private static Logger logger = FlexLogger.getLogger(MicroServiceDictionaryControllerTest.class); @@ -84,8 +92,9 @@ public class MicroServiceDictionaryControllerTest { doNothing().when(commonClassDao).delete(microServiceModels); - - controller = new MicroServiceDictionaryController(commonClassDao); + MicroServiceDictionaryController.setCommonClassDao(commonClassDao); + + controller = new MicroServiceDictionaryController(); HttpServletRequest request = Mockito.mock(HttpServletRequest.class); |