aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/main/java/org
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-17 11:52:39 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-17 11:52:39 +0000
commit487482d147a46e237b6f4f8c1ae07762e3f49b05 (patch)
tree43738a1539033622407f57ef2108c712ea1eca30 /mso-catalog-db/src/main/java/org
parent5621e24fe7336f978666e1a5bdae0adf75f4d144 (diff)
UT improvement for catalog DB
Improve UT for catalog DB. Change-Id: I703e86d0bcde663b81cf46260a6f5656dae6dab3 Issue-ID: SO-360 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'mso-catalog-db/src/main/java/org')
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java22
1 files changed, 11 insertions, 11 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 d1e91f39b7..079d105dd4 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
@@ -733,26 +733,26 @@ public class CatalogDatabase implements Closeable {
*/
public VnfResource getVnfResource (String vnfType) {
- long startTime = System.currentTimeMillis ();
- LOGGER.debug ("Catalog database - get vnf resource with model_name " + vnfType);
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database - get vnf resource with model_name " + vnfType);
String hql = "FROM VnfResource WHERE modelName = :vnf_name";
- Query query = getSession ().createQuery (hql);
- query.setParameter ("vnf_name", vnfType);
+ Query query = getSession().createQuery(hql);
+ query.setParameter("vnf_name", vnfType);
@SuppressWarnings("unchecked")
- List <VnfResource> resultList = query.list ();
+ List <VnfResource> resultList = query.list();
// See if something came back. Name is unique, so
- if (resultList.isEmpty ()) {
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF not found", "CatalogDB", "getVnfResource", null);
+ if (resultList.isEmpty()) {
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF not found", "CatalogDB", "getVnfResource", null);
return null;
}
- Collections.sort (resultList, new MavenLikeVersioningComparator ());
- Collections.reverse (resultList);
+ Collections.sort(resultList, new MavenLikeVersioningComparator());
+ Collections.reverse(resultList);
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResource", null);
- return resultList.get (0);
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResource", null);
+ return resultList.get(0);
}
/**