1 package org.onap.aai.sparky.dal;
3 import static org.junit.Assert.assertNotNull;
5 import javax.ws.rs.core.MediaType;
7 import org.junit.Before;
9 import org.junit.Ignore;
10 import org.onap.aai.restclient.enums.RestAuthenticationMode;
11 import org.onap.aai.sparky.dal.rest.config.RestEndpointConfig;
12 import org.onap.aai.sparky.dal.ElasticSearchAdapter;
15 public class ElasticSearchAdapterTest {
18 private ElasticSearchAdapter elasticSearchAdapter;
19 private RestEndpointConfig endpointConfig;
22 public void init() throws Exception {
24 endpointConfig = new RestEndpointConfig();
25 endpointConfig.setRestAuthenticationMode(RestAuthenticationMode.SSL_BASIC);
26 elasticSearchAdapter = new ElasticSearchAdapter(endpointConfig);
31 public void updateValues() {
33 assertNotNull(elasticSearchAdapter.doPost("https://10.247.40.25:8000","{maxResults:10, queryStr: f}",MediaType.APPLICATION_JSON_TYPE));
34 assertNotNull(elasticSearchAdapter.doGet("https://10.247.40.25:8000",MediaType.APPLICATION_JSON_TYPE));
35 assertNotNull(elasticSearchAdapter.doHead("https://10.247.40.25:8000",MediaType.APPLICATION_JSON_TYPE));
36 assertNotNull(elasticSearchAdapter.doPut("https://10.247.40.25:8000","{maxResults:10, queryStr: f}",MediaType.APPLICATION_JSON_TYPE));
37 assertNotNull(elasticSearchAdapter.doPatch("https://10.247.40.25:8000","{maxResults:10, queryStr: f}",MediaType.APPLICATION_JSON_TYPE));
38 assertNotNull(elasticSearchAdapter.doDelete("https://10.247.40.25:8000",MediaType.APPLICATION_JSON_TYPE));
39 assertNotNull(elasticSearchAdapter.doBulkOperation("https://10.247.40.25:8000","{maxResults:10, queryStr: f}"));
40 assertNotNull(elasticSearchAdapter.buildBulkImportOperationRequest("","","","",""));
41 assertNotNull(elasticSearchAdapter.retrieveEntityById("","","","",""));
42 assertNotNull(elasticSearchAdapter.buildElasticSearchUrlForApi("",""));
43 assertNotNull(elasticSearchAdapter.buildElasticSearchUrl("",""));
44 assertNotNull(elasticSearchAdapter.buildElasticSearchGetDocUrl("","",""));
45 assertNotNull(elasticSearchAdapter.buildElasticSearchGetDocUrl("",""));
46 assertNotNull(elasticSearchAdapter.buildElasticSearchPostUrl(""));
47 assertNotNull(elasticSearchAdapter.getBulkUrl());