diff --git a/BRMSGateway/dependency.json b/BRMSGateway/dependency.json
index fcdcebd..a8b3317 100644
--- a/BRMSGateway/dependency.json
+++ b/BRMSGateway/dependency.json
@@ -96,7 +96,7 @@
         }, {
             "groupId": "com.att.research.xacml",
             "artifactId": "xacml-pdp",
-            "version": "1.0.0"
+            "version": "1.0.1"
         }]
     }
 }
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ActionPolicyDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ActionPolicyDictionaryController.java
index 5c9b2b8..02b0707 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ActionPolicyDictionaryController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ActionPolicyDictionaryController.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.
@@ -61,6 +61,10 @@
 	public ActionPolicyDictionaryController(CommonClassDao commonClassDao){
 		ActionPolicyDictionaryController.commonClassDao = commonClassDao;
 	}
+	
+	public void setCommonClassDao(CommonClassDao commonClassDao){
+		ActionPolicyDictionaryController.commonClassDao = commonClassDao;
+	}
 	/*
 	 * This is an empty constructor
 	 */	
@@ -124,8 +128,8 @@
 			String userId = null;
 
 			if(fromAPI) {
-				actionPolicyDict = (ActionPolicyDict)mapper.readValue(root.get("dictionaryFields").toString(), ActionPolicyDict.class);
-				adapter = (ActionAdapter)mapper.readValue(root.get("dictionaryFields").toString(), ActionAdapter.class);
+				actionPolicyDict = mapper.readValue(root.get("dictionaryFields").toString(), ActionPolicyDict.class);
+				adapter = mapper.readValue(root.get("dictionaryFields").toString(), ActionAdapter.class);
 				userId = "API";
 
 				//check if update operation or create, get id for data to be updated and update attributeData
@@ -142,11 +146,11 @@
 					actionPolicyDict.setUserCreatedBy(this.getUserInfo(userId));
 				}
 			} else {
-				actionPolicyDict = (ActionPolicyDict)mapper.readValue(root.get("actionPolicyDictionaryData").toString(), ActionPolicyDict.class);
+				actionPolicyDict = mapper.readValue(root.get("actionPolicyDictionaryData").toString(), ActionPolicyDict.class);
 				adapter = mapper.readValue(root.get("actionPolicyDictionaryData").toString(), ActionAdapter.class);
 				userId = root.get("userid").textValue();
 			}
-			String header = "";
+			StringBuilder header = new StringBuilder();
 			int counter = 0;
 			if(!adapter.getHeaders().isEmpty()){
 				for(Object attribute : adapter.getHeaders()){
@@ -154,15 +158,14 @@
 						String key = ((LinkedHashMap<?, ?>) attribute).get("option").toString();
 						String value = ((LinkedHashMap<?, ?>) attribute).get("number").toString();
 						if(counter>0){
-							header = header + ":";
+							header.append(":");
 						}
-						header = header + key + "=";
-						header = header + value;
+						header.append(key).append("=").append(value);
 						counter ++;
 					}
 				}
 			}
