diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionEntityBuilder.java | 20 | ||||
-rw-r--r-- | src/test/java/org/onap/aai/sparky/editattributes/EditAttributesTest.java | 65 |
2 files changed, 11 insertions, 74 deletions
diff --git a/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionEntityBuilder.java b/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionEntityBuilder.java index 7cfd9c9..88dff42 100644 --- a/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionEntityBuilder.java +++ b/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionEntityBuilder.java @@ -41,7 +41,7 @@ public class SearchAbstractionEntityBuilder { doc.addContent("entityPrimaryKeyValue", "example-vnf-id-val-4394"); doc.addContent("entityType", "vpe"); doc.addContent("searchTags", "example-vnf-id-val-4394;example-vnf-name-val-4394;example-vnf-name2-val-4394"); - doc.addContent("link", "https://aai-ext1.test.att.com:8443/aai/v9/network/vpes/vpe/example-vnf-id-val-4394"); + doc.addContent("link", "https://ext1.test.onap.com:8443/aai/v9/network/vpes/vpe/example-vnf-id-val-4394"); doc.addContent("searchTagIDs", "0;1;2"); doc.addContent("lastmodTimestamp", "2017-04-18T17:20:48.072-0400"); @@ -64,7 +64,7 @@ public class SearchAbstractionEntityBuilder { doc.addContent("entityPrimaryKeyValue", "vpe-vnf-id-team4-11"); doc.addContent("entityType", "vpe"); doc.addContent("searchTags", "vpe-vnf-id-team4-11;example-vnf-name-val-9512;example-vnf-name2-val-9512"); - doc.addContent("link", "https://aai-ext1.test.att.com:8443/aai/v9/network/vpes/vpe/vpe-vnf-id-team4-11"); + doc.addContent("link", "https://ext1.test.onap.com:8443/aai/v9/network/vpes/vpe/vpe-vnf-id-team4-11"); doc.addContent("searchTagIDs", "0;1;2"); doc.addContent("lastmodTimestamp", "2017-04-18T17:20:48.175-0400"); @@ -87,7 +87,7 @@ public class SearchAbstractionEntityBuilder { doc.addContent("entityPrimaryKeyValue", "example-vnf-id-val-6176"); doc.addContent("entityType", "generic-vnf"); doc.addContent("searchTags", "example-vnf-id-val-6176;example-vnf-name-val-6176;example-vnf-name2-val-6176"); - doc.addContent("link", "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/example-vnf-id-val-6176"); + doc.addContent("link", "https://ext1.test.onap.com:8443/aai/v9/network/generic-vnfs/generic-vnf/example-vnf-id-val-6176"); doc.addContent("searchTagIDs", "0;1;2"); doc.addContent("lastmodTimestamp", "2017-04-18T17:29:39.889-0400"); @@ -110,7 +110,7 @@ public class SearchAbstractionEntityBuilder { doc.addContent("entityPrimaryKeyValue", "vnf-id-team4-11"); doc.addContent("entityType", "newvce"); doc.addContent("searchTags", "vnf-id-team4-11;example-vnf-name-val-5313;example-vnf-name2-val-5313"); - doc.addContent("link", "https://aai-ext1.test.att.com:8443/aai/v9/network/newvces/newvce/vnf-id-team4-11"); + doc.addContent("link", "https://ext1.test.onap.com:8443/aai/v9/network/newvces/newvce/vnf-id-team4-11"); doc.addContent("searchTagIDs", "0;1;2"); doc.addContent("lastmodTimestamp", "2017-04-18T17:21:08.142-0400"); @@ -133,7 +133,7 @@ public class SearchAbstractionEntityBuilder { doc.addContent("entityPrimaryKeyValue", "example-vnf-id2-val-9501"); doc.addContent("entityType", "newvce"); doc.addContent("searchTags", "example-vnf-id2-val-9501;example-vnf-name-val-9501;example-vnf-name2-val-9501"); - doc.addContent("link", "https://aai-ext1.test.att.com:8443/aai/v9/network/newvces/newvce/example-vnf-id2-val-9501"); + doc.addContent("link", "https://ext1.test.onap.com:8443/aai/v9/network/newvces/newvce/example-vnf-id2-val-9501"); doc.addContent("searchTagIDs", "0;1;2"); doc.addContent("lastmodTimestamp", "2017-04-18T17:21:23.323-0400"); @@ -156,7 +156,7 @@ public class SearchAbstractionEntityBuilder { doc.addContent("entityPrimaryKeyValue", "vnf-id-dm-auto-10"); doc.addContent("entityType", "vce"); doc.addContent("searchTags", "vpe-id-dm-auto-10;vnf-id-dm-auto-10;vnf-name-dm-auto-10;vnf-name2-dm-auto-10"); - doc.addContent("link", "https://aai-ext1.test.att.com:8443/aai/v9/network/vces/vce/vnf-id-dm-auto-10"); + doc.addContent("link", "https://ext1.test.onap.com:8443/aai/v9/network/vces/vce/vnf-id-dm-auto-10"); doc.addContent("searchTagIDs", "0;1;2;3"); doc.addContent("lastmodTimestamp", "2017-04-18T17:24:57.209-0400"); @@ -179,7 +179,7 @@ public class SearchAbstractionEntityBuilder { doc.addContent("entityPrimaryKeyValue", "e3e59c5b-ad48-44d0-b3e4-80eacdcee4c7"); doc.addContent("entityType", "generic-vnf"); doc.addContent("searchTags", "e3e59c5b-ad48-44d0-b3e4-80eacdcee4c7;VNF_Test_vNF_modules_01"); - doc.addContent("link", "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/e3e59c5b-ad48-44d0-b3e4-80eacdcee4c7"); + doc.addContent("link", "https://ext1.test.onap.com:8443/aai/v9/network/generic-vnfs/generic-vnf/e3e59c5b-ad48-44d0-b3e4-80eacdcee4c7"); doc.addContent("searchTagIDs", "0;1"); doc.addContent("lastmodTimestamp", "2017-04-18T17:26:34.603-0400"); @@ -202,7 +202,7 @@ public class SearchAbstractionEntityBuilder { doc.addContent("entityPrimaryKeyValue", "fusion-jitsi-vnf-001"); doc.addContent("entityType", "generic-vnf"); doc.addContent("searchTags", "fusion-jitsi-vnf-001;fusion-jitsi-vnf"); - doc.addContent("link", "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/fusion-jitsi-vnf-001"); + doc.addContent("link", "https://ext1.test.onap.com:8443/aai/v9/network/generic-vnfs/generic-vnf/fusion-jitsi-vnf-001"); doc.addContent("searchTagIDs", "0;1"); doc.addContent("lastmodTimestamp", "2017-04-18T17:28:14.293-0400"); @@ -225,7 +225,7 @@ public class SearchAbstractionEntityBuilder { doc.addContent("entityPrimaryKeyValue", "vnfm0003v"); doc.addContent("entityType", "generic-vnf"); doc.addContent("searchTags", "vnfm0003v;vnfm0003v"); - doc.addContent("link", "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/vnfm0003v"); + doc.addContent("link", "https://ext1.test.onap.com:8443/aai/v9/network/generic-vnfs/generic-vnf/vnfm0003v"); doc.addContent("searchTagIDs", "0;1"); doc.addContent("lastmodTimestamp", "2017-04-18T17:29:39.594-0400"); @@ -248,7 +248,7 @@ public class SearchAbstractionEntityBuilder { doc.addContent("entityPrimaryKeyValue", "amist456vnf"); doc.addContent("entityType", "generic-vnf"); doc.addContent("searchTags", "amist456vnf;amist456vnf"); - doc.addContent("link", "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/amist456vnf"); + doc.addContent("link", "https://ext1.test.onap.com:8443/aai/v9/network/generic-vnfs/generic-vnf/amist456vnf"); doc.addContent("searchTagIDs", "0;1"); doc.addContent("lastmodTimestamp", "2017-04-18T17:28:28.163-0400"); diff --git a/src/test/java/org/onap/aai/sparky/editattributes/EditAttributesTest.java b/src/test/java/org/onap/aai/sparky/editattributes/EditAttributesTest.java index 0d65dad..4e7e80a 100644 --- a/src/test/java/org/onap/aai/sparky/editattributes/EditAttributesTest.java +++ b/src/test/java/org/onap/aai/sparky/editattributes/EditAttributesTest.java @@ -25,36 +25,16 @@ package org.onap.aai.sparky.editattributes; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.io.PrintWriter; -import java.security.Principal; import javax.servlet.ReadListener; -import javax.servlet.ServletException; import javax.servlet.ServletInputStream; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; -import org.apache.openejb.core.security.jaas.UserPrincipal; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.aai.sparky.editattributes.AttributeEditProcessor; -import org.onap.aai.sparky.editattributes.entity.EditRequest; -import com.att.aft.dme2.internal.jettison.json.JSONException; -import com.att.aft.dme2.internal.jettison.json.JSONObject; /** * The Class EditAttributesTest. @@ -145,50 +125,7 @@ public class EditAttributesTest { } */ - /** - * Test get att uid. - * - * @throws IOException Signals that an I/O exception has occurred. - * @throws ServletException the servlet exception - */ - /* - @Test - public void testGetAttUid() throws IOException, ServletException { - HttpServletRequest mockRequest = mock(HttpServletRequest.class); - HttpServletResponse mockResponse = mock(HttpServletResponse.class); - ServletOutputStream mockOutput = mock(ServletOutputStream.class); - ServletInputStream mockInput = new MockServletInputStream(sampleJsonRequest); - - when(mockRequest.getRequestURI()).thenReturn("editAttributes"); - when(mockResponse.getOutputStream()).thenReturn(mockOutput); - - when(mockRequest.getInputStream()).thenReturn(mockInput); - - Principal princip = new UserPrincipal("ds1150"); - - when(mockRequest.getUserPrincipal()).thenReturn(princip); - - PrintWriter writer = new PrintWriter("editServletTest.txt"); - when(mockResponse.getWriter()).thenReturn(writer); - when(mockRequest.getCookies()).thenReturn(new Cookie[] {new Cookie("attESHr", - "DENNIS|SEBASTIAN|dennis.sebastian@amdocs.com|||ko2649||ds1150," - + "RBFMSKQ,Z9V2298,9762186|YNNNNNNNNNNNNNYNNYYNNNNN|DENNIS|EY6SC9000|")}); - AttributeEditProcessor aes = new AttributeEditProcessor(); - String attid = aes.getAttUid(mockRequest); - assertEquals(" Expected ATTUID is wrong", "ds1150", attid); - - when(mockRequest.getCookies()).thenReturn(new Cookie[] {new Cookie("attESHr", - "DENNIS%7cSEBASTIAN%7cdennisse%40amdocs%2ecom%7c%7c%7cko2649%7c%7cds1150%2cRDJJFLM%" - + "2cP86NJ85%2c8127688%7cYNNNNNNNNNNNNNYNNYNYNNNN%7cDENNIS%7cEY6SC9000%7c")}); - attid = aes.getAttUid(mockRequest); - assertEquals(" Expected ATTUID is wrong", "ds1150", attid); - - when(mockRequest.getCookies()).thenReturn(new Cookie[] {}); - attid = aes.getAttUid(mockRequest); - assertEquals(" Expected Empty ID", "", attid); - - } - */ + /** * The Class MockServletInputStream. |