summaryrefslogtreecommitdiffstats
path: root/sparkybe-onap-service/src/test/java/org/onap
diff options
context:
space:
mode:
authorfpaquett <francis.paquette@amdocs.com>2018-12-12 08:15:38 -0500
committerFrancis Paquette <francis.paquette@amdocs.com>2018-12-14 07:40:11 -0500
commitd89597a79b75aa6624fe4ff939e13a21d8b99a03 (patch)
tree6e8adb84aebc55c8b1ebca52dadf6adbd7d7aadd /sparkybe-onap-service/src/test/java/org/onap
parent53d13ff36532723582f55febce79de2282e46cde (diff)
Fix sync update flow
Issue-ID: AAI-1999 Change-Id: Id10b657236aff9ee1009ff0e1627a894e3881a87 Signed-off-by: fpaquett <francis.paquette@amdocs.com>
Diffstat (limited to 'sparkybe-onap-service/src/test/java/org/onap')
-rw-r--r--sparkybe-onap-service/src/test/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizerTest.java25
-rw-r--r--sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java3
-rw-r--r--sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexableCrossEntityReferenceTest.java1
3 files changed, 26 insertions, 3 deletions
diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizerTest.java
index 2366439..0721fd2 100644
--- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizerTest.java
+++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizerTest.java
@@ -18,6 +18,8 @@ import org.mockito.Mockito;
import org.onap.aai.restclient.client.OperationResult;
import org.onap.aai.sparky.config.oxm.CrossEntityReferenceLookup;
import org.onap.aai.sparky.config.oxm.OxmEntityDescriptor;
+import org.onap.aai.sparky.config.oxm.CrossEntityReferenceDescriptor;
+import org.onap.aai.sparky.config.oxm.CrossEntityReference;
import org.onap.aai.sparky.config.oxm.OxmEntityLookup;
import org.onap.aai.sparky.config.oxm.OxmModelProcessor;
import org.onap.aai.sparky.config.oxm.SearchableEntityLookup;
@@ -144,11 +146,28 @@ public class CrossEntityReferenceSynchronizerTest {
cerLookup = new CrossEntityReferenceLookup();
processors.add(cerLookup);
-
+
+ Map<String, CrossEntityReferenceDescriptor> crossReferenceEntityDescriptors =
+ new HashMap<String, CrossEntityReferenceDescriptor>();
+
+ CrossEntityReferenceDescriptor crossReferenceEntiDescriptor = new CrossEntityReferenceDescriptor();
+ CrossEntityReference crossEntityReference = new CrossEntityReference();
+ crossEntityReference.setTargetEntityType("service-instance");
+ List<String> refEntities = new ArrayList<String>();
+ refEntities.add("service-type");
+ crossEntityReference.setReferenceAttributes(refEntities);
+
+ List<String> crossEntityPkeyNames = new ArrayList<String>();
+ crossEntityPkeyNames.add("service-type");
+ crossReferenceEntiDescriptor.setPrimaryKeyAttributeNames(crossEntityPkeyNames);
+
+ crossReferenceEntiDescriptor.setCrossEntityReference(crossEntityReference);
+ crossReferenceEntiDescriptor.setEntityName("service-subscription");
+ crossReferenceEntityDescriptors.put("service-subscription", crossReferenceEntiDescriptor);
+ cerLookup.setCrossReferenceEntityDescriptors(crossReferenceEntityDescriptors);
+
searchableEntityLookup = new SearchableEntityLookup();
processors.add(searchableEntityLookup);
-
-
aaiRestEndPointConfig = new RestEndpointConfig();
aaiRestEndPointConfig.setNumRequestRetries(5);
diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java
index 59db5c2..c8bb33a 100644
--- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java
+++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java
@@ -44,6 +44,9 @@ public class SearchServiceAdapterTest {
searchServiceAdapter.buildSearchServiceUrlForApi("searchentity-localhost", "2.0"));
assertNotNull(searchServiceAdapter.buildSuggestServiceQueryUrl("searchentity-localhost"));
+ assertEquals(searchServiceAdapter.buildBulkImportOperationRequest("testIndex", "1", "4", "{\"payload\":\"value\"}"),
+ "[{\"update\":{\"metaData\":{\"url\":\"/services/search-data-service/2.0/search/indexes/testIndex/documents/1\", "
+ + "\"etag\":\"4\"},\"document\":{\"payload\":\"value\"}}}]\n");
}
diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexableCrossEntityReferenceTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexableCrossEntityReferenceTest.java
index a7c34d0..451bc98 100644
--- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexableCrossEntityReferenceTest.java
+++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexableCrossEntityReferenceTest.java
@@ -69,4 +69,5 @@ public class IndexableCrossEntityReferenceTest {
System.out.println(icer.getAsJson());
}
+
}