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.onap.aai.restclient.enums.RestAuthenticationMode;
10 import org.onap.aai.sparky.dal.rest.config.RestEndpointConfig;
11 import org.onap.aai.sparky.dal.ElasticSearchAdapter;
13 public class ElasticSearchAdapterTest {
16 private ElasticSearchAdapter elasticSearchAdapter;
17 private RestEndpointConfig endpointConfig;
20 public void init() throws Exception {
22 endpointConfig = new RestEndpointConfig();
23 endpointConfig.setRestAuthenticationMode(RestAuthenticationMode.SSL_BASIC);
24 elasticSearchAdapter = new ElasticSearchAdapter(endpointConfig);
29 public void updateValues() {
31 assertNotNull(elasticSearchAdapter.doPost("https://10.247.40.25:8000","{maxResults:10, queryStr: f}",MediaType.APPLICATION_JSON_TYPE));
32 assertNotNull(elasticSearchAdapter.doGet("https://10.247.40.25:8000",MediaType.APPLICATION_JSON_TYPE));
33 assertNotNull(elasticSearchAdapter.doHead("https://10.247.40.25:8000",MediaType.APPLICATION_JSON_TYPE));
34 assertNotNull(elasticSearchAdapter.doPut("https://10.247.40.25:8000","{maxResults:10, queryStr: f}",MediaType.APPLICATION_JSON_TYPE));
35 assertNotNull(elasticSearchAdapter.doPatch("https://10.247.40.25:8000","{maxResults:10, queryStr: f}",MediaType.APPLICATION_JSON_TYPE));
36 assertNotNull(elasticSearchAdapter.doDelete("https://10.247.40.25:8000",MediaType.APPLICATION_JSON_TYPE));
37 assertNotNull(elasticSearchAdapter.doBulkOperation("https://10.247.40.25:8000","{maxResults:10, queryStr: f}"));
38 assertNotNull(elasticSearchAdapter.buildBulkImportOperationRequest("","","","",""));
39 assertNotNull(elasticSearchAdapter.retrieveEntityById("","","","",""));
40 assertNotNull(elasticSearchAdapter.buildElasticSearchUrlForApi("",""));
41 assertNotNull(elasticSearchAdapter.buildElasticSearchUrl("",""));
42 assertNotNull(elasticSearchAdapter.buildElasticSearchGetDocUrl("","",""));
43 assertNotNull(elasticSearchAdapter.buildElasticSearchGetDocUrl("",""));
44 assertNotNull(elasticSearchAdapter.buildElasticSearchPostUrl(""));
45 assertNotNull(elasticSearchAdapter.getBulkUrl());