Merge "test case to check the singleton instance"
authorJames Forsyth <jf2512@att.com>
Fri, 28 Sep 2018 13:12:03 +0000 (13:12 +0000)
committerGerrit Code Review <gerrit@onap.org>
Fri, 28 Sep 2018 13:12:03 +0000 (13:12 +0000)
aai-core/src/test/java/org/onap/aai/rest/RestHandlerTest.java [new file with mode: 0644]

diff --git a/aai-core/src/test/java/org/onap/aai/rest/RestHandlerTest.java b/aai-core/src/test/java/org/onap/aai/rest/RestHandlerTest.java
new file mode 100644 (file)
index 0000000..c25e292
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * 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.aai.rest;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class RestHandlerTest {
+
+    @Test
+    public void testGetInstance() {
+
+       RestHandlerService firstInstance = RestHandlerService.getInstance();
+       RestHandlerService secondInstance = RestHandlerService.getInstance();
+       assertNotNull(firstInstance);
+       assertNotNull(secondInstance);
+       assertTrue(firstInstance == secondInstance);
+
+    }
+}