rest-const unit test cases added 65/128865/1
authorGanesh <ganesh.c@samsung.com>
Tue, 26 Apr 2022 03:21:40 +0000 (08:51 +0530)
committerGanesh <ganesh.c@samsung.com>
Tue, 26 Apr 2022 03:21:48 +0000 (08:51 +0530)
Signed-off-by: Ganesh <ganesh.c@samsung.com>
Change-Id: Ie2935b9ac6c590314cf314bc1dd03f6b7ff34456
Issue-ID: CCSDK-3476

adaptors/rest-adaptor/rest-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/rest/impl/ConstantsTest.java [new file with mode: 0644]

diff --git a/adaptors/rest-adaptor/rest-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/rest/impl/ConstantsTest.java b/adaptors/rest-adaptor/rest-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/rest/impl/ConstantsTest.java
new file mode 100644 (file)
index 0000000..b8eb481
--- /dev/null
@@ -0,0 +1,58 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * Copyright (C) 2022 Samsung Electronics. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this\r
+ * file except in compliance with the License. You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software distributed under the License\r
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\r
+ * or implied. See the License for the specific language governing permissions and limitations under\r
+ * the License.\r
+ *\r
+ * SPDX-License-Identifier: Apache-2.0\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
+package org.onap.ccsdk.sli.adaptors.rest.impl;\r
+\r
+import org.junit.Test;\r
+import org.onap.ccsdk.sli.adaptors.rest.Constants;\r
+\r
+import static org.junit.Assert.assertTrue;\r
+\r
+public class ConstantsTest {\r
+    @Test\r
+    public void testContext() {\r
+        assertTrue("error_code" == Constants.ATTRIBUTE_ERROR_CODE\r
+                && "error-message" == Constants.ATTRIBUTE_ERROR_MESSAGE\r
+                && "org.onap.rest.result.message".equals(Constants.CONTEXT_ERROR_MESSAGE)\r
+                && "org.onap.rest.agent.result.message".equals(Constants.CONTEXT_AGENT_ERROR_MESSAGE)\r
+                && "org.onap.rest.result.code".equals(Constants.CONTEXT_ERROR_CODE)\r
+                && "org.onap.rest.agent.result.code".equals(Constants.CONTEXT_AGENT_ERROR_CODE)\r
+                && "success-message".equals(Constants.ATTRIBUTE_SUCCESS_MESSAGE)\r
+                && "SvcLogic.status".equals(Constants.DG_ATTRIBUTE_STATUS)\r
+                && "output.status.code".equals(Constants.DG_OUTPUT_STATUS_CODE)\r
+                && "output.status.message".equals(Constants.DG_OUTPUT_STATUS_MESSAGE)\r
+        );\r
+    }\r
+\r
+    @Test\r
+    public void testYang() {\r
+        assertTrue( "YYYY-MM-DD" == Constants.YANG_REVISION_FORMAT\r
+                && "vnf-config-repo".equals(Constants.YANG_BASE_CONTAINER)\r
+                && "vnf-config-list".equals(Constants.YANG_VNF_CONFIG_LIST)\r
+                && "vnf-config".equals(Constants.YANG_VNF_CONFIG)\r
+        );\r
+    }\r
+\r
+    @Test\r
+    public void testStatus() {\r
+        assertTrue( "status-getter" == Constants.STATUS_GETTER\r
+                && "fusion-vm-status-getter".equals(Constants.VM_FUSION_STATUS_GETTER)\r
+                && "status-vm".equals(Constants.STATUS_OF_VM)\r
+        );\r
+    }\r
+}\r