summaryrefslogtreecommitdiffstats
path: root/aai-core/src/test
diff options
context:
space:
mode:
authorVenkata Harish K Kajur <vk250x@att.com>2017-09-19 02:18:52 -0400
committerVenkata Harish K Kajur <vk250x@att.com>2017-09-19 02:34:18 -0400
commit34f82fce815c23f0ae3df3643ee262af396c236c (patch)
tree9f599335912fc8ea358cf7b4b91cb69d35df395c /aai-core/src/test
parent4ffe31eeea74c618ccc8950ee63071f28bafbfc4 (diff)
Add ability to apply configurations to vnf
Issue-ID: AAI-326 Change-Id: Id5480d020f66a6b8d83310d85eb0678f6b504e7a Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'aai-core/src/test')
-rw-r--r--aai-core/src/test/java/org/openecomp/aai/logging/CNNameTest.java (renamed from aai-core/src/test/java/org/openecomp/aai/util/CNNameTest.java)3
-rw-r--r--aai-core/src/test/java/org/openecomp/aai/logging/CustomLogPatternLayoutTest.java (renamed from aai-core/src/test/java/org/openecomp/aai/util/CustomLogPatternLayoutTest.java)2
-rw-r--r--aai-core/src/test/java/org/openecomp/aai/logging/DME2RestFlagTest.java82
3 files changed, 85 insertions, 2 deletions
diff --git a/aai-core/src/test/java/org/openecomp/aai/util/CNNameTest.java b/aai-core/src/test/java/org/openecomp/aai/logging/CNNameTest.java
index f5b67233..b4705030 100644
--- a/aai-core/src/test/java/org/openecomp/aai/util/CNNameTest.java
+++ b/aai-core/src/test/java/org/openecomp/aai/logging/CNNameTest.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.aai.util;
+package org.openecomp.aai.logging;
import ch.qos.logback.access.spi.IAccessEvent;
import org.junit.Before;
@@ -26,6 +26,7 @@ import org.junit.Test;
import org.mockito.Mockito;
import org.openecomp.aai.logging.CNName;
import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper;
+import org.openecomp.aai.util.AAIConstants;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.agent.PowerMockAgent;
diff --git a/aai-core/src/test/java/org/openecomp/aai/util/CustomLogPatternLayoutTest.java b/aai-core/src/test/java/org/openecomp/aai/logging/CustomLogPatternLayoutTest.java
index 31a7b5e4..3e79646b 100644
--- a/aai-core/src/test/java/org/openecomp/aai/util/CustomLogPatternLayoutTest.java
+++ b/aai-core/src/test/java/org/openecomp/aai/logging/CustomLogPatternLayoutTest.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.aai.util;
+package org.openecomp.aai.logging;
import org.junit.Test;
import org.openecomp.aai.logging.CNName;
diff --git a/aai-core/src/test/java/org/openecomp/aai/logging/DME2RestFlagTest.java b/aai-core/src/test/java/org/openecomp/aai/logging/DME2RestFlagTest.java
new file mode 100644
index 00000000..b20f1328
--- /dev/null
+++ b/aai-core/src/test/java/org/openecomp/aai/logging/DME2RestFlagTest.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.openecomp.aai
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. 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.aai.logging;
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+import ch.qos.logback.access.spi.IAccessEvent;
+import org.junit.*;
+
+
+public class DME2RestFlagTest {
+
+ IAccessEvent mockAccEvent;
+ DME2RestFlag _DME2RestFlag;
+
+ String[] temp = new String[4];
+
+
+ @Before
+ public void setUp() throws Exception {
+
+ mockAccEvent = mock(IAccessEvent.class);
+ _DME2RestFlag= spy(DME2RestFlag.class);
+
+ }
+ private DME2RestFlag getTestObj(final boolean instanceStarted){
+ return new DME2RestFlag(){
+ @Override
+ public
+ boolean isStarted(){
+ return instanceStarted;
+ }
+ };
+ }
+
+ @Test
+ public void convertTestAllValid(){
+ temp[0]= "temp1";
+ temp[1] = "-";
+ when(mockAccEvent.getRequestParameter("envContext")).thenReturn(temp);
+ when(mockAccEvent.getRequestParameter("routeOffer")).thenReturn(temp);
+ when(mockAccEvent.getRequestParameter("version")).thenReturn(temp);
+ _DME2RestFlag = getTestObj(true);
+ assertEquals(_DME2RestFlag.convert(mockAccEvent),"DME2");
+ }
+
+ @Test
+ public void convertMissingRouteTest(){
+ temp[0]= "";
+ temp[1] = "-";
+ when(mockAccEvent.getRequestParameter("envContext")).thenReturn(temp);
+ when(mockAccEvent.getRequestParameter("routeOffer")).thenReturn(temp);
+ when(mockAccEvent.getRequestParameter("version")).thenReturn(temp);
+ _DME2RestFlag = getTestObj(true);
+ assertEquals(_DME2RestFlag.convert(mockAccEvent),"REST");
+ }
+
+ @Test
+ public void convertIsStartedFalseTest(){
+ _DME2RestFlag = getTestObj(false);
+ assertEquals(_DME2RestFlag.convert(mockAccEvent),"INACTIVE_HEADER_CONV");
+ }
+
+
+}