summaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/main/java
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-19 06:48:20 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-19 06:48:20 +0000
commitc42e71947301a615bbd4492aa70303bf3ac7414c (patch)
tree031700a6d48ec974b78f31f3347da196e8110d57 /mso-catalog-db/src/main/java
parent1b9f60bf292b24a33df33cedacad83bb868b450c (diff)
Improve UT for catalog db
Improve UT for catalog db. Change-Id: I80eb6d4f58ea9de2d73a92a917dad8f9c98dc88a 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.java24
1 files changed, 12 insertions, 12 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 0219e304cb..0efcb484cb 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
@@ -958,28 +958,28 @@ public class CatalogDatabase implements Closeable {
* Return the newest version of a vfModule - 1607
*
*/
- public VfModule getVfModuleModelName (String modelName) {
+ public VfModule getVfModuleModelName(String modelName) {
- long startTime = System.currentTimeMillis ();
- LOGGER.debug ("Catalog database - get vfModuleModelName with name " + modelName);
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database - get vfModuleModelName with name " + modelName);
String hql = "FROM VfModule WHERE modelName = :model_name";
- Query query = getSession ().createQuery (hql);
- query.setParameter ("model_name", modelName);
+ Query query = getSession().createQuery(hql);
+ query.setParameter("model_name", modelName);
@SuppressWarnings("unchecked")
- List <VfModule> resultList = query.list ();
+ List<VfModule> 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. VF not found", "CatalogDB", "getVfModuleModelName", null);
+ if (resultList.isEmpty()) {
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VF not found", "CatalogDB", "getVfModuleModelName", 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", "getVfModuleModelName", null);
- return resultList.get (0);
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleModelName", null);
+ return resultList.get(0);
}
public VfModule getVfModuleModelName (String modelName, String model_version) {