From 89f89afa5bf730f359e18c3672682a8fb0970e85 Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Wed, 17 Jan 2018 05:54:54 +0000 Subject: Improve unit test for catalog Improve unit test for catalog.java. Change-Id: I622fc6ae73de365b0942d3fec5867de7688057b6 Issue-ID: SO-360 Signed-off-by: subhash kumar singh --- .../java/org/openecomp/mso/db/catalog/CatalogDatabase.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mso-catalog-db/src/main/java/org') 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 7ac188b027..d27de9828f 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 @@ -378,16 +378,16 @@ public class CatalogDatabase implements Closeable { */ public Service getService (String modelName) { - long startTime = System.currentTimeMillis (); - LOGGER.debug ("Catalog database - get service with name " + modelName); + long startTime = System.currentTimeMillis(); + LOGGER.debug("Catalog database - get service with name " + modelName); String hql = "FROM Service WHERE modelName = :MODEL_NAME"; - Query query = getSession ().createQuery (hql); - query.setParameter ("MODEL_NAME", modelName); + Query query = getSession().createQuery(hql); + query.setParameter("MODEL_NAME", modelName); Service service = null; try { - service = (Service) query.uniqueResult (); + service = (Service) 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: modelName='" + modelName + "'"); LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " non unique result for modelName=" + modelName, "", "", MsoLogger.ErrorCode.DataError, "Non unique result for modelName=" + modelName); @@ -412,8 +412,8 @@ public class CatalogDatabase implements Closeable { public Service getServiceByModelUUID (String modelUUID) { - long startTime = System.currentTimeMillis (); - LOGGER.debug ("Catalog database - get service with Model UUID " + modelUUID); + long startTime = System.currentTimeMillis(); + LOGGER.debug("Catalog database - get service with Model UUID " + modelUUID); String hql = "FROM Service WHERE modelUUID = :MODEL_UUID"; HashMap parameters = new HashMap<>(); -- cgit 1.2.3-korg