summaryrefslogtreecommitdiffstats
path: root/appc-config/appc-data-services/provider/src/main/java/org
diff options
context:
space:
mode:
authorkurczews <krzysztof.kurczewski@nokia.com>2018-01-30 14:39:46 +0100
committerkurczews <krzysztof.kurczewski@nokia.com>2018-02-07 08:26:25 +0100
commit5196c90db81f24343a3ed9e685592b6210722573 (patch)
tree2abfc2521ac6d95fb05e09b0f4eaf68cbc8cddd6 /appc-config/appc-data-services/provider/src/main/java/org
parentb8db77008335b0a36586f2abf365148731dda69c (diff)
Add coverage for ConfigResourceNode-4
Change-Id: I14f4afe16cb8b475f39927c1ee8d79594a01d5bc Issue-ID: APPC-441 Signed-off-by: kurczews <krzysztof.kurczewski@nokia.com>
Diffstat (limited to 'appc-config/appc-data-services/provider/src/main/java/org')
-rw-r--r--appc-config/appc-data-services/provider/src/main/java/org/onap/appc/data/services/node/ConfigResourceNode.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/appc-config/appc-data-services/provider/src/main/java/org/onap/appc/data/services/node/ConfigResourceNode.java b/appc-config/appc-data-services/provider/src/main/java/org/onap/appc/data/services/node/ConfigResourceNode.java
index 40a8f5ecf..887f561cf 100644
--- a/appc-config/appc-data-services/provider/src/main/java/org/onap/appc/data/services/node/ConfigResourceNode.java
+++ b/appc-config/appc-data-services/provider/src/main/java/org/onap/appc/data/services/node/ConfigResourceNode.java
@@ -59,10 +59,13 @@ public class ConfigResourceNode implements SvcLogicJavaPlugin {
static final String CONFIG_FILES_PREFIX = "tmp.configFiles";
static final String MAX_CONF_FILE_PREFIX = "tmp.configfilesmax";
+ static final String UPLOAD_CONFIG_PREFIX = "tmp.uploadConfig";
+ static final String UPLOAD_CONFIG_INFO_PREFIX = "tmp.uploadConfigInfo";
static final String PREPARE_RELATIONSHIP_PARAM = "tmp.preparerel";
static final String CONFIG_FILE_ID_PARAM = "tmp.configfilesmax.configfileid";
static final String FILE_CATEGORY_PARAM = "file-category";
+ static final String UPLOAD_CONFIG_ID_PARAM = "tmp.uploadConfigInfo.UPLOAD-CONFIG-ID";
static final String SDC_IND = "N";
@@ -274,18 +277,18 @@ public class ConfigResourceNode implements SvcLogicJavaPlugin {
ctx.setAttribute("tmp.escaped.devicerunningconfig",
EscapeUtils.escapeSql(ctx.getAttribute("device-running-config")));
- QueryStatus status = db.saveUploadConfig(ctx, "tmp.uploadConfig");
+ QueryStatus status = db.saveUploadConfig(ctx, UPLOAD_CONFIG_PREFIX);
if (status == QueryStatus.FAILURE)
throw new Exception("Unable to Save configuration in upload_config");
- status = db.getUploadConfigInfo(ctx, "tmp.uploadConfigInfo");
+ status = db.getUploadConfigInfo(ctx, UPLOAD_CONFIG_INFO_PREFIX);
if (status == QueryStatus.NOT_FOUND || status == QueryStatus.FAILURE)
throw new Exception("Unable to get record from upload_config");
- status = db.updateUploadConfig(ctx, "tmp.uploadConfig",
- Integer.parseInt(ctx.getAttribute("tmp.uploadConfigInfo.UPLOAD-CONFIG-ID")));
+ status = db.updateUploadConfig(ctx, UPLOAD_CONFIG_PREFIX,
+ Integer.parseInt(ctx.getAttribute(UPLOAD_CONFIG_ID_PARAM)));
if (status == QueryStatus.FAILURE)
throw new Exception("Unable to upload upload_config");
@@ -482,7 +485,7 @@ public class ConfigResourceNode implements SvcLogicJavaPlugin {
}
public void saveDeviceConfiguration(Map<String, String> inParams, SvcLogicContext ctx, String dataSource,
- String fileContent, String deviceConfig) throws SvcLogicException {
+ String fileContent, String deviceConfig) throws SvcLogicException {
ctx.setAttribute("data-source", dataSource);
ctx.setAttribute("file-content", fileContent);
ctx.setAttribute(FILE_CATEGORY_PARAM, "device_configuration");