Update the license for 2017-2018 license
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / introspection / sideeffect / DataCopyTest.java
index 4a87099..250c34c 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 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.
@@ -16,8 +16,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * ============LICENSE_END=========================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 package org.onap.aai.introspection.sideeffect;
 
@@ -83,9 +81,11 @@ public class DataCopyTest {
                                loader);
                
                graph.traversal().addV("aai-node-type", "model", "model-invariant-id", "key1").as("v1")
-               .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key2", "model-version", "testValue").addInE("has", "v1", EdgeProperty.CONTAINS.toString(), true)
+               .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key2", "model-version", "testValue")
+                               .addOutE("org.onap.relationships.inventory.BelongsTo", "v1", EdgeProperty.CONTAINS.toString(), true)
                .addV("aai-node-type", "model", "model-invariant-id", "key3").as("v2")
-               .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key4").addInE("has", "v2", EdgeProperty.CONTAINS.toString(), true)
+               .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key4")
+                               .addOutE("org.onap.relationships.inventory.BelongsTo", "v2", EdgeProperty.CONTAINS.toString(), true)
                .next();
                graph.tx().commit();
        }
@@ -105,7 +105,7 @@ public class DataCopyTest {
        public void runPopulatePersonaModelVer() throws URISyntaxException, AAIException, UnsupportedEncodingException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, MalformedURLException {
                
                final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest());
-               final Introspector obj = loader.introspectorFromName("test-object");
+               final Introspector obj = loader.introspectorFromName("generic-vnf");
                obj.setValue("vnf-id", "myId");
                obj.setValue("model-invariant-id", "key1");
                obj.setValue("model-version-id", "key2");
@@ -123,7 +123,7 @@ public class DataCopyTest {
                
                runner.execute(obj, self);
 
-               assertEquals("value populated", "testValue", obj.getValue("persona-model-ver"));
+               assertEquals("value populated", "testValue", obj.getValue("persona-model-version"));
                
                g.tx().rollback();
                
@@ -134,7 +134,7 @@ public class DataCopyTest {
        public void runPopulateModelVersionId() throws URISyntaxException, AAIException, UnsupportedEncodingException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, MalformedURLException {
                
                final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v9);
-               final Introspector obj = loader.introspectorFromName("test-object");
+               final Introspector obj = loader.introspectorFromName("generic-vnf");
                obj.setValue("vnf-id", "myId");
                obj.setValue("persona-model-id", "key1");
                obj.setValue("persona-model-version", "testValue");
@@ -187,7 +187,7 @@ public class DataCopyTest {
        public void expectedMissingPropertyExceptionInURI() throws AAIException, UnsupportedEncodingException {
                
                final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest());
-               final Introspector obj = loader.introspectorFromName("test-object");
+               final Introspector obj = loader.introspectorFromName("generic-vnf");
                obj.setValue("vnf-id", "myId");
                obj.setValue("model-invariant-id", "key1");
 
@@ -210,7 +210,7 @@ public class DataCopyTest {
        @Test
        public void expectedMissingPropertyExceptionForResultingObject() throws AAIException, UnsupportedEncodingException {
                final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest());
-               final Introspector obj = loader.introspectorFromName("test-object");
+               final Introspector obj = loader.introspectorFromName("generic-vnf");
                obj.setValue("vnf-id", "myId");
                obj.setValue("model-invariant-id", "key3");
                obj.setValue("model-version-id", "key4");
@@ -234,7 +234,7 @@ public class DataCopyTest {
        @Test
        public void expectNoProcessingWithNoProperties() throws AAIException, UnsupportedEncodingException {
                final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest());
-               final Introspector obj = loader.introspectorFromName("test-object");
+               final Introspector obj = loader.introspectorFromName("generic-vnf");
                obj.setValue("vnf-id", "myId");
 
                TransactionalGraphEngine spy = spy(dbEngine);
@@ -259,7 +259,7 @@ public class DataCopyTest {
        private String getJsonString(String filename) throws IOException {
                
                
-               FileInputStream is = new FileInputStream("src/test/resources/bundleconfig-local/etc/oxm/sideeffect/" + filename);
+               FileInputStream is = new FileInputStream("src/test/resources/oxm/sideeffect/" + filename);
                String s =  IOUtils.toString(is, "UTF-8"); 
                IOUtils.closeQuietly(is);