aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter
diff options
context:
space:
mode:
authorpradip01 <pradipkumar.thakker@amdocs.com>2018-03-26 15:40:09 +0530
committerRob Daugherty <rd472p@att.com>2018-03-27 20:16:50 -0400
commit3bfa426f9594bfd4976012a65ac9c27088c86f12 (patch)
tree532f8ef384407bc6d4b641942e3b032f4cc98303 /adapters/mso-catalog-db-adapter
parentbbe2cc9593b26c855af6b9528c5fa2ba5a37ccbf (diff)
Adding Junits for catalog db
Increase Jnits coverage for catalog db Issue-ID: SO-532 Change-Id: I7a66a38103b2cf2bdad2d066bcc72a590809be53 Signed-off-by: pradip01 <pradipkumar.thakker@amdocs.com>
Diffstat (limited to 'adapters/mso-catalog-db-adapter')
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionTest.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionTest.java
new file mode 100644
index 0000000000..365c9abcf5
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionTest.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.catalogdb.catalogrest;
+
+import org.junit.Test;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+
+public class CatalogQueryExceptionTest {
+ @Test
+ public void catalogQueryExceptionConstructor(){
+ CatalogQueryException messageCatalogQueryException = new CatalogQueryException("TestMessage");
+ assertNotNull(messageCatalogQueryException.getMessage());
+ assertEquals("TestMessage",messageCatalogQueryException.getMessage());
+
+ CatalogQueryException paramsCatalogQueryException = new CatalogQueryException("TestMessage",CatalogQueryExceptionCategory.INTERNAL,true,"messageID");
+ assertParams(paramsCatalogQueryException);
+
+ CatalogQueryException defaultCatalogQueryException = new CatalogQueryException();
+ defaultCatalogQueryException.setCategory(CatalogQueryExceptionCategory.INTERNAL);
+ defaultCatalogQueryException.setMessage("TestMessage");
+ defaultCatalogQueryException.setRolledBack(true);
+ defaultCatalogQueryException.setMessageId("messageID");
+ assertParams(defaultCatalogQueryException);
+ }
+
+ private void assertParams(CatalogQueryException paramsCatalogQueryException) {
+ assertNotNull(paramsCatalogQueryException.getMessage());
+ assertEquals("TestMessage",paramsCatalogQueryException.getMessage());
+ assertNotNull(paramsCatalogQueryException.getCategory());
+ assertEquals(CatalogQueryExceptionCategory.INTERNAL,paramsCatalogQueryException.getCategory());
+ assertNotNull(paramsCatalogQueryException.getRolledBack());
+ assertEquals(true,paramsCatalogQueryException.getRolledBack());
+ assertNotNull(paramsCatalogQueryException.getMessageId());
+ assertEquals("messageID",paramsCatalogQueryException.getMessageId());
+ }
+}