aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java
diff options
context:
space:
mode:
authorJoanna Jeremicz <joanna.jeremicz@nokia.com>2019-01-18 11:17:46 +0100
committerJoanna Jeremicz <joanna.jeremicz@nokia.com>2019-01-25 12:43:45 +0100
commit36d29e46fbc50439e5e7a62efa08505bb2d047f8 (patch)
tree0b5cbd326fec9b1901e5394576d177bd491ae7d1 /vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java
parentc0fe8e1a2c3c809aa11fa37b78da5fcb3759340a (diff)
Rewrite PropertyControllerTest
Change-Id: I8c564a945f374d6dcc12a30ff4d8d9268b50a815 Issue-ID: VID-384 Signed-off-by: Joanna Jeremicz <joanna.jeremicz@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java38
1 files changed, 38 insertions, 0 deletions
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 000000000..d24be4dcc
--- /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);
+ }
+}