aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/main/java
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-17 12:03:49 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-17 12:03:49 +0000
commitbde8e855fa7177a8b230008b936f5457c5e5d94a (patch)
treefc86cac95d27d8de2012f63b2e47e4f701a6ee3d /mso-catalog-db/src/main/java
parent487482d147a46e237b6f4f8c1ae07762e3f49b05 (diff)
Improve UT for catalog db
Improve UT for catalog db. Change-Id: If3c86e76b36c69bd99c1f6536fb3f2d787e6ed0d Issue-ID: SO-360 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'mso-catalog-db/src/main/java')
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java14
1 files changed, 7 insertions, 7 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 079d105dd4..af4d28d3ba 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
@@ -759,22 +759,22 @@ public class CatalogDatabase implements Closeable {
* Return the newest version of a specific VNF resource (queried by Name).
*
* @param vnfType
- * @param version
+ * @param serviceVersion
* @return VnfResource object or null if none found
*/
public VnfResource getVnfResource (String vnfType, String serviceVersion) {
- long startTime = System.currentTimeMillis ();
- LOGGER.debug ("Catalog database - get VNF resource with model_name " + vnfType + " and version=" + serviceVersion);
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database - get VNF resource with model_name " + vnfType + " and version=" + serviceVersion);
String hql = "FROM VnfResource WHERE modelName = :vnfName and version = :serviceVersion";
- Query query = getSession ().createQuery (hql);
- query.setParameter ("vnfName", vnfType);
- query.setParameter ("serviceVersion", serviceVersion);
+ Query query = getSession().createQuery(hql);
+ query.setParameter("vnfName", vnfType);
+ query.setParameter("serviceVersion", serviceVersion);
VnfResource resource = null;
try {
- resource = (VnfResource) query.uniqueResult ();
+ resource = (VnfResource) 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: vnfType='" + vnfType + "', serviceVersion='" + serviceVersion + "'");
LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for vnfType=" + vnfType + " and serviceVersion=" + serviceVersion, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for vnfType=" + vnfType);