Junit test class added for TemplateException.java 72/77772/3
authorSudarshan Kumar <sudars19@in.ibm.com>
Mon, 4 Feb 2019 10:36:38 +0000 (16:06 +0530)
committerPatrick Brady <patrick.brady@att.com>
Tue, 5 Feb 2019 18:08:47 +0000 (18:08 +0000)
Junit test class added for TemplateException.java

Issue-ID: APPC-1372
Change-Id: I94d97e4b173c51a34a0320f3e24761582fc39101
Signed-off-by: Sudarshan Kumar <sudars19@in.ibm.com>
appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/TestTemplateException.java [new file with mode: 0644]

diff --git a/appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/TestTemplateException.java b/appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/TestTemplateException.java
new file mode 100644 (file)
index 0000000..2fd25b2
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2019 IBM Intellectual Property
+ * ===================================================================
+ *  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.onap.appc.ccadaptor;
+
+import static org.junit.Assert.assertSame;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestTemplateException {
+
+    String s1;
+    String s2;
+
+    @Before
+    public void setUp() {
+        s1 = "Value1";
+        s2 = "value2";
+    }
+
+    @Test
+    public void TestException1() {
+        try {
+            if (!s1.equalsIgnoreCase(s2)) {
+                throw new TemplateException("TemplateException");
+            }
+        } catch (TemplateException te) {
+            assertSame("TemplateException", te.getMessage());
+        }
+    }
+}