From 5196c90db81f24343a3ed9e685592b6210722573 Mon Sep 17 00:00:00 2001 From: kurczews Date: Tue, 30 Jan 2018 14:39:46 +0100 Subject: Add coverage for ConfigResourceNode-4 Change-Id: I14f4afe16cb8b475f39927c1ee8d79594a01d5bc Issue-ID: APPC-441 Signed-off-by: kurczews --- .../onap/appc/data/services/node/ConfigResourceNode.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'appc-config/appc-data-services/provider/src/main/java') 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 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"); -- cgit 1.2.3-korg