Removing AJSC and moving to SpringBoot
[aai/search-data-service.git] / src / test / java / org / onap / aai / sa / searchdbabstraction / elasticsearch / dao / ElasticSearchHttpControllerTest.java
index 787976b..e68534c 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017 Amdocs
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 Amdocs
  * ================================================================================
  * 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.sa.searchdbabstraction.elasticsearch.dao;
 
 import org.json.JSONException;
 import org.json.JSONObject;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.aai.sa.searchdbabstraction.elasticsearch.config.ElasticSearchConfig;
-import org.onap.aai.sa.searchdbabstraction.elasticsearch.dao.DocumentStoreDataEntity;
-import org.onap.aai.sa.searchdbabstraction.elasticsearch.dao.DocumentStoreDataEntityImpl;
-import org.onap.aai.sa.searchdbabstraction.elasticsearch.dao.ElasticSearchHttpController;
 import org.onap.aai.sa.searchdbabstraction.entity.OperationResult;
 
 import java.util.Properties;
@@ -49,6 +45,7 @@ public class ElasticSearchHttpControllerTest {
     Properties properties = new Properties();
     properties.put(ElasticSearchConfig.ES_IP_ADDRESS, "127.0.0.1");
     properties.put(ElasticSearchConfig.ES_HTTP_PORT, "9200");
+//    ElasticSearchConfig config = new ElasticSearchConfig(properties);
     ElasticSearchConfig config = new ElasticSearchConfig(properties);
     elasticSearch = new ElasticSearchHttpController(config);
 
@@ -61,13 +58,18 @@ public class ElasticSearchHttpControllerTest {
     testDocument.setSearchTags("service-instance-id");
 
   }
-
+//
   @Test
   public void testCreateTable() throws Exception {
     OperationResult result = elasticSearch.createTable("test", "aai-entities", indexSettings, indexMappings);
     System.out.println(result);
   }
 
+  @Test
+  public void testsuggestionQueryWithPayload() throws Exception {
+    Assert.assertNotNull(elasticSearch.suggestionQueryWithPayload("autoSuggest", "suggest-index"));
+  }
+//
   @Test
   public void testCreateDocument() throws Exception {
     OperationResult result = elasticSearch.createDocument("test", testDocument, false);
@@ -152,7 +154,7 @@ public class ElasticSearchHttpControllerTest {
     OperationResult result = elasticSearch.deleteIndex("test");
     System.out.println(result);
   }
-
+//
   class AAIEntityTestObject implements DocumentStoreDataEntity {
     private String id;
     private String entityType;