aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/main
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-19 09:05:02 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-19 09:05:02 +0000
commit0bff9b79e7481f039db4b75734f9b6a363c4a612 (patch)
tree5d1f7b59e92efbe7ccf2283676d44c8c2f374830 /mso-catalog-db/src/main
parentc42e71947301a615bbd4492aa70303bf3ac7414c (diff)
Improve UT for catalog db
Improve UT for catalog db Change-Id: Ib9c5dad03c0107778c554c54d1586e0ddd79c297 Issue-ID: SO-360 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'mso-catalog-db/src/main')
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
index 0efcb484cb..0048a34d6c 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
@@ -982,19 +982,19 @@ public class CatalogDatabase implements Closeable {
return resultList.get(0);
}
- public VfModule getVfModuleModelName (String modelName, String model_version) {
+ public VfModule getVfModuleModelName(String modelName, String model_version) {
- long startTime = System.currentTimeMillis ();
- LOGGER.debug ("Catalog database - get vfModuleModelName with type='" + modelName + "' and asdc_service_model_version='" + model_version + "'");
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database - get vfModuleModelName with type='" + modelName + "' and asdc_service_model_version='" + model_version + "'");
String hql = "FROM VfModule WHERE Name = :model_name and version = :model_version";
- Query query = getSession ().createQuery (hql);
- query.setParameter ("modelName", modelName);
- query.setParameter ("model_version", model_version);
+ Query query = getSession().createQuery(hql);
+ query.setParameter("modelName", modelName);
+ query.setParameter("model_version", model_version);
VfModule module = null;
try {
- module = (VfModule) query.uniqueResult ();
+ module = (VfModule) query.uniqueResult();
} catch (org.hibernate.NonUniqueResultException nure) {
LOGGER.debug("Non Unique Result Exception - the Catalog Database does not match a unique row - data integrity error: type='" + modelName + "', asdc_service_model_version='" + model_version + "'");
LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for type=" + modelName + " and version=" + model_version, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for type=" + modelName);
@@ -1012,9 +1012,9 @@ public class CatalogDatabase implements Closeable {
throw e;
}
if (module == null) {
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleModelName", null);
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVfModuleModelName", null);
} else {
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleModelName", null);
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleModelName", null);
}
return module;
}