aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/main
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-17 11:43:47 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-01-17 11:43:47 +0000
commit5621e24fe7336f978666e1a5bdae0adf75f4d144 (patch)
tree2aabd2866cb1aeccdc217669e9d65a7ae57165f0 /mso-catalog-db/src/main
parentab3dd55d09241672cdfaf34652b01a593d630fc2 (diff)
Improve UT for catalog db
Impove UT for catalog db. Change-Id: Iacbcb9de5ec92f929bfce8cfaac298e4a9ccf8b9 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.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 ed30e61640..d1e91f39b7 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
@@ -651,30 +651,30 @@ public class CatalogDatabase implements Closeable {
return resultList.get(0);
}
- public List<ServiceRecipe> getServiceRecipes (String serviceModelUuid) {
+ public List<ServiceRecipe> getServiceRecipes(String serviceModelUuid) {
StringBuilder hql;
- hql = new StringBuilder ("FROM ServiceRecipe WHERE serviceModelUUID = :serviceModelUUID");
+ hql = new StringBuilder("FROM ServiceRecipe WHERE serviceModelUUID = :serviceModelUUID");
- long startTime = System.currentTimeMillis ();
- LOGGER.debug ("Catalog database - get Service recipe with serviceModelUUID " + serviceModelUuid);
+ long startTime = System.currentTimeMillis();
+ LOGGER.debug("Catalog database - get Service recipe with serviceModelUUID " + serviceModelUuid);
- Query query = getSession ().createQuery (hql.toString ());
- query.setParameter ("serviceModelUUID", serviceModelUuid);
+ Query query = getSession().createQuery(hql.toString());
+ query.setParameter("serviceModelUUID", serviceModelUuid);
@SuppressWarnings("unchecked")
- List <ServiceRecipe> resultList = query.list ();
+ List <ServiceRecipe> resultList = query.list();
- if (resultList.isEmpty ()) {
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service recipe not found", "CatalogDB", "getServiceRecipes", null);
+ if (resultList.isEmpty()) {
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service recipe not found", "CatalogDB", "getServiceRecipes", null);
return Collections.EMPTY_LIST;
}
- 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", "getServiceRecipes", null);
+ LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipes", null);
return resultList;
}