-			actionPolicyDict.setHeader(header);
+			actionPolicyDict.setHeader(header.toString());
 			if(actionPolicyDict.getId() == 0){
 				List<Object> duplicateData =  commonClassDao.checkDuplicateEntry(actionPolicyDict.getAttributeName(), attributeName, ActionPolicyDict.class);
 				if(!duplicateData.isEmpty()){
@@ -222,12 +225,12 @@
 	}
 
 	@RequestMapping(value={"/action_dictionary/remove_actionPolicyDict"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
-	public ModelAndView removeActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException {
+	public void removeActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException {
 		try{
 			ObjectMapper mapper = new ObjectMapper();
 			mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
 			JsonNode root = mapper.readTree(request.getReader());
-			ActionPolicyDict actionPolicyDict = (ActionPolicyDict)mapper.readValue(root.get("data").toString(), ActionPolicyDict.class);
+			ActionPolicyDict actionPolicyDict = mapper.readValue(root.get("data").toString(), ActionPolicyDict.class);
 			commonClassDao.delete(actionPolicyDict);
 			response.setCharacterEncoding(utf8);
 			response.setContentType("application / json");
@@ -238,8 +241,6 @@
 			String responseString = mapper.writeValueAsString(ActionPolicyDictionaryController.commonClassDao.getData(ActionPolicyDict.class));
 			JSONObject j = new JSONObject("{actionPolicyDictionaryDatas: " + responseString + "}");
 			out.write(j.toString());
-
-			return null;
 		}
 		catch (Exception e){
 			LOGGER.error(e);
@@ -248,7 +249,6 @@
 			PrintWriter out = response.getWriter();
 			out.write(e.getMessage());
 		}
-		return null;
 	}
 }
 
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java
index f359ca2..a55ed40 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.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.
@@ -88,6 +88,10 @@
 	public ClosedLoopDictionaryController(CommonClassDao commonClassDao){
 		ClosedLoopDictionaryController.commonClassDao = commonClassDao;
 	}
+	
+	public void setCommonClassDao(CommonClassDao commonClassDao){
+		ClosedLoopDictionaryController.commonClassDao = commonClassDao;
+	}
 	/*
 	 * This is an empty constructor
 	 */
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DescriptiveDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DescriptiveDictionaryController.java
index a12f17b..b383518 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DescriptiveDictionaryController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DescriptiveDictionaryController.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.
@@ -64,15 +64,20 @@
 		DescriptiveDictionaryController.commonClassDao = commonClassDao;
 	}
 	
-	public DescriptiveDictionaryController(){}
+	public void setCommonClassDao(CommonClassDao commonClassDao){
+		DescriptiveDictionaryController.commonClassDao = commonClassDao;
+	}
+	
+	public DescriptiveDictionaryController(){
+		//Empty Constructor
+	}
 	
 	public UserInfo getUserInfo(String loginId){
-		UserInfo name = (UserInfo) commonClassDao.getEntityItem(UserInfo.class, "userLoginId", loginId);
-		return name;	
+		return (UserInfo) commonClassDao.getEntityItem(UserInfo.class, "userLoginId", loginId);
 	}
 
 	@RequestMapping(value={"/get_DescriptiveScopeByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
-	public void getDescriptiveDictionaryByNameEntityData(HttpServletRequest request, HttpServletResponse response){
+	public void getDescriptiveDictionaryByNameEntityData(HttpServletResponse response){
 		try{
 			Map<String, Object> model = new HashMap<>();
 			ObjectMapper mapper = new ObjectMapper();
@@ -121,8 +126,8 @@
             GridData data;
             String userId = null;
             if (fromAPI) {
-                descriptiveScope = (DescriptiveScope)mapper.readValue(root.get("dictionaryFields").toString(), DescriptiveScope.class);
-                data = (GridData)mapper.readValue(root.get("dictionaryFields").toString(), GridData.class);
+                descriptiveScope = mapper.readValue(root.get("dictionaryFields").toString(), DescriptiveScope.class);
+                data = mapper.readValue(root.get("dictionaryFields").toString(), GridData.class);
                 userId = "API";
                 
                 //check if update operation or create, get id for data to be updated and update attributeData
@@ -140,27 +145,26 @@
                 	descriptiveScope.setUserCreatedBy(this.getUserInfo(userId));
                 }
             } else {
-            	descriptiveScope = (DescriptiveScope)mapper.readValue(root.get("descriptiveScopeDictionaryData").toString(), DescriptiveScope.class);
-            	data = (GridData)mapper.readValue(root.get("descriptiveScopeDictionaryData").toString(), GridData.class);
+            	descriptiveScope = mapper.readValue(root.get("descriptiveScopeDictionaryData").toString(), DescriptiveScope.class);
+            	data = mapper.readValue(root.get("descriptiveScopeDictionaryData").toString(), GridData.class);
             	userId = root.get("userid").textValue();
             }
-			String header = "";
+			StringBuilder header = new StringBuilder();
 			int counter = 0;
-			if(data.getAttributes().size() > 0){
+			if(!data.getAttributes().isEmpty()){
 				for(Object attribute : data.getAttributes()){
 					if(attribute instanceof LinkedHashMap<?, ?>){
 						String key = ((LinkedHashMap<?, ?>) attribute).get("option").toString();
 						String value = ((LinkedHashMap<?, ?>) attribute).get("number").toString();
 						if(counter>0){
-							header = header + "AND";
+							header.append("AND");
 						}
-						header = header + key + ":";
-						header = header + value;
+						header.append(key).append(":").append(value);
 						counter ++;
 					}
 				}
 			}
-			descriptiveScope.setSearch(header);
+			descriptiveScope.setSearch(header.toString());
 			if(descriptiveScope.getId() == 0){
 				List<Object> duplicateData =  commonClassDao.checkDuplicateEntry(descriptiveScope.getScopeName(), "descriptiveScopeName", DescriptiveScope.class);
 				if(!duplicateData.isEmpty()){
@@ -217,12 +221,12 @@
 	}
 
 	@RequestMapping(value={"/descriptive_dictionary/remove_descriptiveScope"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
-	public ModelAndView removeDescriptiveDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
+	public void removeDescriptiveDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException{
 		try{
 			ObjectMapper mapper = new ObjectMapper();
 			mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
 			JsonNode root = mapper.readTree(request.getReader());
-			DescriptiveScope descriptiveScope = (DescriptiveScope)mapper.readValue(root.get("data").toString(), DescriptiveScope.class);
+			DescriptiveScope descriptiveScope = mapper.readValue(root.get("data").toString(), DescriptiveScope.class);
 			commonClassDao.delete(descriptiveScope);
 			response.setCharacterEncoding("UTF-8");
 			response.setContentType("application / json");
@@ -233,8 +237,6 @@
 			String responseString = mapper.writeValueAsString(commonClassDao.getData(DescriptiveScope.class));
 			JSONObject j = new JSONObject("{descriptiveScopeDictionaryDatas: " + responseString + "}");
 			out.write(j.toString());
-
-			return null;
 		}
 		catch (Exception e){
 			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
@@ -243,7 +245,6 @@
 			PrintWriter out = response.getWriter();
 			out.write(PolicyUtils.CATCH_EXCEPTION);
 		}
-		return null;
 	}
 }
 
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/EnforcerDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/EnforcerDictionaryController.java
deleted file mode 100644
index 9e248bf..0000000
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/EnforcerDictionaryController.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP-PAP-REST
- * ================================================================================
- * Copyright (C) 2017 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.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.pap.xacml.rest.controller;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.json.JSONObject;
-import org.onap.policy.common.logging.flexlogger.FlexLogger;
-import org.onap.policy.common.logging.flexlogger.Logger;
-import org.onap.policy.pap.xacml.rest.util.JsonMessage;
-import org.onap.policy.rest.dao.CommonClassDao;
-import org.onap.policy.rest.jpa.EnforcingType;
-import org.onap.policy.utils.PolicyUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.servlet.ModelAndView;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Controller
-public class EnforcerDictionaryController {
-
-	private static final Logger LOGGER	= FlexLogger.getLogger(EnforcerDictionaryController.class);
-	
-	@Autowired
-	CommonClassDao commonClassDao;
-
-	@RequestMapping(value={"/get_EnforcerTypeData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
-	public void getEnforcerDictionaryEntityData(HttpServletResponse response){
-		try{
-			Map<String, Object> model = new HashMap<>();
-			ObjectMapper mapper = new ObjectMapper();
-			List<Object> list = commonClassDao.getData(EnforcingType.class);
-			List<String> dictList = new ArrayList<>();
-			for(int i = 0; i < list.size(); i++){
-				EnforcingType dict = (EnforcingType) list.get(i);
-				dictList.add(dict.getEnforcingType());
-			}
-			model.put("enforcerDictionaryDatas", mapper.writeValueAsString(dictList));
-			org.onap.policy.pap.xacml.rest.util.JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
-			JSONObject j = new JSONObject(msg);
-			response.getWriter().write(j.toString());
-		}
-		catch (Exception e){
-			LOGGER.error("Exception Occured"+e);
-		}
-	}
-	
-	@RequestMapping(value={"/enforcer_dictionary/save_enforcerType"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
-	public ModelAndView saveEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
-		try {
-			ObjectMapper mapper = new ObjectMapper();
-			mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-			JsonNode root = mapper.readTree(request.getReader());
-			EnforcingType enforcingType = (EnforcingType)mapper.readValue(root.get("enforcerDictionaryData").toString(), EnforcingType.class);
-			if(enforcingType.getId() == 0){
-				commonClassDao.save(enforcingType);
-			}else{
-				commonClassDao.update(enforcingType); 
-			} 
-			response.setCharacterEncoding("UTF-8");
-			response.setContentType("application / json");
-			request.setCharacterEncoding("UTF-8");
-
-			PrintWriter out = response.getWriter();
-			String responseString = mapper.writeValueAsString(commonClassDao.getData(EnforcingType.class));
-			JSONObject j = new JSONObject("{enforcerDictionaryDatas: " + responseString + "}");
-
-			out.write(j.toString());
-
-			return null;
-		}
-		catch (Exception e){
-			response.setCharacterEncoding("UTF-8");
-			request.setCharacterEncoding("UTF-8");
-			PrintWriter out = response.getWriter();
-			out.write(PolicyUtils.CATCH_EXCEPTION);
-			LOGGER.error(e);
-		}
-		return null;
-	}
-
-	@RequestMapping(value={"/enforcer_dictionary/remove_enforcer"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
-	public ModelAndView removeEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
-		try{
-			ObjectMapper mapper = new ObjectMapper();
-			mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-			JsonNode root = mapper.readTree(request.getReader());
-			EnforcingType enforcingType = (EnforcingType)mapper.readValue(root.get("data").toString(), EnforcingType.class);
-			commonClassDao.delete(enforcingType);
-			response.setCharacterEncoding("UTF-8");
-			response.setContentType("application / json");
-			request.setCharacterEncoding("UTF-8");
-
-			PrintWriter out = response.getWriter();
-
-			String responseString = mapper.writeValueAsString(commonClassDao.getData(EnforcingType.class));
-			JSONObject j = new JSONObject("{enforcerDictionaryDatas: " + responseString + "}");
-			out.write(j.toString());
-
-			return null;
-		}
-		catch (Exception e){
-			System.out.println(e);
-			response.setCharacterEncoding("UTF-8");
-			request.setCharacterEncoding("UTF-8");
-			PrintWriter out = response.getWriter();
-			out.write(PolicyUtils.CATCH_EXCEPTION);
-		}
-		return null;
-	}
-}
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java
index ae749ad..a6d740e 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.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.
@@ -75,9 +75,6 @@
 			case "DescriptiveScope":
 				dictionary.getDescriptiveDictionary(response);
 				break;
-			case "Enforcer":
-				dictionary.getEnforcerDictionary(response);
-				break;
 			case "ActionList":
 				dictionary.getActionListDictionary(response);
 				break;
@@ -221,9 +218,6 @@
 			case "DescriptiveScope":
 				result = dictionary.saveDescriptiveDictionary(request, response);
 				break;
-			case "Enforcer":
-				result = dictionary.saveEnforcerDictionary(request, response);
-				break;
 			case "ActionList":
 				result = dictionary.saveActionListDictionary(request, response);
 				break;
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/service/DictionaryService.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/service/DictionaryService.java
index 6e19b9b..20bd946 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/service/DictionaryService.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/service/DictionaryService.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.
@@ -23,13 +23,13 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.onap.policy.pap.xacml.rest.controller.ActionPolicyDictionaryController;
 import org.onap.policy.pap.xacml.rest.controller.BRMSDictionaryController;
 import org.onap.policy.pap.xacml.rest.controller.ClosedLoopDictionaryController;
 import org.onap.policy.pap.xacml.rest.controller.DecisionPolicyDictionaryController;
 import org.onap.policy.pap.xacml.rest.controller.DescriptiveDictionaryController;
 import org.onap.policy.pap.xacml.rest.controller.DictionaryController;
-import org.onap.policy.pap.xacml.rest.controller.EnforcerDictionaryController;
 import org.onap.policy.pap.xacml.rest.controller.FirewallDictionaryController;
 import org.onap.policy.pap.xacml.rest.controller.MicroServiceDictionaryController;
 import org.onap.policy.pap.xacml.rest.controller.PolicyScopeDictionaryController;
@@ -135,13 +135,6 @@
 		return result.getViewName();
 	}
 	
-	public String saveEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException{
-		
-		EnforcerDictionaryController dictionary = new EnforcerDictionaryController();
-			ModelAndView result = dictionary.saveEnforcerDictionary(request, response);
-		return result.getViewName();
-	}
-	
 	public String saveActionListDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException{
 		
 		FirewallDictionaryController dictionary = new FirewallDictionaryController();
@@ -360,11 +353,6 @@
 			dictionary.getDescriptiveDictionaryEntityData(response);
 	}
 	
-	public void getEnforcerDictionary(HttpServletResponse response){
-		EnforcerDictionaryController dictionary = new EnforcerDictionaryController();
-			dictionary.getEnforcerDictionaryEntityData(response);
-	}
-	
 	public void getActionListDictionary(HttpServletResponse response){
 		FirewallDictionaryController dictionary = new FirewallDictionaryController();
 			dictionary.getActionListDictionaryEntityData(response);
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ActionPolicyDictionaryControllerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ActionPolicyDictionaryControllerTest.java
new file mode 100644
index 0000000..0191acf
--- /dev/null
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ActionPolicyDictionaryControllerTest.java
@@ -0,0 +1,157 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP-PAP-REST
+ * ================================================================================
+ * Copyright (C) 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.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+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.when;
+
+import java.io.BufferedReader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.junit.Before;
+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.rest.dao.CommonClassDao;
+import org.onap.policy.rest.jpa.ActionPolicyDict;
+import org.onap.policy.rest.jpa.UserInfo;
+import org.springframework.mock.web.MockHttpServletResponse;
+
+public class ActionPolicyDictionaryControllerTest {
+
+	private static Logger logger = FlexLogger.getLogger(ActionPolicyDictionaryControllerTest.class);
+	private static CommonClassDao commonClassDao;
+	private String jsonString = null;
+	private HttpServletRequest request = null;
+	private ActionPolicyDictionaryController controller = null;
+	private MockHttpServletResponse response = null;
+
+	@Before
+	public void setUp() throws Exception {
+		logger.info("setUp: Entering");
+		commonClassDao = Mockito.mock(CommonClassDao.class);
+		List<String>  data = new ArrayList<>();
+		List<Object>  objectData = new ArrayList<>();
+		data.add("Test");
+		
+		UserInfo userInfo = new UserInfo();
+		userInfo.setUserLoginId("Test");
+		userInfo.setUserName("Test");
+		
+		ActionPolicyDict actionData = new ActionPolicyDict();
+		actionData.setAttributeName("Test");
+		assertTrue("Test".equals(actionData.getAttributeName()));
+		actionData.setBody("Test");
+		assertTrue("Test".equals(actionData.getBody()));
+		actionData.setCreatedDate(new Date());
+		assertTrue(actionData.getCreatedDate()!= null);
+		actionData.setModifiedDate(new Date());
+		assertTrue(actionData.getModifiedDate()!= null);
+		actionData.setHeader("Test");
+		assertTrue("Test".equals(actionData.getHeader()));
+		actionData.setMethod("POST");
+		assertTrue("POST".equals(actionData.getMethod()));
+		actionData.setType("Test");
+		assertTrue("Test".equals(actionData.getType()));
+		actionData.setUrl("http://test.com");
+		assertTrue("http://test.com".equals(actionData.getUrl()));
+		actionData.setUserCreatedBy(userInfo);
+		assertTrue(actionData.getUserCreatedBy()!= null);
+		actionData.setUserModifiedBy(userInfo);
+		assertTrue(actionData.getUserModifiedBy()!= null);
+		
+		objectData.add(actionData);
+		when(commonClassDao.getDataByColumn(ActionPolicyDict.class, "attributeName")).thenReturn(data);
+		when(commonClassDao.getData(ActionPolicyDict.class)).thenReturn(objectData);
+		doNothing().when(commonClassDao).delete(new ActionPolicyDict());
+		doNothing().when(commonClassDao).save(new ActionPolicyDict());
+		controller = new ActionPolicyDictionaryController();
+		controller.setCommonClassDao(commonClassDao);
+		request = Mockito.mock(HttpServletRequest.class);
+		response =  new MockHttpServletResponse();  
+		logger.info("setUp: exit");
+	}
+	
+	@Test
+	public void testGetActionEntitybyName(){
+		controller.getActionEntitybyName(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("actionPolicyDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetActionPolicyDictionaryEntityData(){
+		controller.getActionPolicyDictionaryEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("actionPolicyDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testSaveActionPolicyDictionary(){
+		jsonString = "{\"actionPolicyDictionaryData\":{\"attributeName\":\"Test\",\"body\":\"{}\",\"description\":\"test\",\"headers\":[{\"$$hashKey\":\"object:548\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"method\":\"GET\",\"type\":\"REST\",\"url\":\"http://test.com\"},\"userid\":\"demo\"}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveActionPolicyDictionary(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("actionPolicyDictionaryData"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testUpdateActionPolicyDictionary(){
+		jsonString = "{\"actionPolicyDictionaryData\":{\"id\":1,\"attributeName\":\"Test\",\"body\":\"{}\",\"description\":\"test\",\"headers\":[{\"$$hashKey\":\"object:548\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"method\":\"GET\",\"type\":\"REST\",\"url\":\"http://test.com\"},\"userid\":\"demo\"}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveActionPolicyDictionary(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("actionPolicyDictionaryData"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testRemoveActionPolicyDictionary(){
+		jsonString = "{\"data\":{\"$$hashKey\":\"uiGrid-003S\",\"attributeName\":\"Test\",\"body\":\"{}\",\"createdDate\":1518195117000,\"description\":\"test\",\"header\":\"test=12\",\"id\":1,\"method\":\"GET\",\"modifiedDate\":1518195489000,\"type\":\"REST\",\"url\":\"http://test.com\",\"userCreatedBy\":{\"userLoginId\":\"demo\",\"userName\":\"Demo\"},\"userModifiedBy\":{\"userLoginId\":\"demo\",\"userName\":\"Demo\"}}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.removeActionPolicyDictionary(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("actionPolicyDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+}
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryControllerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryControllerTest.java
new file mode 100644
index 0000000..d1af82c
--- /dev/null
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryControllerTest.java
@@ -0,0 +1,584 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP-PAP-REST
+ * ================================================================================
+ * Copyright (C) 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.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+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.when;
+
+import java.io.BufferedReader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.junit.Before;
+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.rest.dao.CommonClassDao;
+import org.onap.policy.rest.jpa.ClosedLoopD2Services;
+import org.onap.policy.rest.jpa.ClosedLoopSite;
+import org.onap.policy.rest.jpa.PEPOptions;
+import org.onap.policy.rest.jpa.UserInfo;
+import org.onap.policy.rest.jpa.VNFType;
+import org.onap.policy.rest.jpa.VSCLAction;
+import org.onap.policy.rest.jpa.VarbindDictionary;
+import org.springframework.mock.web.MockHttpServletResponse;
+
+public class ClosedLoopDictionaryControllerTest {
+	
+	private static Logger logger = FlexLogger.getLogger(ClosedLoopDictionaryControllerTest.class);
+	private static CommonClassDao commonClassDao;
+	private String jsonString = null;
+	private HttpServletRequest request = null;
+	private ClosedLoopDictionaryController controller = null;
+	private MockHttpServletResponse response = null;
+	private UserInfo userInfo;
+	private List<String>  data;
+
+	@Before
+	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 VSCLAction());
+		doNothing().when(commonClassDao).save(new VSCLAction());
+		
+		controller = new ClosedLoopDictionaryController();
+		controller.setCommonClassDao(commonClassDao);
+		
+		request = Mockito.mock(HttpServletRequest.class);
+		response =  new MockHttpServletResponse();  
+		logger.info("setUp: exit");
+	}
+	
+	public List<Object> testVSCLAction(){
+		List<Object>  objectData = new ArrayList<>();
+		
+		VSCLAction data = new VSCLAction();
+		data.setId(1);
+		assertTrue(1 == data.getId());
+		data.setVsclaction("Test");
+		assertTrue("Test".equals(data.getVsclaction()));
+		data.setDescription("Test");
+		assertTrue("Test".equals(data.getDescription()));
+		data.setCreatedDate(new Date());
+		assertTrue(data.getCreatedDate()!= null);
+		data.setModifiedDate(new Date());
+		assertTrue(data.getModifiedDate()!= null);
+		data.setUserCreatedBy(userInfo);
+		assertTrue(data.getUserCreatedBy()!= null);
+		data.setUserModifiedBy(userInfo);
+		assertTrue(data.getUserModifiedBy()!= null);
+		objectData.add(data);
+		
+		return objectData;
+	}
+	
+	public List<Object> testVNFType(){
+		List<Object>  objectData = new ArrayList<>();
+		
+		VNFType data = new VNFType();
+		data.setId(1);
+		assertTrue(1 == data.getId());
+		data.setVnftype("Test");
+		assertTrue("Test".equals(data.getVnftype()));
+		data.setDescription("Test");
+		assertTrue("Test".equals(data.getDescription()));
+		data.setCreatedDate(new Date());
+		assertTrue(data.getCreatedDate()!= null);
+		data.setModifiedDate(new Date());
+		assertTrue(data.getModifiedDate()!= null);
+		data.setUserCreatedBy(userInfo);
+		assertTrue(data.getUserCreatedBy()!= null);
+		data.setUserModifiedBy(userInfo);
+		assertTrue(data.getUserModifiedBy()!= null);
+		objectData.add(data);
+		
+		return objectData;
+	}
+	
+	public List<Object> testPEPOptions(){
+		List<Object>  objectData = new ArrayList<>();
+
+		PEPOptions data = new PEPOptions();
+		data.setId(1);
+		assertTrue(1 == data.getId());
+		data.setPepName("Test");
+		assertTrue("Test".equals(data.getPepName()));
+		data.setDescription("Test");
+		assertTrue("Test".equals(data.getDescription()));
+		data.setCreatedDate(new Date());
+		assertTrue(data.getCreatedDate()!= null);
+		data.setModifiedDate(new Date());
+		assertTrue(data.getModifiedDate()!= null);
+		data.setUserCreatedBy(userInfo);
+		assertTrue(data.getUserCreatedBy()!= null);
+		data.setUserModifiedBy(userInfo);
+		assertTrue(data.getUserModifiedBy()!= null);
+		objectData.add(data);
+
+		return objectData;
+	}
+	
+	public List<Object> testVarbindDictionary(){
+		List<Object>  objectData = new ArrayList<>();
+
+		VarbindDictionary data = new VarbindDictionary();
+		data.setId(1);
+		assertTrue(1 == data.getId());
+		data.setVarbindName("Test");
+		assertTrue("Test".equals(data.getVarbindName()));
+		data.setVarbindDescription("Test");
+		assertTrue("Test".equals(data.getVarbindDescription()));
+		data.setVarbindOID("Test");
+		assertTrue("Test".equals(data.getVarbindOID()));
+		data.setCreatedDate(new Date());
+		assertTrue(data.getCreatedDate()!= null);
+		data.setModifiedDate(new Date());
+		assertTrue(data.getModifiedDate()!= null);
+		data.setUserCreatedBy(userInfo);
+		assertTrue(data.getUserCreatedBy()!= null);
+		data.setUserModifiedBy(userInfo);
+		assertTrue(data.getUserModifiedBy()!= null);
+		objectData.add(data);
+
+		return objectData;
+	}
+	
+	public List<Object> testClosedLoopD2Services(){
+		List<Object>  objectData = new ArrayList<>();
+
+		ClosedLoopD2Services data = new ClosedLoopD2Services();
+		data.setId(1);
+		assertTrue(1 == data.getId());
+		data.setServiceName("Test");
+		assertTrue("Test".equals(data.getServiceName()));
+		data.setDescription("Test");
+		assertTrue("Test".equals(data.getDescription()));
+		data.setCreatedDate(new Date());
+		assertTrue(data.getCreatedDate()!= null);
+		data.setModifiedDate(new Date());
+		assertTrue(data.getModifiedDate()!= null);
+		data.setUserCreatedBy(userInfo);
+		assertTrue(data.getUserCreatedBy()!= null);
+		data.setUserModifiedBy(userInfo);
+		assertTrue(data.getUserModifiedBy()!= null);
+		objectData.add(data);
+
+		return objectData;
+	}
+	
+	
+	public List<Object> testClosedLoopSite(){
+		List<Object>  objectData = new ArrayList<>();
+
+		ClosedLoopSite data = new ClosedLoopSite();
+		data.setId(1);
+		assertTrue(1 == data.getId());
+		data.setSiteName("Test");
+		assertTrue("Test".equals(data.getSiteName()));
+		data.setDescription("Test");
+		assertTrue("Test".equals(data.getDescription()));
+		data.setCreatedDate(new Date());
+		assertTrue(data.getCreatedDate()!= null);
+		data.setModifiedDate(new Date());
+		assertTrue(data.getModifiedDate()!= null);
+		data.setUserCreatedBy(userInfo);
+		assertTrue(data.getUserCreatedBy()!= null);
+		data.setUserModifiedBy(userInfo);
+		assertTrue(data.getUserModifiedBy()!= null);
+		objectData.add(data);
+
+		return objectData;
+	}
+	
+	@Test
+	public void testGetVSCLActionDictionaryByNameEntityData(){
+		when(commonClassDao.getDataByColumn(VSCLAction.class, "vsclaction")).thenReturn(data);
+		controller.getVSCLActionDictionaryByNameEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vsclActionDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetVSCLActionDictionaryEntityData(){
+		when(commonClassDao.getData(VSCLAction.class)).thenReturn(testVSCLAction());
+		controller.getVSCLActionDictionaryEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vsclActionDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetVNFTypeDictionaryByNameEntityData(){
+		when(commonClassDao.getDataByColumn(VNFType.class, "vnftype")).thenReturn(data);
+		controller.getVNFTypeDictionaryByNameEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vnfTypeDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetVNFTypeDictionaryEntityData(){
+		when(commonClassDao.getData(VNFType.class)).thenReturn(testVNFType());
+		controller.getVNFTypeDictionaryEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vnfTypeDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetPEPOptionsDictionaryByNameEntityData(){
+		when(commonClassDao.getDataByColumn(PEPOptions.class, "pepName")).thenReturn(data);
+		controller.getPEPOptionsDictionaryByNameEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetPEPOptionsDictionaryEntityData(){
+		when(commonClassDao.getData(PEPOptions.class)).thenReturn(testPEPOptions());
+		controller.getPEPOptionsDictionaryEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetVarbindDictionaryByNameEntityData(){
+		when(commonClassDao.getDataByColumn(VarbindDictionary.class, "varbindName")).thenReturn(data);
+		controller.getVarbindDictionaryByNameEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("varbindDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetVarbindDictionaryEntityData(){
+		when(commonClassDao.getData(VarbindDictionary.class)).thenReturn(testVarbindDictionary());
+		controller.getVarbindDictionaryEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("varbindDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetClosedLoopServiceDictionaryByNameEntityData(){
+		when(commonClassDao.getDataByColumn(ClosedLoopD2Services.class, "serviceName")).thenReturn(data);
+		controller.getClosedLoopServiceDictionaryByNameEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopServiceDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetClosedLoopServiceDictionaryEntityData(){
+		when(commonClassDao.getData(ClosedLoopD2Services.class)).thenReturn(testClosedLoopD2Services());
+		controller.getClosedLoopServiceDictionaryEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopServiceDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetClosedLoopSiteDictionaryByNameEntityData(){
+		when(commonClassDao.getDataByColumn(ClosedLoopSite.class, "siteName")).thenReturn(data);
+		controller.getClosedLoopSiteDictionaryByNameEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetClosedLoopSiteDictionaryEntityData(){
+		when(commonClassDao.getData(ClosedLoopSite.class)).thenReturn(testClosedLoopSite());
+		controller.getClosedLoopSiteDictionaryEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testSaveVSCLAction(){
+		jsonString = "{\"userid\":\"demo\",\"vsclActionDictionaryData\":{\"description\":\"test\",\"vsclaction\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveVSCLAction(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vsclActionDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testUpdateVSCLAction(){
+		jsonString = "{\"userid\":\"demo\",\"vsclActionDictionaryData\":{\"id\":1,\"description\":\"test\",\"vsclaction\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveVSCLAction(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vsclActionDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testRemoveVSCLAction(){
+		jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"vsclaction\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.removeVSCLAction(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vsclActionDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testSaveVnfType(){
+		jsonString = "{\"userid\":\"demo\",\"vnfTypeDictionaryData\":{\"description\":\"test\",\"vnftype\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveVnfType(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vnfTypeDictionaryData"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testUpdateVnfType(){
+		jsonString = "{\"userid\":\"demo\",\"vnfTypeDictionaryData\":{\"id\":1,\"description\":\"test\",\"vnftype\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveVnfType(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vnfTypeDictionaryData"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testRemoveVnfType(){
+		jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"vnftype\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.removeVnfType(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("vnfTypeDictionaryData"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testSavePEPOptions(){
+		jsonString = "{\"pepOptionsDictionaryData\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"pepName\":\"Test\"},\"userid\":\"demo\"}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.savePEPOptions(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testUpdatePEPOptions(){
+		jsonString = "{\"pepOptionsDictionaryData\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"pepName\":\"Test\",\"id\":1},\"userid\":\"demo\"}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.savePEPOptions(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testRemovePEPOptions(){
+		jsonString = "{\"data\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"pepName\":\"Test\"},\"userid\":\"demo\"}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.removePEPOptions(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("pepOptionsDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testSaveServiceType(){
+		jsonString = "{\"userid\":\"demo\",\"closedLoopServiceDictionaryData\":{\"description\":\"test\",\"serviceName\":\"Test\",\"id\":1}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveServiceType(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopServiceDictionaryData"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testUpdateServiceType(){
+		jsonString = "{\"userid\":\"demo\",\"closedLoopServiceDictionaryData\":{\"id\":1,\"description\":\"test\",\"serviceName\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveServiceType(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopServiceDictionaryData"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testRemoveServiceType(){
+		jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"serviceName\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.removeServiceType(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopServiceDictionaryData"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testSaveSiteType(){
+		jsonString = "{\"userid\":\"demo\",\"closedLoopSiteDictionaryData\":{\"description\":\"test\",\"siteName\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveSiteType(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testUpdateSiteType(){
+		jsonString = "{\"userid\":\"demo\",\"closedLoopSiteDictionaryData\":{\"id\":1,\"description\":\"test\",\"siteName\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveSiteType(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testRemoveSiteType(){
+		jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"siteName\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.removeSiteType(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("closedLoopSiteDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testSaveVarbind(){
+		jsonString = "{\"userid\":\"demo\",\"varbindDictionaryData\":{\"description\":\"test\",\"varbindName\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveVarbind(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("varbindDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testUpdateVarbind(){
+		jsonString = "{\"userid\":\"demo\",\"varbindDictionaryData\":{\"id\":1,\"description\":\"test\",\"varbindName\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveVarbind(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("varbindDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testRemoveVarbind(){
+		jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"varbindName\":\"Test\"}}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.removeVarbind(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("varbindDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+}
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DescriptiveDictionaryControllerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DescriptiveDictionaryControllerTest.java
new file mode 100644
index 0000000..1854105
--- /dev/null
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DescriptiveDictionaryControllerTest.java
@@ -0,0 +1,163 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP-PAP-REST
+ * ================================================================================
+ * Copyright (C) 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.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+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.when;
+
+import java.io.BufferedReader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.junit.Before;
+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.rest.dao.CommonClassDao;
+import org.onap.policy.rest.jpa.DescriptiveScope;
+import org.onap.policy.rest.jpa.UserInfo;
+import org.springframework.mock.web.MockHttpServletResponse;
+
+public class DescriptiveDictionaryControllerTest {
+	
+	private static Logger logger = FlexLogger.getLogger(DescriptiveDictionaryControllerTest.class);
+	private static CommonClassDao commonClassDao;
+	private String jsonString = null;
+	private HttpServletRequest request = null;
+	private DescriptiveDictionaryController controller = null;
+	private MockHttpServletResponse response = null;
+	private UserInfo userInfo;
+	private List<String>  data;
+
+	@Before
+	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 DescriptiveScope());
+		doNothing().when(commonClassDao).save(new DescriptiveScope());
+		
+		controller = new DescriptiveDictionaryController();
+		controller.setCommonClassDao(commonClassDao);
+		
+		request = Mockito.mock(HttpServletRequest.class);
+		response =  new MockHttpServletResponse();  
+		logger.info("setUp: exit");
+	}
+	
+	public List<Object> testDescriptiveScope(){
+		List<Object>  objectData = new ArrayList<>();
+		
+		DescriptiveScope data = new DescriptiveScope();
+		data.setId(1);
+		assertTrue(1 == data.getId());
+		data.setScopeName("Test");
+		assertTrue("Test".equals(data.getScopeName()));
+		data.setDescription("Test");
+		assertTrue("Test".equals(data.getDescription()));
+		data.setSearch("Test");
+		assertTrue("Test".equals(data.getSearch()));
+		data.setCreatedDate(new Date());
+		assertTrue(data.getCreatedDate()!= null);
+		data.setModifiedDate(new Date());
+		assertTrue(data.getModifiedDate()!= null);
+		data.setUserCreatedBy(userInfo);
+		assertTrue(data.getUserCreatedBy()!= null);
+		data.setUserModifiedBy(userInfo);
+		assertTrue(data.getUserModifiedBy()!= null);
+		objectData.add(data);
+		
+		return objectData;
+	}
+	
+	@Test
+	public void testGetDescriptiveDictionaryByNameEntityData(){
+		when(commonClassDao.getDataByColumn(DescriptiveScope.class, "descriptiveScopeName")).thenReturn(data);
+		controller.getDescriptiveDictionaryByNameEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("descriptiveScopeDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testGetDescriptiveDictionaryEntityData(){
+		when(commonClassDao.getData(DescriptiveScope.class)).thenReturn(testDescriptiveScope());
+		controller.getDescriptiveDictionaryEntityData(response);
+		try {
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("descriptiveScopeDictionaryDatas"));
+		} catch (Exception e) {
+			fail();
+			logger.error(e.getMessage(),e);
+		}
+	}
+	
+	@Test
+	public void testSaveDescriptiveDictionary(){
+		jsonString = "{\"descriptiveScopeDictionaryData\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"descriptiveScopeName\":\"Test\",\"search\":\"Test\"},\"userid\":\"demo\"}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveDescriptiveDictionary(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("descriptiveScopeDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testUpdateDescriptiveDictionary(){
+		jsonString = "{\"descriptiveScopeDictionaryData\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"descriptiveScopeName\":\"Test\",\"id\":1,\"search\":\"Test\"},\"userid\":\"demo\"}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.saveDescriptiveDictionary(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("descriptiveScopeDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+	
+	@Test
+	public void testRemoveDescriptiveDictionary(){
+		jsonString = "{\"data\":{\"attributes\":[{\"$$hashKey\":\"object:257\",\"id\":\"choice1\",\"number\":\"12\",\"option\":\"test\"}],\"description\":\"test\",\"descriptiveScopeName\":\"Test\",\"id\":1,\"search\":\"Test\"},\"userid\":\"demo\"}";
+		try(BufferedReader br = new BufferedReader(new StringReader(jsonString))){
+			when(request.getReader()).thenReturn(br);
+			controller.removeDescriptiveDictionary(request, response);
+			assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("descriptiveScopeDictionaryDatas"));
+		}catch(Exception e){
+			logger.error("Exception"+ e);
+		} 
+	}
+}
\ No newline at end of file
diff --git a/ONAP-PDP/pom.xml b/ONAP-PDP/pom.xml
index 456217a..d302c95 100644
--- a/ONAP-PDP/pom.xml
+++ b/ONAP-PDP/pom.xml
@@ -72,7 +72,7 @@
 		<dependency>
 			<groupId>com.att.research.xacml</groupId>
 			<artifactId>xacml-pdp</artifactId>
-			<version>1.0.0</version>
+			<version>1.0.1</version>
 		</dependency>
 		<dependency>
 			<groupId>junit</groupId>
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ClosedLoopPolicy.java b/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ClosedLoopPolicy.java
deleted file mode 100644
index ea1cfb5..0000000
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ClosedLoopPolicy.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP Policy Engine
- * ================================================================================
- * Copyright (C) 2017 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.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.rest.adapter;
-
-
-public class ClosedLoopPolicy {
-	public static final String CLFAULT_UIFIELD_D2_SERVICES_TRINITY = "Hosted Voice (Trinity)";
-	public static final String CLFAULT_UIJSON_D2_SERVICES_TRINITY = "trinity";
-
-	public static final String CLFAULT_UIFIELD_D2_SERVICES_VUSP = "vUSP";
-	public static final String CLFAULT_UIJSON_D2_SERVICES_VUSP = "vUSP";
-
-	public static final String CLFAULT_UIFIELD_D2_SERVICES_MCR = "MCR";
-	public static final String CLFAULT_UIJSON_D2_SERVICES_MCR = "mcr";
-
-	public static final String CLFAULT_UIFIELD_D2_SERVICES_GAMMA = "Gamma";
-	public static final String CLFAULT_UIJSON_D2_SERVICES_GAMMA = "gama";
-
-	public static final String CLFAULT_UIFIELD_D2_SERVICES_VDNS = "vDNS";
-	public static final String CLFAULT_UIJSON_D2_SERVICES_VDNS = "vDNS";
-
-	public static final String CLFAULT_UIFIELD_EMAIL_ADDRESS = "Email Address";
-	public static final String CLFAULT_UIJSON_EMAIL_ADDRESS = "emailAddress";
-
-	public static final String CLFAULT_UIFIELD_TRIGGER_SIGNATURE = "Trigger Signature";
-	public static final String CLFAULT_UIJSON_TRIGGER_SIGNATURE = "triggerSignaturesUsedForUI.signatures";
-
-	public static final String CLFAULT_UIFIELD_VERIFICATION_SIGNATURE = "Verification Signature";
-	public static final String CLFAULT_UIJSON_VERIFICATION_SIGNATURE = "verificationSignaturesUsedForUI.signatures";
-
-	public static final String CLFAULT_UIFIELD_CONNECT_ALL_TRAPS = "Connect All Traps";
-	public static final String CLFAULT_UIJSON_CONNECT_ALL_TRAPS = "triggerSignaturesUsedForUI.connectSignatures";
-
-	public static final String CLFAULT_UIFIELD_CONNECT_ALL_FAULTS = "Connect All Faults";
-	public static final String CLFAULT_UIJSON_CONNECT_ALL_FAULTS = "verificationSignaturesUsedForUI.connectSignatures";
-
-	public static final String CLFAULT_UIFIELD_POLICY_STATUS_ACTIVE = "Active";
-	public static final String CLFAULT_UIJSON_POLICY_STATUS_ACTIVE = "ACTIVE";
-
-	public static final String CLFAULT_UIFIELD_POLICY_STATUS_INACTIVE = "InActive";
-	public static final String CLFAULT_UIJSON_POLICY_STATUS_INACTIVE = "INACTIVE";
-
-	private ClosedLoopPolicy(){
-		// Empty constructor
-	}
-}
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PolicyRestAdapter.java b/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PolicyRestAdapter.java
index dfc6dff..a9daf17 100644
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PolicyRestAdapter.java
+++ b/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PolicyRestAdapter.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.
@@ -20,7 +20,6 @@
 
 package org.onap.policy.rest.adapter;
 
-import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/EnforcingType.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/EnforcingType.java
deleted file mode 100644
index 9c1cda4..0000000
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/EnforcingType.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP-REST
- * ================================================================================
- * Copyright (C) 2017 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.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.rest.jpa;
-
-import java.io.Serializable;
-
-import javax.persistence.*;
-
-/**
- * Entity implementation class for Entity: EnforcingType
- *
- */
-@Entity
-@Table(name="EnforcingType")
-@NamedQuery(name="EnforcingType.findAll", query="SELECT e FROM EnforcingType e ")
-public class EnforcingType implements Serializable {
-
-	
-	private static final long serialVersionUID = 1L;
-	@Id
-	@GeneratedValue(strategy = GenerationType.AUTO)
-	@Column(name="id")
-	private int id;
-	@Column(name="enforcingType", nullable=false, unique=true)
-	@OrderBy("asc")
-	private String enforcingType;
-	@Column(name="script", nullable=false, length=255)
-	private String script;
-	@Column(name="connectionQuery", nullable=false, length=255)
-	private String connectionQuery;
-	@Column(name="valueQuery", nullable=false, length=255)
-	private String valueQuery;
-		
-	public int getId() {
-		return id;
-	}
-
-	public void setId(int id) {
-		this.id = id;
-	}
-
-	public String getEnforcingType() {
-		return enforcingType;
-	}
-
-	public void setEnforcingType(String enforcingType) {
-		this.enforcingType = enforcingType;
-	}
-
-	public String getScript() {
-		return script;
-	}
-
-	public void setScript(String script) {
-		this.script = script;
-	}
-
-	public String getConnectionQuery() {
-		return connectionQuery;
-	}
-
-	public void setConnectionQuery(String connectionQuery) {
-		this.connectionQuery = connectionQuery;
-	}
-
-	public String getValueQuery() {
-		return valueQuery;
-	}
-
-	public void setValueQuery(String valueQuery) {
-		this.valueQuery = valueQuery;
-	}
-
-	public EnforcingType() {
-		super();
-	}
-   
-}
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyManagement.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyManagement.java
deleted file mode 100644
index c79ee1e..0000000
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyManagement.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP-REST
- * ================================================================================
- * Copyright (C) 2017 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.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.rest.jpa;
-
-import java.io.Serializable;
-import java.sql.Clob;
-import java.sql.Timestamp;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.NamedQuery;
-import javax.persistence.Table;
-
-
-/**
- * The persistent class for the roles database table.
- * 
- */
-@Entity
-@Table(name="policy_manangement")
-@NamedQuery(name="PolicyManagement.findAll", query="SELECT r FROM PolicyManagement r")
-public class PolicyManagement implements Serializable {
-	private static final long serialVersionUID = 1L;
-
-	@Id
-	@GeneratedValue(strategy = GenerationType.AUTO)
-	
-	@Column(name="id")
-	private int id;
-
-	@Column(name="POLICY_NAME", nullable=false, length=45)
-	private String policyName;	
-	
-	@Column(name="scope", nullable=false, length=45)
-	private String scope;
-
-	@Column(name="ONAP_NAME", nullable=false, length=45)
-	private String onapName;
-	
-	@Column(name="CONFIG_NAME", nullable=false, length=45)
-	private String configName;
-	
-	@Column(name="XML", nullable=false)
-	private transient Clob xml;
-	
-	@Column(name="CREATE_DATE_TIME", nullable=false)
-	private Timestamp createDateTime;
-	
-	
-	@Column(name="CREATED_BY", nullable=false, length=45)
-	private String createdBy;
-	
-	@Column(name="UPDATE_DATE_TIME", nullable=false)
-	private Timestamp updateDateTime;
-	
-	@Column(name="UPDATED_BY", nullable=false, length=45)
-	private String updatedBy;
-
-	public int getId() {
-		return id;
-	}
-
-	public void setId(int id) {
-		this.id = id;
-	}
-
-	public String getPolicyName() {
-		return policyName;
-	}
-
-	public void setPolicyName(String policyName) {
-		this.policyName = policyName;
-	}
-
-	public String getScope() {
-		return scope;
-	}
-
-	public void setScope(String scope) {
-		this.scope = scope;
-	}
-
-	public String getOnapName() {
-		return onapName;
-	}
-
-	public void setOnapName(String onapName) {
-		this.onapName = onapName;
-	}
-
-	public String getConfigName() {
-		return configName;
-	}
-
-	public void setConfigName(String configName) {
-		this.configName = configName;
-	}
-
-	public Clob getXml() {
-		return xml;
-	}
-
-	public void setXml(Clob xml) {
-		this.xml = xml;
-	}
-
-	public Timestamp getCreateDateTime() {
-		return createDateTime;
-	}
-
-	public void setCreateDateTime(Timestamp createDateTime) {
-		this.createDateTime = createDateTime;
-	}
-
-	public String getCreatedBy() {
-		return createdBy;
-	}
-
-	public void setCreatedBy(String createdBy) {
-		this.createdBy = createdBy;
-	}
-
-	public Timestamp getUpdateDateTime() {
-		return updateDateTime;
-	}
-
-	public void setUpdateDateTime(Timestamp updateDateTime) {
-		this.updateDateTime = updateDateTime;
-	}
-
-	public String getUpdatedBy() {
-		return updatedBy;
-	}
-
-	public void setUpdatedBy(String updatedBy) {
-		this.updatedBy = updatedBy;
-	}
-	
-	
-
-}
diff --git a/ONAP-XACML/pom.xml b/ONAP-XACML/pom.xml
index 271b7f4..c399e3f 100644
--- a/ONAP-XACML/pom.xml
+++ b/ONAP-XACML/pom.xml
@@ -82,7 +82,7 @@
 		<dependency>
 			<groupId>com.att.research.xacml</groupId>
 			<artifactId>xacml</artifactId>
-			<version>1.0.0</version>
+			<version>1.0.1</version>
 		</dependency>
 	</dependencies>
 </project>
