aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/test
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-10-26 15:05:42 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-10-26 15:50:37 -0400
commit959493d3274d2f2749586248cf31ee12b730e2af (patch)
tree77904da6efa6105149f289be3d285a3499d92c80 /common/src/test
parent373c057bfa82583f615ea46814ad3cdf9ea8d669 (diff)
Bug fixes October 26th
Set non-custom health diagnostic check code to a default value. created custom java serialization for SimpleUri changed property value for cloud-owner in unit test converted aai call to use the AAI Client Correct a JUnit data file to include userParams values that are expected to be set. Set userParams on requestContext to parameters that need to be passed to downstream systems. Change-Id: I3974691875ef967f90a15f076ae27bc0cd76ee8e Issue-ID: SO-1169 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'common/src/test')
-rw-r--r--common/src/test/java/org/onap/so/client/aai/entities/uri/AAISimpleUriTest.java38
-rw-r--r--common/src/test/java/org/onap/so/constants/DefaultsTest.java2
-rw-r--r--common/src/test/resources/application-test.yaml2
3 files changed, 39 insertions, 3 deletions
diff --git a/common/src/test/java/org/onap/so/client/aai/entities/uri/AAISimpleUriTest.java b/common/src/test/java/org/onap/so/client/aai/entities/uri/AAISimpleUriTest.java
index fcf054f489..2a0e9df9ed 100644
--- a/common/src/test/java/org/onap/so/client/aai/entities/uri/AAISimpleUriTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/entities/uri/AAISimpleUriTest.java
@@ -21,15 +21,24 @@
package org.onap.so.client.aai.entities.uri;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
import static org.hamcrest.collection.IsEmptyCollection.empty;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
import static org.junit.Assert.assertEquals;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.util.Map;
import org.junit.Test;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.graphinventory.entities.uri.Depth;
+import org.onap.so.client.graphinventory.entities.uri.SimpleUri;
public class AAISimpleUriTest {
@@ -83,4 +92,31 @@ public class AAISimpleUriTest {
assertEquals("my value", keys.get("service-type"));
}
+
+ @Test
+ public void serializeTest() throws IOException, ClassNotFoundException {
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "test1");
+
+ uri.depth(Depth.ONE);
+ uri.limit(1);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+
+ ObjectOutputStream objectOutputStream
+ = new ObjectOutputStream(bos);
+ objectOutputStream.writeObject(uri);
+ objectOutputStream.flush();
+ objectOutputStream.close();
+
+ ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
+
+ ObjectInputStream objectInputStream
+ = new ObjectInputStream(bis);
+ AAIResourceUri e2 = (AAIResourceUri) objectInputStream.readObject();
+ objectInputStream.close();
+
+ uri.queryParam("test", "value");
+ e2.queryParam("test", "value");
+
+ assertEquals(e2.build().toString(), uri.build().toString());
+ }
}
diff --git a/common/src/test/java/org/onap/so/constants/DefaultsTest.java b/common/src/test/java/org/onap/so/constants/DefaultsTest.java
index 1bcee07118..6383d0ea4c 100644
--- a/common/src/test/java/org/onap/so/constants/DefaultsTest.java
+++ b/common/src/test/java/org/onap/so/constants/DefaultsTest.java
@@ -41,6 +41,6 @@ public class DefaultsTest {
@Test
public void checkValue() {
- assertEquals("CloudOwner", Defaults.CLOUD_OWNER.toString());
+ assertEquals("my-custom-owner", Defaults.CLOUD_OWNER.toString());
}
}
diff --git a/common/src/test/resources/application-test.yaml b/common/src/test/resources/application-test.yaml
index cf386cb6fc..1a3e97c451 100644
--- a/common/src/test/resources/application-test.yaml
+++ b/common/src/test/resources/application-test.yaml
@@ -1,4 +1,4 @@
org:
onap:
so:
- cloud-owner: CloudOwner \ No newline at end of file
+ cloud-owner: my-custom-owner \ No newline at end of file