aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/main/java
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-18 10:08:08 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-18 10:08:08 +0000
commit89bf0b4f499c7fada8ad221defff5580d12331b6 (patch)
tree967e04c4fac616dbca84d3ed451df82b75d8077d /mso-catalog-db/src/main/java
parentbde8e855fa7177a8b230008b936f5457c5e5d94a (diff)
Improve UT for catalog DB
Impprove UT for catalog DB. Change-Id: I78a0525cd7775f4371efc5ccbc549ea410384491 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.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 af4d28d3ba..0804d3c162 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
@@ -807,22 +807,22 @@ public class CatalogDatabase implements Closeable {
* @param modelCustomizationId
* @return VnfResource object or null if none found
*/
- public VnfResource getVnfResourceByModelCustomizationId (String modelCustomizationId) {
+ public VnfResource getVnfResourceByModelCustomizationId(String modelCustomizationId) {
- long startTime = System.currentTimeMillis ();
- LOGGER.debug ("Catalog database - get VNF resource with modelCustomizationId " + modelCustomizationId);
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database - get VNF resource with modelCustomizationId " + modelCustomizationId);
String hql = "SELECT vr "
+ "FROM VnfResource as vr JOIN vr.vnfResourceCustomizations as vrc "
+ "WHERE vrc.modelCustomizationUuid = :modelCustomizationId";
- Query query = getSession ().createQuery (hql);
- query.setParameter ("modelCustomizationId", modelCustomizationId);
+ Query query = getSession().createQuery(hql);
+ query.setParameter("modelCustomizationId", modelCustomizationId);
VnfResource resource = null;
try {
- resource = (VnfResource) query.uniqueResult ();
- } catch (org.hibernate.NonUniqueResultException nure) {
+ 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: modelCustomizationUuid='" + modelCustomizationId + "'");
LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelCustomizationUuid=" + modelCustomizationId, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelCustomizationId=" + modelCustomizationId);
@@ -839,9 +839,9 @@ public class CatalogDatabase implements Closeable {
throw e;
}
if (resource == null) {
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResourceByModelCustomizationId", null);
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResourceByModelCustomizationId", null);
} else {
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceByModelCustomizationId", null);
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceByModelCustomizationId", null);
}
return resource;
}