* ============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.
* 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;
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();
}
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");
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();
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");
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");
@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");
@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);
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);