summaryrefslogtreecommitdiffstats
path: root/sparkybe-onap-service/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'sparkybe-onap-service/src/test/java')
-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());
}
+
}