diff options
author | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-01-15 06:10:19 +0000 |
---|---|---|
committer | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-01-15 06:20:44 +0000 |
commit | a7e7bb435f0bdb851dadcd8cdeacdf7b20d02147 (patch) | |
tree | 3f80f458b2b466526b0572117c5b4257cee3fe7f /mso-catalog-db/src/main/java | |
parent | 08993261c69c4f3c3d4628d0b094a7fded6f2bdf (diff) |
Add test case for getHeatTemplate
Add test case for getHeatTemplage.
Fix file ending character by removing ctrl+M character.
Change-Id: Ia25b54b80bdd7e1edb8a96b58b8f3fe9ce020dc7
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.java | 22 |
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 cdde98dd36..9445cccb12 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 @@ -219,29 +219,29 @@ public class CatalogDatabase implements Closeable { * @param version * @return HeatTemplate object or null if none found */ - public HeatTemplate getHeatTemplate (String templateName, String version) { + public HeatTemplate getHeatTemplate(String templateName, String version) { - long startTime = System.currentTimeMillis (); - LOGGER.debug ("Catalog database - get Heat template with name " + templateName + long startTime = System.currentTimeMillis(); + LOGGER.debug("Catalog database - get Heat template with name " + templateName + " and version " + version); String hql = "FROM HeatTemplate WHERE templateName = :template_name AND version = :version"; - Query query = getSession ().createQuery (hql); - query.setParameter ("template_name", templateName); - query.setParameter ("version", version); + Query query = getSession().createQuery(hql); + query.setParameter("template_name", templateName); + query.setParameter("version", version); @SuppressWarnings("unchecked") - List <HeatTemplate> resultList = query.list (); + List <HeatTemplate> resultList = query.list(); // See if something came back. - if (resultList.isEmpty ()) { - LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. No template found.", "CatalogDB", "getHeatTemplate", null); + if (resultList.isEmpty()) { + LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. No template found.", "CatalogDB", "getHeatTemplate", null); return null; } // Name + Version is unique, so should only be one element - LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatTemplate", null); - return resultList.get (0); + LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatTemplate", null); + return resultList.get(0); } /** |