diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java b/vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java
index 2f8d6e2..579f17a 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java
@@ -4,12 +4,14 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright 2019 Nokia
+ * ================================================================================
  * 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.
@@ -22,12 +24,11 @@
 
 import org.onap.portalsdk.core.controller.RestrictedBaseController;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.onap.portalsdk.core.util.SystemProperties;
 import org.onap.vid.category.CategoryParametersResponse;
 import org.onap.vid.model.CategoryParameter.Family;
 import org.onap.vid.services.CategoryParameterService;
+import org.onap.vid.utils.SystemPropertiesWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
@@ -35,92 +36,59 @@
 import javax.servlet.http.HttpServletRequest;
 
 import static org.onap.vid.utils.Logging.getMethodName;
+import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
+import static org.springframework.http.HttpStatus.OK;
 
-/**
- * The Class PropertyController.
- */
 @RestController
-public class PropertyController extends RestrictedBaseController{
-	
+public class PropertyController extends RestrictedBaseController {
 
-	/** The logger. */
-	private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(PropertyController.class);
+    private static final String ERROR_MESSAGE = "Internal error occurred: ";
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(PropertyController.class);
+    private final CategoryParameterService categoryParameterService;
+    private final SystemPropertiesWrapper systemPropertiesWrapper;
 
-	@Autowired
-	protected CategoryParameterService categoryParameterService;
+    @Autowired
+    public PropertyController(CategoryParameterService service, SystemPropertiesWrapper systemPropertiesWrapper) {
+        categoryParameterService = service;
+        this.systemPropertiesWrapper = systemPropertiesWrapper;
+    }
 
-	
-	/**
-	 * Welcome.
-	 *
-	 * @param request the request
-	 * @return the model and view
-	 */
-	@RequestMapping(value = {"/propertyhome" }, method = RequestMethod.GET)
-	public ModelAndView welcome(HttpServletRequest request) {
-		LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== PropertyController welcome start");
-		return new ModelAndView(getViewName());		
-	}
-	
-	/**
-	 * Gets the property.
-	 *
-	 * @param name the name
-	 * @param defaultvalue the defaultvalue
-	 * @param request the request
-	 * @return the property
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/get_property/{name}/{defaultvalue}", method = RequestMethod.GET)
-	public ResponseEntity<String> getProperty (@PathVariable("name") String name, @PathVariable("defaultvalue") String defaultvalue,
-			HttpServletRequest request) {
-		
-		String methodName = "getProperty";	
-		ResponseEntity<String> resp = null;
-		String pvalue = null;
-		LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + " start");
-		
-		try {
-			// convert "_" to "." in the property name
-			if (name == null || name.length() == 0 ) {
-				return ( new ResponseEntity<String> (defaultvalue, HttpStatus.OK));
-			}
-			// convert "_" to "." in the property name
-			String propertyName = name.replace('_', '.');
-			pvalue = SystemProperties.getProperty(propertyName);
-			if ( ( pvalue == null ) || ( pvalue.length() == 0 ) ) {
-				pvalue = defaultvalue;
-			}
-			resp = new ResponseEntity<>(pvalue, HttpStatus.OK);
-		}
-		catch (Exception e) {
-			LOGGER.info(EELFLoggerDelegate.errorLogger,  "<== " + "." + methodName + e.toString());
-			LOGGER.debug(EELFLoggerDelegate.debugLogger,  "<== " + "." + methodName + e.toString());
-			throw e;
-		}
-		LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + " returning " + pvalue);
-  		return ( resp );
-	}
+    @RequestMapping(value = {"/propertyhome"}, method = RequestMethod.GET)
+    public ModelAndView welcome(HttpServletRequest request) {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== PropertyController welcome start");
+        return new ModelAndView(getViewName());
+    }
 
-	/**
-	 * Gets the owning entity properties.
-	 * @param request the request
-	 * @return the property
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/category_parameter", method = RequestMethod.GET)
-	public ResponseEntity getCategoryParameter(HttpServletRequest request, @RequestParam(value="familyName", required = true) Family familyName) {
-		LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
-		try {
-			CategoryParametersResponse response = categoryParameterService.getCategoryParameters(familyName);
-			LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
-			return new ResponseEntity<>(response, HttpStatus.OK);
-		}
-		catch (Exception exception) {
-			LOGGER.error("failed to retrieve category parameter list from DB.", exception);
-			return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
-		}
-	}
+    @RequestMapping(value = "/get_property/{name}/{defaultvalue}", method = RequestMethod.GET)
+    public ResponseEntity<String> getProperty(@PathVariable("name") String name,
+        @PathVariable("defaultvalue") String defaultvalue,
+        HttpServletRequest request) {
 
+        String methodName = "getProperty";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== {} {}", methodName, " start");
+        try {
+            String propertyName = name.replace('_', '.');
+            String pvalue = systemPropertiesWrapper.getOrDefault(propertyName, defaultvalue);
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== {} {} {}", methodName, "returning", pvalue);
+            return ResponseEntity.status(OK).body(pvalue);
+        } catch (Exception e) {
+            LOGGER.info(EELFLoggerDelegate.errorLogger, "<== {} {}", methodName, e.toString());
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== {} {}", methodName, e.toString());
+            return ResponseEntity.status(INTERNAL_SERVER_ERROR).body(ERROR_MESSAGE + e.getMessage());
+        }
+    }
 
+    @RequestMapping(value = "/category_parameter", method = RequestMethod.GET)
+    public ResponseEntity getCategoryParameter(HttpServletRequest request,
+        @RequestParam(value = "familyName", required = true) Family familyName) {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+        try {
+            CategoryParametersResponse response = categoryParameterService.getCategoryParameters(familyName);
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+            return ResponseEntity.status(OK).body(response);
+        } catch (Exception e) {
+            LOGGER.error("failed to retrieve category parameter list from DB.", e);
+            return ResponseEntity.status(INTERNAL_SERVER_ERROR).body(ERROR_MESSAGE + e.getMessage());
+        }
+    }
 }
diff --git a/vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java b/vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java
new file mode 100644
index 0000000..d24be4d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright 2019 Nokia
+ * ================================================================================
+ * 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.vid.utils;
+
+import org.apache.commons.lang.StringUtils;
+
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SystemPropertiesWrapper {
+    public String getProperty(String key) {
+        return SystemProperties.getProperty(key);
+    }
+    public String getOrDefault(String key, String defaultValue) {
+        return StringUtils.defaultIfEmpty(getProperty(key), defaultValue);
+    }
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/PropertyControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/PropertyControllerTest.java
index e9d2cfd..5dbe010 100644
--- a/vid-app-common/src/test/java/org/onap/vid/controller/PropertyControllerTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/PropertyControllerTest.java
@@ -1,39 +1,139 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright 2019 Nokia
+ * ================================================================================
+ * 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.vid.controller;
 
+import static org.mockito.BDDMockito.given;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.log4j.BasicConfigurator;
+import org.junit.Before;
 import org.junit.Test;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.servlet.ModelAndView;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.vid.category.CategoryParameterOptionRep;
+import org.onap.vid.category.CategoryParametersResponse;
+import org.onap.vid.model.CategoryParameter.Family;
+import org.onap.vid.services.CategoryParameterService;
+import org.onap.vid.utils.SystemPropertiesWrapper;
+import org.springframework.http.MediaType;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.setup.MockMvcBuilders;
 
-import javax.servlet.http.HttpServletRequest;
-
+@RunWith(MockitoJUnitRunner.class)
 public class PropertyControllerTest {
 
-	private PropertyController createTestSubject() {
-		return new PropertyController();
-	}
+    private static final String GET_PROPERTY = "/get_property/{name}/{defaultvalue}";
+    private static final String CATEGORY_PARAMETER = "/category_parameter";
 
-	@Test
-	public void testWelcome() throws Exception {
-		PropertyController testSubject;
-		HttpServletRequest request = null;
-		ModelAndView result;
+    private static final String ERROR_MSG = "Internal error occurred: ";
+    private static final String FAMILY_NAME = "familyName";
 
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.welcome(request);
-	}
+    private PropertyController propertyController;
+    private MockMvc mockMvc;
+    private ObjectMapper objectMapper;
 
+    @Mock
+    private CategoryParameterService service;
+    @Mock
+    private SystemPropertiesWrapper systemPropertiesWrapper;
 
-	@Test
-	public void testGetProperty() throws Exception {
-		PropertyController testSubject;
-		String name = "";
-		String defaultvalue = "";
-		HttpServletRequest request = null;
-		ResponseEntity<String> result;
+    @Before
+    public void setUp() {
+        propertyController = new PropertyController(service, systemPropertiesWrapper);
+        BasicConfigurator.configure();
+        mockMvc = MockMvcBuilders.standaloneSetup(propertyController).build();
+        objectMapper = new ObjectMapper();
+    }
 
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getProperty(name, defaultvalue, request);
-	}
+    @Test
+    public void shouldReturnInputJson_whenPropertyIsNotFound() throws Exception {
+        String inputJson = "{key1: val1}";
+        given(systemPropertiesWrapper.getOrDefault("name.1", inputJson)).willReturn(inputJson);
+
+        mockMvc.perform(get(GET_PROPERTY, "name_1", inputJson)
+            .contentType(MediaType.APPLICATION_JSON))
+            .andExpect(status().isOk())
+            .andExpect(content().json(inputJson));
+    }
+
+    @Test
+    public void shouldReturnGivenJson_whenPropertyIsFound() throws Exception {
+        String propertyJson = "{key1: val1}";
+        String inputJson = "{key2: val2}";
+        given(systemPropertiesWrapper.getOrDefault("name.1", inputJson)).willReturn(propertyJson);
+
+        mockMvc.perform(get(GET_PROPERTY, "name_1", inputJson)
+            .contentType(MediaType.APPLICATION_JSON))
+            .andExpect(status().isOk())
+            .andExpect(content().json(propertyJson));
+    }
+
+    @Test
+    public void shouldReturnInternalServerError_whenExceptionIsThrownFromSystemProperties() throws Exception {
+        String exceptionMessage = "Test exception message from system properties";
+        String inputJson = "{key1: val1}";
+        given(systemPropertiesWrapper.getOrDefault("name.1", inputJson)).willThrow(new RuntimeException(exceptionMessage));
+
+        mockMvc.perform(get(GET_PROPERTY, "name_1", inputJson)
+            .contentType(MediaType.APPLICATION_JSON))
+            .andExpect(status().isInternalServerError())
+            .andExpect(content().string(ERROR_MSG + exceptionMessage));
+    }
+
+    @Test
+    public void shouldReturnResponse_whenResponseIsFound() throws Exception {
+
+        CategoryParametersResponse categoryParametersResponse =
+            new CategoryParametersResponse(
+                ImmutableMap.of(
+                    "key1", ImmutableList.of(
+                        new CategoryParameterOptionRep("testId", "testName"))));
+
+        given(service.getCategoryParameters(Family.PARAMETER_STANDARDIZATION)).willReturn(categoryParametersResponse);
+
+        mockMvc.perform(get(CATEGORY_PARAMETER)
+            .param(FAMILY_NAME, "PARAMETER_STANDARDIZATION")
+            .contentType(MediaType.APPLICATION_JSON))
+            .andExpect(status().isOk())
+            .andExpect(content().json(objectMapper.writeValueAsString(categoryParametersResponse)));
+    }
+
+    @Test
+    public void shouldReturnInternalServerError_whenExceptionIsThrownFromService() throws Exception {
+        String exceptionMessage = "Test exception message from category parameter service";
+        given(service.getCategoryParameters(Family.PARAMETER_STANDARDIZATION)).willThrow(new RuntimeException(
+            exceptionMessage));
+
+        mockMvc.perform(get(CATEGORY_PARAMETER)
+            .param(FAMILY_NAME, "PARAMETER_STANDARDIZATION")
+            .contentType(MediaType.APPLICATION_JSON))
+            .andExpect(status().isInternalServerError())
+            .andExpect(content().string(ERROR_MSG + exceptionMessage));
+    }
 }
\ No newline at end of file
