* ============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;
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);
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);
OperationResult result = elasticSearch.deleteIndex("test");
System.out.println(result);
}
-
+//
class AAIEntityTestObject implements DocumentStoreDataEntity {
private String id;
private String entityType;