aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee, Tian (tl5884) <TianL@amdocs.com>2019-03-01 16:03:03 +0000
committerLee, Tian (tl5884) <TianL@amdocs.com>2019-03-01 16:03:03 +0000
commite07d5b8dc0801583518b4f27ce6b8f3b56bcf206 (patch)
tree66fa70a6f5a1fbeb069723b3d9df07759d58d7c8
parent5ea47abeeb1713b56006fd69b1564cbd4c4220c7 (diff)
Add elasticsearch with searchguard Dockerfile
Add Dockerfile that produces an image of ElasticSearch with SearchGuard plugin pre-installed, and restructure the Maven project to build both the old search-data-service Dockerfile and the new elasticsearch-sg Dockerfile. Change-Id: Iff7cb79e3c09da78b6233422f40cb03eeef5bfdb Issue-ID: AAI-2203 Signed-off-by: Lee, Tian (tl5884) <TianL@amdocs.com>
-rw-r--r--elasticsearch-sg/pom.xml81
-rw-r--r--elasticsearch-sg/src/main/docker/Dockerfile10
-rw-r--r--pom.xml475
-rw-r--r--search-data-service/License.txt (renamed from License.txt)0
-rw-r--r--search-data-service/bundleconfig-local/etc/logback.xml (renamed from bundleconfig-local/etc/logback.xml)0
-rw-r--r--search-data-service/pom.xml461
-rw-r--r--search-data-service/src/main/bin/start.sh (renamed from src/main/bin/start.sh)0
-rw-r--r--search-data-service/src/main/docker/Dockerfile (renamed from src/main/docker/Dockerfile)2
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/Application.java (renamed from src/main/java/org/onap/aai/sa/Application.java)116
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuth.java (renamed from src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuth.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuthCore.java (renamed from src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuthCore.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/AnalysisConfiguration.java (renamed from src/main/java/org/onap/aai/sa/rest/AnalysisConfiguration.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/AnalyzerApi.java (renamed from src/main/java/org/onap/aai/sa/rest/AnalyzerApi.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/ApiUtils.java (renamed from src/main/java/org/onap/aai/sa/rest/ApiUtils.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/BulkApi.java (renamed from src/main/java/org/onap/aai/sa/rest/BulkApi.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/BulkMetaData.java (renamed from src/main/java/org/onap/aai/sa/rest/BulkMetaData.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/BulkOperation.java (renamed from src/main/java/org/onap/aai/sa/rest/BulkOperation.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/BulkRequest.java (renamed from src/main/java/org/onap/aai/sa/rest/BulkRequest.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/Document.java (renamed from src/main/java/org/onap/aai/sa/rest/Document.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/DocumentApi.java (renamed from src/main/java/org/onap/aai/sa/rest/DocumentApi.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/IndexApi.java (renamed from src/main/java/org/onap/aai/sa/rest/IndexApi.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/SearchServiceApi.java (renamed from src/main/java/org/onap/aai/sa/rest/SearchServiceApi.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/rest/SettingConfiguration.java (renamed from src/main/java/org/onap/aai/sa/rest/SettingConfiguration.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/RestEchoService.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/RestEchoService.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfig.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfig.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntity.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntity.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntityImpl.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntityImpl.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreInterface.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreInterface.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchBulkOperationResult.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchBulkOperationResult.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchCause.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchCause.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchError.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchError.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpController.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpController.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpsController.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpsController.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchOperationStatus.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchOperationStatus.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItem.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItem.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchShardStatus.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchShardStatus.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/exception/DocumentStoreOperationException.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/exception/DocumentStoreOperationException.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationBucket.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationBucket.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResult.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResult.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResults.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResults.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/Document.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/Document.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/DocumentOperationResult.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/DocumentOperationResult.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/ErrorResult.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/ErrorResult.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResult.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResult.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResultBuilder.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResultBuilder.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHit.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHit.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHits.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHits.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchOperationResult.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchOperationResult.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHit.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHit.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHits.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHits.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/logging/SearchDbMsgs.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/logging/SearchDbMsgs.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AbstractAggregation.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AbstractAggregation.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Aggregation.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Aggregation.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatement.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatement.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregation.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregation.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRange.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRange.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregation.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregation.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Filter.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Filter.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregation.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregation.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/ParsedQuery.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/ParsedQuery.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Query.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Query.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryStatement.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryStatement.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQuery.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQuery.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatement.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatement.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Sort.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Sort.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SuggestionStatement.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SuggestionStatement.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQuery.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQuery.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/service/SearchService.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/service/SearchService.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/AggregationParsingUtil.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/util/AggregationParsingUtil.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/DocumentSchemaUtil.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/util/DocumentSchemaUtil.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslator.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslator.java)0
-rw-r--r--search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/SearchDbConstants.java (renamed from src/main/java/org/onap/aai/sa/searchdbabstraction/util/SearchDbConstants.java)0
-rw-r--r--search-data-service/src/main/resources/application.properties (renamed from src/main/resources/application.properties)8
-rw-r--r--search-data-service/src/main/resources/banner.txt (renamed from src/main/resources/banner.txt)0
-rw-r--r--search-data-service/src/main/resources/json/schema/analyzer.schema.json (renamed from src/main/resources/json/schema/analyzer.schema.json)0
-rw-r--r--search-data-service/src/main/resources/json/schema/document-field.schema.json (renamed from src/main/resources/json/schema/document-field.schema.json)0
-rw-r--r--search-data-service/src/main/resources/json/schema/document.schema.json (renamed from src/main/resources/json/schema/document.schema.json)0
-rw-r--r--search-data-service/src/main/resources/json/schema/filter.schema.json (renamed from src/main/resources/json/schema/filter.schema.json)0
-rw-r--r--search-data-service/src/main/resources/logging/SearchDbMsgs.properties (renamed from src/main/resources/logging/SearchDbMsgs.properties)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/auth/SearchDbServiceAuthTest.java (renamed from src/test/java/org/onap/aai/sa/auth/SearchDbServiceAuthTest.java)172
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/ApiUtilsTest.java (renamed from src/test/java/org/onap/aai/sa/rest/ApiUtilsTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/BulkApiTest.java (renamed from src/test/java/org/onap/aai/sa/rest/BulkApiTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/BulkRequestTest.java (renamed from src/test/java/org/onap/aai/sa/rest/BulkRequestTest.java)298
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/DocumentApiTest.java (renamed from src/test/java/org/onap/aai/sa/rest/DocumentApiTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/DocumentSchemaTest.java (renamed from src/test/java/org/onap/aai/sa/rest/DocumentSchemaTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/DocumentTest.java (renamed from src/test/java/org/onap/aai/sa/rest/DocumentTest.java)1452
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/IndexApiTest.java (renamed from src/test/java/org/onap/aai/sa/rest/IndexApiTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/SearchServiceApiHarness.java (renamed from src/test/java/org/onap/aai/sa/rest/SearchServiceApiHarness.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/SettingConfigurationTest.java (renamed from src/test/java/org/onap/aai/sa/rest/SettingConfigurationTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/StubEsController.java (renamed from src/test/java/org/onap/aai/sa/rest/StubEsController.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/rest/TestUtils.java (renamed from src/test/java/org/onap/aai/sa/rest/TestUtils.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfigTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfigTest.java)106
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/AggregationResponseParsingTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/AggregationResponseParsingTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpControllerTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpControllerTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItemTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItemTest.java)238
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatementTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatementTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregationTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregationTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregationTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregationTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/FilterTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/FilterTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregationTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregationTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQueryTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQueryTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatementTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatementTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SortTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SortTest.java)0
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQueryTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQueryTest.java)126
-rw-r--r--search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslatorTest.java (renamed from src/test/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslatorTest.java)0
-rw-r--r--search-data-service/src/test/resources/json/analysis-config.json (renamed from src/test/resources/json/analysis-config.json)0
-rw-r--r--search-data-service/src/test/resources/json/bulk-ops-invalid.json (renamed from src/test/resources/json/bulk-ops-invalid.json)0
-rw-r--r--search-data-service/src/test/resources/json/bulk-ops-valid.json (renamed from src/test/resources/json/bulk-ops-valid.json)0
-rw-r--r--search-data-service/src/test/resources/json/dynamic-custom-template.json (renamed from src/test/resources/json/dynamic-custom-template.json)0
-rw-r--r--search-data-service/src/test/resources/json/dynamicIndex.json (renamed from src/test/resources/json/dynamicIndex.json)0
-rw-r--r--search-data-service/src/test/resources/json/es-payload-translation.json (renamed from src/test/resources/json/es-payload-translation.json)0
-rw-r--r--search-data-service/src/test/resources/json/filter-config.json (renamed from src/test/resources/json/filter-config.json)0
-rw-r--r--search-data-service/src/test/resources/json/index-mapping.json (renamed from src/test/resources/json/index-mapping.json)0
-rw-r--r--search-data-service/src/test/resources/json/nested-document.json (renamed from src/test/resources/json/nested-document.json)0
-rw-r--r--search-data-service/src/test/resources/json/queries/query-with-subrange.json (renamed from src/test/resources/json/queries/query-with-subrange.json)0
-rw-r--r--search-data-service/src/test/resources/json/queries/simple-parsed-query.json (renamed from src/test/resources/json/queries/simple-parsed-query.json)0
-rw-r--r--search-data-service/src/test/resources/json/search_policy.json (renamed from src/test/resources/json/search_policy.json)124
-rw-r--r--search-data-service/src/test/resources/json/settings-config.json (renamed from src/test/resources/json/settings-config.json)0
-rw-r--r--search-data-service/src/test/resources/json/simpleDocument.json (renamed from src/test/resources/json/simpleDocument.json)0
-rw-r--r--search-data-service/src/test/resources/json/tier-support-document.json (renamed from src/test/resources/json/tier-support-document.json)0
123 files changed, 1901 insertions, 1768 deletions
diff --git a/elasticsearch-sg/pom.xml b/elasticsearch-sg/pom.xml
new file mode 100644
index 0000000..cd24333
--- /dev/null
+++ b/elasticsearch-sg/pom.xml
@@ -0,0 +1,81 @@
+<!--
+
+ ============LICENSE_START=======================================================
+ org.onap.aai
+ ================================================================================
+ 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.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.onap.aai.search-data-service</groupId>
+ <artifactId>elasticsearch-sg</artifactId>
+ <name>elasticsearch with searchguard</name>
+ <version>1.4.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.7</version>
+ <executions>
+ <execution>
+ <id>copy-docker-file</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target</outputDirectory>
+ <overwrite>true</overwrite>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/main/docker</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>0.4.11</version>
+ <configuration>
+ <verbose>true</verbose>
+ <serverId>docker-hub</serverId>
+ <imageName>${docker.push.registry}/onap/${project.artifactId}</imageName>
+ <dockerDirectory>${basedir}/target</dockerDirectory>
+ <imageTags>
+ <imageTag>latest</imageTag>
+ </imageTags>
+ <forceTags>true</forceTags>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/elasticsearch-sg/src/main/docker/Dockerfile b/elasticsearch-sg/src/main/docker/Dockerfile
new file mode 100644
index 0000000..0ccb31d
--- /dev/null
+++ b/elasticsearch-sg/src/main/docker/Dockerfile
@@ -0,0 +1,10 @@
+# https://github.com/elastic/elasticsearch-docker
+FROM docker.elastic.co/elasticsearch/elasticsearch:6.1.2
+
+USER elasticsearch
+
+# Search Guard plugin
+RUN elasticsearch-plugin install --batch com.floragunn:search-guard-6:6.1.2-22.3 \
+ && chmod +x plugins/search-guard-6/tools/*.sh
+
+ENTRYPOINT ["/usr/share/elasticsearch/bin/run.sh"] \ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 65c8d40..3eb4543 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,450 +21,31 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>spring-boot-starter-parent</artifactId>
- <groupId>org.springframework.boot</groupId>
- <version>1.5.18.RELEASE</version>
- </parent>
- <groupId>org.onap.aai</groupId>
- <artifactId>search-data-service</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- <name>aai-search-data-service</name>
-
- <properties>
- <docker.location>${basedir}/target</docker.location>
- <nexusproxy>https://nexus.onap.org</nexusproxy>
- <java.version>1.8</java.version>
- <generatedSourceDir>${basedir}/src/main/java-gen</generatedSourceDir>
- <checkstyle.config.location>google_checks.xml</checkstyle.config.location>
-
- <sonar.language>java</sonar.language>
- <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
- <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports
- </sonar.surefire.reportsPath>
- <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec
- </sonar.jacoco.reportPath>
- <sonar.jacoco.reportMissing.force.zero>false</sonar.jacoco.reportMissing.force.zero>
- <sonar.projectVersion>${project.version}</sonar.projectVersion>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.8.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
- <version>1.3</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.jayway.jsonpath</groupId>
- <artifactId>json-path</artifactId>
- <version>2.2.0</version>
- </dependency>
-
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- <version>1.1.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>2.1.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
-
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.10.19</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Common logging framework -->
- <dependency>
- <groupId>org.onap.aai.logging-service</groupId>
- <artifactId>common-logging</artifactId>
- <version>1.2.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.onap.aai.logging-service</groupId>
- <artifactId>logging-api</artifactId>
- <version>1.2.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.onap.aai.logging-service</groupId>
- <artifactId>eelf-logging</artifactId>
- <version>1.2.2</version>
- </dependency>
-
- <!-- For JSON Mapping Support. -->
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.7.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.directory.studio</groupId>
- <artifactId>org.apache.commons.lang</artifactId>
- <version>2.6</version>
- </dependency>
-
- <dependency>
- <groupId>radeox</groupId>
- <artifactId>radeox</artifactId>
- <version>0.9</version>
- </dependency>
-
- <dependency>
- <groupId>com.github.fge</groupId>
- <artifactId>json-schema-validator</artifactId>
- <version>2.0.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- <version>20180130</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-tomcat</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-jetty</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- <exclusions>
- <exclusion>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-jersey</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-tomcat</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-security</artifactId>
- </dependency>
-
- <!--Logback classic-->
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>1.2.1</version>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- <version>1.2.1</version>
- </dependency>
-
- </dependencies>
-
- <repositories>
- <repository>
- <id>central</id>
- <name>Maven 2 repository 2</name>
- <url>http://repo2.maven.org/maven2/</url>
- </repository>
- <repository>
- <id>ecomp-releases</id>
- <name>ECOMP Release Repository</name>
- <url>${nexusproxy}/content/repositories/releases/</url>
- </repository>
- <repository>
- <id>ecomp-snapshots</id>
- <name>ECOMP Snapshot Repository</name>
- <url>${nexusproxy}/content/repositories/snapshots/</url>
- </repository>
- <repository>
- <id>ecomp-staging</id>
- <name>ECOMP Staging Repository</name>
- <url>${nexusproxy}/content/repositories/staging/</url>
- </repository>
- </repositories>
-
- <build>
- <finalName>search-data-service-package</finalName>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- <!-- Checkstyle plugin - used to report on compliance with -->
- <!-- the Google style guide. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <configuration>
- <reportPlugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.17</version>
- <reportSets>
- <reportSet>
- <reports>
- <report>checkstyle</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- </reportPlugins>
- </configuration>
- </plugin>
- <!-- This plugin overrides the compiler settings to use java 1.8 -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <compilerId>groovy-eclipse-compiler</compilerId>
- <verbose>true</verbose>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-eclipse-compiler</artifactId>
- <version>2.9.0-01</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-eclipse-batch</artifactId>
- <version>2.3.4-01</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <groupId>com.spotify</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <version>0.4.11</version>
- <configuration>
- <verbose>true</verbose>
- <serverId>docker-hub</serverId>
- <imageName>${docker.push.registry}/onap/${project.artifactId}</imageName>
- <dockerDirectory>${docker.location}</dockerDirectory>
- <imageTags>
- <imageTag>latest</imageTag>
- </imageTags>
- <forceTags>true</forceTags>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.sonatype.plugins</groupId>
- <artifactId>nexus-staging-maven-plugin</artifactId>
- <version>1.6.7</version>
- <extensions>true</extensions>
- <configuration>
- <nexusUrl>${nexusproxy}</nexusUrl>
- <stagingProfileId>176c31dfe190a</stagingProfileId>
- <serverId>ecomp-staging</serverId>
- </configuration>
- </plugin>
-
- <!-- This plugin is used to generate Java POJO's from json format schema
- file. -->
- <plugin>
- <groupId>org.jsonschema2pojo</groupId>
- <artifactId>jsonschema2pojo-maven-plugin</artifactId>
- <version>0.4.26</version>
- <configuration>
- <addCompileSourceRoot>true</addCompileSourceRoot>
- <sourceDirectory>${basedir}/src/main/resources/json/schema</sourceDirectory>
- <outputDirectory>${generatedSourceDir}</outputDirectory>
- <targetPackage>org.onap.aai.sa.rest</targetPackage>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.7</version>
- <executions>
- <execution>
- <id>copy-docker-file</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>target</outputDirectory>
- <overwrite>true</overwrite>
- <resources>
- <resource>
- <directory>${basedir}/src/main/docker</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>${basedir}</directory>
- <filtering>true</filtering>
- <includes>
- <include>bundleconfig-local/**</include>
- </includes>
- </resource>
- <resource>
- <directory>${basedir}/src/main/bin/</directory>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!-- license plugin -->
- <plugin>
- <groupId>com.mycila</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <version>3.0</version>
- <configuration>
- <header>License.txt</header>
- <includes>
- <include>src/main/java/**</include>
- <include>src/test/java/**</include>
- <include>pom.xml</include>
- </includes>
- <skipExistingHeaders>true</skipExistingHeaders>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- <phase>validate</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>sonar-maven-plugin</artifactId>
- <version>3.2</version>
- </plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.7.7.201606060606</version>
- <configuration>
- <dumpOnExit>true</dumpOnExit>
- </configuration>
- <executions>
- <execution>
- <id>jacoco-initialize-unit-tests</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- <configuration>
- <destFile>${project.build.directory}/coverage-reports/jacoco.exec
- </destFile>
- <!-- <append>true</append> -->
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- This plugin adds the generated sources directory to the clean lifecycle
- so that automatically generated code will get cleaned up properly. -->
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>3.0.0</version>
- <configuration>
- <filesets>
- <fileset>
- <directory>${generatedSourceDir}</directory>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <distributionManagement>
- <repository>
- <id>ecomp-releases</id>
- <name>ECOMP Release Repository</name>
- <url>${nexusproxy}/content/repositories/releases/</url>
- </repository>
- <snapshotRepository>
- <id>ecomp-snapshots</id>
- <name>ECOMP Snapshot Repository</name>
- <url>${nexusproxy}/content/repositories/snapshots/</url>
- </snapshotRepository>
- <site>
- <id>ecomp-javadoc</id>
- <url>dav:https://ecomp-nexus:8443/repository/aai/search-data-service-javadoc/${project.version}</url>
- </site>
- </distributionManagement>
-</project>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.onap.aai</groupId>
+ <artifactId>search-data-service-agg</artifactId>
+ <name>aai-search-data-service aggregate pom</name>
+ <version>1.4.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>search-data-service</module>
+ <module>elasticsearch-sg</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>0.4.11</version>
+ <configuration>
+ <skipDockerBuild>true</skipDockerBuild>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/License.txt b/search-data-service/License.txt
index df05b97..df05b97 100644
--- a/License.txt
+++ b/search-data-service/License.txt
diff --git a/bundleconfig-local/etc/logback.xml b/search-data-service/bundleconfig-local/etc/logback.xml
index 7b90318..7b90318 100644
--- a/bundleconfig-local/etc/logback.xml
+++ b/search-data-service/bundleconfig-local/etc/logback.xml
diff --git a/search-data-service/pom.xml b/search-data-service/pom.xml
new file mode 100644
index 0000000..a270914
--- /dev/null
+++ b/search-data-service/pom.xml
@@ -0,0 +1,461 @@
+<!--
+
+ ============LICENSE_START=======================================================
+ org.onap.aai
+ ================================================================================
+ 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.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>spring-boot-starter-parent</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ <version>1.5.18.RELEASE</version>
+ </parent>
+
+ <groupId>org.onap.aai</groupId>
+ <artifactId>search-data-service</artifactId>
+ <version>1.4.0-SNAPSHOT</version>
+ <name>aai-search-data-service</name>
+
+ <properties>
+ <docker.location>${basedir}/target</docker.location>
+ <nexusproxy>https://nexus.onap.org</nexusproxy>
+ <java.version>1.8</java.version>
+ <generatedSourceDir>${basedir}/src/main/java-gen</generatedSourceDir>
+ <checkstyle.config.location>google_checks.xml</checkstyle.config.location>
+
+ <sonar.language>java</sonar.language>
+ <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+ <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports
+ </sonar.surefire.reportsPath>
+ <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec
+ </sonar.jacoco.reportPath>
+ <sonar.jacoco.reportMissing.force.zero>false</sonar.jacoco.reportMissing.force.zero>
+ <sonar.projectVersion>${project.version}</sonar.projectVersion>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jayway.jsonpath</groupId>
+ <artifactId>json-path</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.json-simple</groupId>
+ <artifactId>json-simple</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>2.1.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.10.19</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Common logging framework -->
+ <dependency>
+ <groupId>org.onap.aai.logging-service</groupId>
+ <artifactId>common-logging</artifactId>
+ <version>1.2.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onap.aai.logging-service</groupId>
+ <artifactId>logging-api</artifactId>
+ <version>1.2.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onap.aai.logging-service</groupId>
+ <artifactId>eelf-logging</artifactId>
+ <version>1.2.2</version>
+ </dependency>
+
+ <!-- For JSON Mapping Support. -->
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.directory.studio</groupId>
+ <artifactId>org.apache.commons.lang</artifactId>
+ <version>2.6</version>
+ </dependency>
+
+ <dependency>
+ <groupId>radeox</groupId>
+ <artifactId>radeox</artifactId>
+ <version>0.9</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.github.fge</groupId>
+ <artifactId>json-schema-validator</artifactId>
+ <version>2.0.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <version>20180130</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-tomcat</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-jetty</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-jersey</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-tomcat</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-security</artifactId>
+ </dependency>
+
+ <!--Logback classic-->
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>central</id>
+ <name>Maven 2 repository 2</name>
+ <url>http://repo2.maven.org/maven2/</url>
+ </repository>
+ <repository>
+ <id>ecomp-releases</id>
+ <name>ECOMP Release Repository</name>
+ <url>${nexusproxy}/content/repositories/releases/</url>
+ </repository>
+ <repository>
+ <id>ecomp-snapshots</id>
+ <name>ECOMP Snapshot Repository</name>
+ <url>${nexusproxy}/content/repositories/snapshots/</url>
+ </repository>
+ <repository>
+ <id>ecomp-staging</id>
+ <name>ECOMP Staging Repository</name>
+ <url>${nexusproxy}/content/repositories/staging/</url>
+ </repository>
+ </repositories>
+
+ <build>
+ <finalName>search-data-service-package</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ <!-- Checkstyle plugin - used to report on compliance with -->
+ <!-- the Google style guide. -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <reportPlugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.17</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>checkstyle</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </reportPlugins>
+ </configuration>
+ </plugin>
+ <!-- This plugin overrides the compiler settings to use java 1.8 -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerId>groovy-eclipse-compiler</compilerId>
+ <verbose>true</verbose>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-eclipse-compiler</artifactId>
+ <version>2.9.0-01</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-eclipse-batch</artifactId>
+ <version>2.3.4-01</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>0.4.11</version>
+ <configuration>
+ <verbose>true</verbose>
+ <serverId>docker-hub</serverId>
+ <imageName>${docker.push.registry}/onap/${project.artifactId}</imageName>
+ <dockerDirectory>${docker.location}</dockerDirectory>
+ <imageTags>
+ <imageTag>latest</imageTag>
+ </imageTags>
+ <forceTags>true</forceTags>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.7</version>
+ <extensions>true</extensions>
+ <configuration>
+ <nexusUrl>${nexusproxy}</nexusUrl>
+ <stagingProfileId>176c31dfe190a</stagingProfileId>
+ <serverId>ecomp-staging</serverId>
+ </configuration>
+ </plugin>
+
+ <!-- This plugin is used to generate Java POJO's from json format schema
+ file. -->
+ <plugin>
+ <groupId>org.jsonschema2pojo</groupId>
+ <artifactId>jsonschema2pojo-maven-plugin</artifactId>
+ <version>0.4.26</version>
+ <configuration>
+ <addCompileSourceRoot>true</addCompileSourceRoot>
+ <sourceDirectory>${basedir}/src/main/resources/json/schema</sourceDirectory>
+ <outputDirectory>${generatedSourceDir}</outputDirectory>
+ <targetPackage>org.onap.aai.sa.rest</targetPackage>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-docker-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target</outputDirectory>
+ <overwrite>true</overwrite>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/main/docker</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>${basedir}</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>bundleconfig-local/**</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>${basedir}/src/main/bin/</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- license plugin -->
+ <plugin>
+ <groupId>com.mycila</groupId>
+ <artifactId>license-maven-plugin</artifactId>
+ <version>3.0</version>
+ <configuration>
+ <header>License.txt</header>
+ <includes>
+ <include>src/main/java/**</include>
+ <include>src/test/java/**</include>
+ <include>pom.xml</include>
+ </includes>
+ <skipExistingHeaders>true</skipExistingHeaders>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>validate</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sonar-maven-plugin</artifactId>
+ <version>3.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.7.7.201606060606</version>
+ <configuration>
+ <dumpOnExit>true</dumpOnExit>
+ </configuration>
+ <executions>
+ <execution>
+ <id>jacoco-initialize-unit-tests</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <destFile>${project.build.directory}/coverage-reports/jacoco.exec
+ </destFile>
+ <!-- <append>true</append> -->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- This plugin adds the generated sources directory to the clean lifecycle
+ so that automatically generated code will get cleaned up properly. -->
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${generatedSourceDir}</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <distributionManagement>
+ <repository>
+ <id>ecomp-releases</id>
+ <name>ECOMP Release Repository</name>
+ <url>${nexusproxy}/content/repositories/releases/</url>
+ </repository>
+ <snapshotRepository>
+ <id>ecomp-snapshots</id>
+ <name>ECOMP Snapshot Repository</name>
+ <url>${nexusproxy}/content/repositories/snapshots/</url>
+ </snapshotRepository>
+ <site>
+ <id>ecomp-javadoc</id>
+ <url>dav:https://ecomp-nexus:8443/repository/aai/search-data-service-javadoc/${project.version}</url>
+ </site>
+ </distributionManagement>
+</project>
diff --git a/src/main/bin/start.sh b/search-data-service/src/main/bin/start.sh
index 5248a7a..5248a7a 100644
--- a/src/main/bin/start.sh
+++ b/search-data-service/src/main/bin/start.sh
diff --git a/src/main/docker/Dockerfile b/search-data-service/src/main/docker/Dockerfile
index ad402b2..1a70fd7 100644
--- a/src/main/docker/Dockerfile
+++ b/search-data-service/src/main/docker/Dockerfile
@@ -14,7 +14,7 @@ RUN export JAVA_HOME
# Build up the deployment folder structure
RUN mkdir -p $MICRO_HOME
RUN mkdir -p $MICRO_HOME/bundleconfig/etc
-ADD search-data-service* $MICRO_HOME/
+ADD *.jar $MICRO_HOME/
RUN mkdir -p $BIN_HOME
COPY *.sh $BIN_HOME
COPY bundleconfig-local $MICRO_HOME/bundleconfig
diff --git a/src/main/java/org/onap/aai/sa/Application.java b/search-data-service/src/main/java/org/onap/aai/sa/Application.java
index 059ca22..ad52dfd 100644
--- a/src/main/java/org/onap/aai/sa/Application.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/Application.java
@@ -1,58 +1,58 @@
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.aai.sa;
-
-import java.util.HashMap;
-import org.eclipse.jetty.util.security.Password;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.web.support.SpringBootServletInitializer;
-
-@SpringBootApplication
-public class Application extends SpringBootServletInitializer {
-
- public static void main(String[] args) {
- String keyStorePassword = System.getProperty("KEY_STORE_PASSWORD");
- if (keyStorePassword == null || keyStorePassword.isEmpty()) {
- throw new RuntimeException("Env property KEY_STORE_PASSWORD not set");
- }
- HashMap<String, Object> props = new HashMap<>();
- String deobfuscatedKeyStorePassword = keyStorePassword.startsWith("OBF:") ? Password.deobfuscate(keyStorePassword) : keyStorePassword;
- props.put("server.ssl.key-store-password", deobfuscatedKeyStorePassword);
-
- String trustStoreLocation = System.getProperty("TRUST_STORE_LOCATION");
- String trustStorePassword = System.getProperty("TRUST_STORE_PASSWORD");
- if (trustStoreLocation != null && trustStorePassword != null) {
- trustStorePassword = trustStorePassword.startsWith("OBF:") ? Password.deobfuscate(trustStorePassword) : trustStorePassword;
- props.put("server.ssl.trust-store", trustStoreLocation);
- props.put("server.ssl.trust-store-password", trustStorePassword);
- }
-
- String requireClientAuth = System.getenv("REQUIRE_CLIENT_AUTH");
- if (requireClientAuth == null || requireClientAuth.isEmpty()) {
- props.put("server.ssl.client-auth", "need");
- }else {
- props.put("server.ssl.client-auth", Boolean.valueOf(requireClientAuth)? "need" : "want");
- }
-
- new Application().configure(new SpringApplicationBuilder(Application.class).properties(props)).run(args);
- }
-}
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sa;
+
+import java.util.HashMap;
+import org.eclipse.jetty.util.security.Password;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.support.SpringBootServletInitializer;
+
+@SpringBootApplication
+public class Application extends SpringBootServletInitializer {
+
+ public static void main(String[] args) {
+ String keyStorePassword = System.getProperty("KEY_STORE_PASSWORD");
+ if (keyStorePassword == null || keyStorePassword.isEmpty()) {
+ throw new RuntimeException("Env property KEY_STORE_PASSWORD not set");
+ }
+ HashMap<String, Object> props = new HashMap<>();
+ String deobfuscatedKeyStorePassword = keyStorePassword.startsWith("OBF:") ? Password.deobfuscate(keyStorePassword) : keyStorePassword;
+ props.put("server.ssl.key-store-password", deobfuscatedKeyStorePassword);
+
+ String trustStoreLocation = System.getProperty("TRUST_STORE_LOCATION");
+ String trustStorePassword = System.getProperty("TRUST_STORE_PASSWORD");
+ if (trustStoreLocation != null && trustStorePassword != null) {
+ trustStorePassword = trustStorePassword.startsWith("OBF:") ? Password.deobfuscate(trustStorePassword) : trustStorePassword;
+ props.put("server.ssl.trust-store", trustStoreLocation);
+ props.put("server.ssl.trust-store-password", trustStorePassword);
+ }
+
+ String requireClientAuth = System.getenv("REQUIRE_CLIENT_AUTH");
+ if (requireClientAuth == null || requireClientAuth.isEmpty()) {
+ props.put("server.ssl.client-auth", "need");
+ }else {
+ props.put("server.ssl.client-auth", Boolean.valueOf(requireClientAuth)? "need" : "want");
+ }
+
+ new Application().configure(new SpringApplicationBuilder(Application.class).properties(props)).run(args);
+ }
+}
diff --git a/src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuth.java b/search-data-service/src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuth.java
index 199b5ec..199b5ec 100644
--- a/src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuth.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuth.java
diff --git a/src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuthCore.java b/search-data-service/src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuthCore.java
index 5bab0c0..5bab0c0 100644
--- a/src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuthCore.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/auth/SearchDbServiceAuthCore.java
diff --git a/src/main/java/org/onap/aai/sa/rest/AnalysisConfiguration.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/AnalysisConfiguration.java
index 0b8947e..0b8947e 100644
--- a/src/main/java/org/onap/aai/sa/rest/AnalysisConfiguration.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/AnalysisConfiguration.java
diff --git a/src/main/java/org/onap/aai/sa/rest/AnalyzerApi.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/AnalyzerApi.java
index 3971920..3971920 100644
--- a/src/main/java/org/onap/aai/sa/rest/AnalyzerApi.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/AnalyzerApi.java
diff --git a/src/main/java/org/onap/aai/sa/rest/ApiUtils.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/ApiUtils.java
index db2fb93..db2fb93 100644
--- a/src/main/java/org/onap/aai/sa/rest/ApiUtils.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/ApiUtils.java
diff --git a/src/main/java/org/onap/aai/sa/rest/BulkApi.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/BulkApi.java
index 810f718..810f718 100644
--- a/src/main/java/org/onap/aai/sa/rest/BulkApi.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/BulkApi.java
diff --git a/src/main/java/org/onap/aai/sa/rest/BulkMetaData.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/BulkMetaData.java
index 7c096a6..7c096a6 100644
--- a/src/main/java/org/onap/aai/sa/rest/BulkMetaData.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/BulkMetaData.java
diff --git a/src/main/java/org/onap/aai/sa/rest/BulkOperation.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/BulkOperation.java
index 1490f97..1490f97 100644
--- a/src/main/java/org/onap/aai/sa/rest/BulkOperation.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/BulkOperation.java
diff --git a/src/main/java/org/onap/aai/sa/rest/BulkRequest.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/BulkRequest.java
index 1f8b50e..1f8b50e 100644
--- a/src/main/java/org/onap/aai/sa/rest/BulkRequest.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/BulkRequest.java
diff --git a/src/main/java/org/onap/aai/sa/rest/Document.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/Document.java
index e9bcaf4..e9bcaf4 100644
--- a/src/main/java/org/onap/aai/sa/rest/Document.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/Document.java
diff --git a/src/main/java/org/onap/aai/sa/rest/DocumentApi.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/DocumentApi.java
index da8be98..da8be98 100644
--- a/src/main/java/org/onap/aai/sa/rest/DocumentApi.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/DocumentApi.java
diff --git a/src/main/java/org/onap/aai/sa/rest/IndexApi.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/IndexApi.java
index 04fbcf3..04fbcf3 100644
--- a/src/main/java/org/onap/aai/sa/rest/IndexApi.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/IndexApi.java
diff --git a/src/main/java/org/onap/aai/sa/rest/SearchServiceApi.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/SearchServiceApi.java
index d62bfd6..d62bfd6 100644
--- a/src/main/java/org/onap/aai/sa/rest/SearchServiceApi.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/SearchServiceApi.java
diff --git a/src/main/java/org/onap/aai/sa/rest/SettingConfiguration.java b/search-data-service/src/main/java/org/onap/aai/sa/rest/SettingConfiguration.java
index 74e46f4..74e46f4 100644
--- a/src/main/java/org/onap/aai/sa/rest/SettingConfiguration.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/rest/SettingConfiguration.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/RestEchoService.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/RestEchoService.java
index 96929c7..96929c7 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/RestEchoService.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/RestEchoService.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfig.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfig.java
index 4680ded..4680ded 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfig.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfig.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntity.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntity.java
index 3d95a1b..3d95a1b 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntity.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntity.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntityImpl.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntityImpl.java
index 413dbb4..413dbb4 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntityImpl.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreDataEntityImpl.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreInterface.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreInterface.java
index 5ea37e1..5ea37e1 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreInterface.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/DocumentStoreInterface.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchBulkOperationResult.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchBulkOperationResult.java
index 23181df..23181df 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchBulkOperationResult.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchBulkOperationResult.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchCause.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchCause.java
index ee12494..ee12494 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchCause.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchCause.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchError.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchError.java
index 1880168..1880168 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchError.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchError.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpController.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpController.java
index a4af160..a4af160 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpController.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpController.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpsController.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpsController.java
index 51b8952..51b8952 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpsController.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpsController.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchOperationStatus.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchOperationStatus.java
index 6374716..6374716 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchOperationStatus.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchOperationStatus.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItem.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItem.java
index 151e02b..151e02b 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItem.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItem.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchShardStatus.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchShardStatus.java
index e846a38..e846a38 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchShardStatus.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchShardStatus.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/exception/DocumentStoreOperationException.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/exception/DocumentStoreOperationException.java
index 7db6c4e..7db6c4e 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/exception/DocumentStoreOperationException.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/exception/DocumentStoreOperationException.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationBucket.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationBucket.java
index ae0a3e9..ae0a3e9 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationBucket.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationBucket.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResult.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResult.java
index 923afbf..923afbf 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResult.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResult.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResults.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResults.java
index f8f3ed3..f8f3ed3 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResults.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResults.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/Document.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/Document.java
index 8b7df43..8b7df43 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/Document.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/Document.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/DocumentOperationResult.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/DocumentOperationResult.java
index 9775446..9775446 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/DocumentOperationResult.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/DocumentOperationResult.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/ErrorResult.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/ErrorResult.java
index aa7e720..aa7e720 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/ErrorResult.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/ErrorResult.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResult.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResult.java
index 0d3a8bb..0d3a8bb 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResult.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResult.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResultBuilder.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResultBuilder.java
index 32b1d0c..32b1d0c 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResultBuilder.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResultBuilder.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHit.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHit.java
index 033dafe..033dafe 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHit.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHit.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHits.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHits.java
index cf4fd3a..cf4fd3a 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHits.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHits.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchOperationResult.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchOperationResult.java
index 6834d33..6834d33 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchOperationResult.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchOperationResult.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHit.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHit.java
index 4ce267d..4ce267d 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHit.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHit.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHits.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHits.java
index ecc4f25..ecc4f25 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHits.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SuggestHits.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/logging/SearchDbMsgs.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/logging/SearchDbMsgs.java
index d38de2a..d38de2a 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/logging/SearchDbMsgs.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/logging/SearchDbMsgs.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AbstractAggregation.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AbstractAggregation.java
index 29be5ea..29be5ea 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AbstractAggregation.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AbstractAggregation.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Aggregation.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Aggregation.java
index 84f0e9e..84f0e9e 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Aggregation.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Aggregation.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatement.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatement.java
index 94a091d..94a091d 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatement.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatement.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregation.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregation.java
index 96bb25d..96bb25d 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregation.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregation.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRange.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRange.java
index cd49ee7..cd49ee7 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRange.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRange.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregation.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregation.java
index a4e0cc2..a4e0cc2 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregation.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregation.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Filter.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Filter.java
index 134c660..134c660 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Filter.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Filter.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregation.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregation.java
index 69730d2..69730d2 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregation.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregation.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/ParsedQuery.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/ParsedQuery.java
index 19bc250..19bc250 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/ParsedQuery.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/ParsedQuery.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Query.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Query.java
index ee8ffdc..ee8ffdc 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Query.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Query.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryStatement.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryStatement.java
index 7764051..7764051 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryStatement.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryStatement.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQuery.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQuery.java
index 60cc9e6..60cc9e6 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQuery.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQuery.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatement.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatement.java
index d14f8df..d14f8df 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatement.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatement.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Sort.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Sort.java
index 104c4b0..104c4b0 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Sort.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/Sort.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SuggestionStatement.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SuggestionStatement.java
index 2002748..2002748 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SuggestionStatement.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/SuggestionStatement.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQuery.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQuery.java
index b8afa7e..b8afa7e 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQuery.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQuery.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/service/SearchService.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/service/SearchService.java
index 3c4110b..3c4110b 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/service/SearchService.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/service/SearchService.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/util/AggregationParsingUtil.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/AggregationParsingUtil.java
index b48588f..b48588f 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/util/AggregationParsingUtil.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/AggregationParsingUtil.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/util/DocumentSchemaUtil.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/DocumentSchemaUtil.java
index ebc7ae9..ebc7ae9 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/util/DocumentSchemaUtil.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/DocumentSchemaUtil.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslator.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslator.java
index d3dd3e1..d3dd3e1 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslator.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslator.java
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/util/SearchDbConstants.java b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/SearchDbConstants.java
index fd63741..fd63741 100644
--- a/src/main/java/org/onap/aai/sa/searchdbabstraction/util/SearchDbConstants.java
+++ b/search-data-service/src/main/java/org/onap/aai/sa/searchdbabstraction/util/SearchDbConstants.java
diff --git a/src/main/resources/application.properties b/search-data-service/src/main/resources/application.properties
index 7d169a7..ae8f9c3 100644
--- a/src/main/resources/application.properties
+++ b/search-data-service/src/main/resources/application.properties
@@ -1,4 +1,4 @@
-server.ssl.key-store=/opt/app/search-data-service/config/auth/tomcat_keystore
-server.ssl.enabled=true
-server.port=9509
-server.ssl.enabled-protocols=TLSv1.1,TLSv1.2
+server.ssl.key-store=/opt/app/search-data-service/config/auth/tomcat_keystore
+server.ssl.enabled=true
+server.port=9509
+server.ssl.enabled-protocols=TLSv1.1,TLSv1.2
diff --git a/src/main/resources/banner.txt b/search-data-service/src/main/resources/banner.txt
index 117d1e4..117d1e4 100644
--- a/src/main/resources/banner.txt
+++ b/search-data-service/src/main/resources/banner.txt
diff --git a/src/main/resources/json/schema/analyzer.schema.json b/search-data-service/src/main/resources/json/schema/analyzer.schema.json
index 7592ee9..7592ee9 100644
--- a/src/main/resources/json/schema/analyzer.schema.json
+++ b/search-data-service/src/main/resources/json/schema/analyzer.schema.json
diff --git a/src/main/resources/json/schema/document-field.schema.json b/search-data-service/src/main/resources/json/schema/document-field.schema.json
index 78d6cba..78d6cba 100644
--- a/src/main/resources/json/schema/document-field.schema.json
+++ b/search-data-service/src/main/resources/json/schema/document-field.schema.json
diff --git a/src/main/resources/json/schema/document.schema.json b/search-data-service/src/main/resources/json/schema/document.schema.json
index bbf3e50..bbf3e50 100644
--- a/src/main/resources/json/schema/document.schema.json
+++ b/search-data-service/src/main/resources/json/schema/document.schema.json
diff --git a/src/main/resources/json/schema/filter.schema.json b/search-data-service/src/main/resources/json/schema/filter.schema.json
index 6d1a030..6d1a030 100644
--- a/src/main/resources/json/schema/filter.schema.json
+++ b/search-data-service/src/main/resources/json/schema/filter.schema.json
diff --git a/src/main/resources/logging/SearchDbMsgs.properties b/search-data-service/src/main/resources/logging/SearchDbMsgs.properties
index 3e8de80..3e8de80 100644
--- a/src/main/resources/logging/SearchDbMsgs.properties
+++ b/search-data-service/src/main/resources/logging/SearchDbMsgs.properties
diff --git a/src/test/java/org/onap/aai/sa/auth/SearchDbServiceAuthTest.java b/search-data-service/src/test/java/org/onap/aai/sa/auth/SearchDbServiceAuthTest.java
index a4b5395..97e928e 100644
--- a/src/test/java/org/onap/aai/sa/auth/SearchDbServiceAuthTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/auth/SearchDbServiceAuthTest.java
@@ -1,86 +1,86 @@
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.aai.sa.auth;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.onap.aai.sa.searchdbabstraction.util.SearchDbConstants;
-import org.springframework.http.HttpHeaders;
-
-// import javax.servlet.http.Cookie;
-
-public class SearchDbServiceAuthTest {
-
- @Mock
- HttpHeaders headers;
-
- // @Mock
- // Cookie mockedCookie;
-
- @Before
- public void setUp() throws NoSuchFieldException, IllegalAccessException, IOException {
- MockitoAnnotations.initMocks(this);
- System.setProperty("AJSC_HOME", new File(".").getCanonicalPath().replace('\\', '/'));
- setFinalStatic(System.getProperty("AJSC_HOME") + "/src/test/resources/json/search_policy.json");
- }
-
- @Test
- public void testAuthUser() {
- SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();
- String auth = aaiAuth.authUser(headers, "user-1", "function-1");
- Assert.assertEquals(auth, "AAI_9101");
- }
-
- // @Test
- // public void testAuthCookie_NullCookie(){
- // SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();
- // Cookie cookie = null;
- // Assert.assertFalse(aaiAuth.authCookie(cookie, "function-1", new StringBuilder("user-1")));
- // }
-
- // @Test
- // public void testAuthCookie_NotNullCookie(){
- // SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();
- // Cookie cookie = new Cookie ( "TestCookie", "TestValue");
- // // Cookie cookie = new Cookie ( "TestCookie", "TestValue" );
- // boolean retValue = aaiAuth.authCookie(cookie, "GET:testFunction", new StringBuilder("testuser"));
- // Assert.assertTrue(retValue);
- // }
-
- static void setFinalStatic(String fieldValue)
- throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
- Field configField = SearchDbConstants.class.getDeclaredField("SDB_AUTH_CONFIG_FILENAME");
- configField.setAccessible(true);
-
- Field modifiersField = Field.class.getDeclaredField("modifiers");
- modifiersField.setAccessible(true);
- modifiersField.setInt(configField, configField.getModifiers() & ~Modifier.FINAL);
-
- configField.set(null, fieldValue);
- }
-}
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sa.auth;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.onap.aai.sa.searchdbabstraction.util.SearchDbConstants;
+import org.springframework.http.HttpHeaders;
+
+// import javax.servlet.http.Cookie;
+
+public class SearchDbServiceAuthTest {
+
+ @Mock
+ HttpHeaders headers;
+
+ // @Mock
+ // Cookie mockedCookie;
+
+ @Before
+ public void setUp() throws NoSuchFieldException, IllegalAccessException, IOException {
+ MockitoAnnotations.initMocks(this);
+ System.setProperty("AJSC_HOME", new File(".").getCanonicalPath().replace('\\', '/'));
+ setFinalStatic(System.getProperty("AJSC_HOME") + "/src/test/resources/json/search_policy.json");
+ }
+
+ @Test
+ public void testAuthUser() {
+ SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();
+ String auth = aaiAuth.authUser(headers, "user-1", "function-1");
+ Assert.assertEquals(auth, "AAI_9101");
+ }
+
+ // @Test
+ // public void testAuthCookie_NullCookie(){
+ // SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();
+ // Cookie cookie = null;
+ // Assert.assertFalse(aaiAuth.authCookie(cookie, "function-1", new StringBuilder("user-1")));
+ // }
+
+ // @Test
+ // public void testAuthCookie_NotNullCookie(){
+ // SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();
+ // Cookie cookie = new Cookie ( "TestCookie", "TestValue");
+ // // Cookie cookie = new Cookie ( "TestCookie", "TestValue" );
+ // boolean retValue = aaiAuth.authCookie(cookie, "GET:testFunction", new StringBuilder("testuser"));
+ // Assert.assertTrue(retValue);
+ // }
+
+ static void setFinalStatic(String fieldValue)
+ throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
+ Field configField = SearchDbConstants.class.getDeclaredField("SDB_AUTH_CONFIG_FILENAME");
+ configField.setAccessible(true);
+
+ Field modifiersField = Field.class.getDeclaredField("modifiers");
+ modifiersField.setAccessible(true);
+ modifiersField.setInt(configField, configField.getModifiers() & ~Modifier.FINAL);
+
+ configField.set(null, fieldValue);
+ }
+}
diff --git a/src/test/java/org/onap/aai/sa/rest/ApiUtilsTest.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/ApiUtilsTest.java
index df6ed0e..df6ed0e 100644
--- a/src/test/java/org/onap/aai/sa/rest/ApiUtilsTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/ApiUtilsTest.java
diff --git a/src/test/java/org/onap/aai/sa/rest/BulkApiTest.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/BulkApiTest.java
index fcc5b77..fcc5b77 100644
--- a/src/test/java/org/onap/aai/sa/rest/BulkApiTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/BulkApiTest.java
diff --git a/src/test/java/org/onap/aai/sa/rest/BulkRequestTest.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/BulkRequestTest.java
index d5999b8..7d784d1 100644
--- a/src/test/java/org/onap/aai/sa/rest/BulkRequestTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/BulkRequestTest.java
@@ -1,149 +1,149 @@
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.aai.sa.rest;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureMockMvc
-public class BulkRequestTest {
-
- @Test
- public void testBulkRequest_Delete() {
- BulkRequest request = new BulkRequest();
- BulkOperation operation = new BulkOperation();
- Document document = new Document();
- BulkMetaData metaData = getMetaData();
- operation.setMetaData(metaData);
- operation.setDocument(document);
- Assert.assertNotNull(operation.getDocument());
- Assert.assertNotNull(operation.getMetaData());
- Assert.assertNotNull(operation.toString());
-
- request.setDelete(operation);
- Assert.assertNotNull(request.getDelete());
- Assert.assertEquals(operation, request.getOperation());
- Assert.assertEquals(BulkRequest.OperationType.DELETE, request.getOperationType());
- Assert.assertTrue(request.toString().contains("delete:"));
-
-
- }
-
- @Test
- public void testBulkRequest_Update() {
- BulkRequest request = new BulkRequest();
- BulkOperation operation = new BulkOperation();
- Document document = new Document();
- BulkMetaData metaData = getMetaData();
- operation.setMetaData(metaData);
- operation.setDocument(document);
- Assert.assertNotNull(operation.getDocument());
- Assert.assertNotNull(operation.getMetaData());
- Assert.assertNotNull(operation.toString());
-
- request.setUpdate(operation);
- Assert.assertNotNull(request.getUpdate());
- Assert.assertEquals(operation, request.getOperation());
- Assert.assertEquals(BulkRequest.OperationType.UPDATE, request.getOperationType());
- Assert.assertTrue(request.toString().contains("update:"));
-
- }
-
- @Test
- public void testBulkRequest_Create() {
- BulkRequest request = new BulkRequest();
- BulkOperation operation = new BulkOperation();
- Document document = new Document();
- BulkMetaData metaData = getMetaData();
- operation.setMetaData(metaData);
- operation.setDocument(document);
- Assert.assertNotNull(operation.getDocument());
- Assert.assertNotNull(operation.getMetaData());
- Assert.assertNotNull(operation.toString());
-
- request.setCreate(operation);
- Assert.assertNotNull(request.getCreate());
- Assert.assertEquals(operation, request.getOperation());
- Assert.assertEquals(BulkRequest.OperationType.CREATE, request.getOperationType());
- Assert.assertTrue(request.toString().contains("create:"));
-
- }
-
- @Test
- public void testBulkRequest_Undefined() {
- BulkRequest request = new BulkRequest();
- Assert.assertNull(request.getOperation());
- Assert.assertNull(request.getOperationType());
- Assert.assertEquals("UNDEFINED", request.toString());
- }
-
- @Test
- public void testGetIndex() {
- BulkRequest request = new BulkRequest();
- BulkOperation operation = new BulkOperation();
- BulkMetaData metaData = new BulkMetaData();
- metaData.setUrl("/test/indexes/index1");
- operation.setMetaData(metaData);
- request.setCreate(operation);
- String index = request.getIndex();
- Assert.assertEquals(index, "index1");
- }
-
- @Test
- public void testGetId() {
- BulkRequest request = new BulkRequest();
- BulkOperation operation = new BulkOperation();
- BulkMetaData metaData = new BulkMetaData();
- metaData.setUrl("/test/documents/document1");
- operation.setMetaData(metaData);
- request.setCreate(operation);
- String index = request.getId();
- Assert.assertEquals(index, "document1");
- }
-
- @Test
- public void testApiUtils() {
- Assert.assertEquals("services/search-data-service/v1/search/indexes/index1", ApiUtils.buildIndexUri("index1"));
- Assert.assertEquals("services/search-data-service/v1/search/indexes/index1/documents/document1",
- ApiUtils.buildDocumentUri("index1", "document1"));
- Assert.assertTrue(ApiUtils.validateIndexUri("services/search-data-service/v1/search/indexes/index1"));
- Assert.assertTrue(ApiUtils.validateDocumentUri(
- "services/search-data-service/v1/search/indexes/index1/documents/document1", true));
- Assert.assertTrue(ApiUtils.validateDocumentUri(
- "services/search-data-service/v1/search/indexes/index1/documents/document1", false));
- }
-
- private BulkMetaData getMetaData() {
- BulkMetaData metaData = new BulkMetaData();
- metaData.setUrl("http://127.0.0.1");
- metaData.setEtag("etag-1");
- Assert.assertEquals(metaData.getUrl(), "http://127.0.0.1");
- Assert.assertEquals(metaData.getEtag(), "etag-1");
- Assert.assertNotNull(metaData.toString());
- return metaData;
- }
-}
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sa.rest;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@AutoConfigureMockMvc
+public class BulkRequestTest {
+
+ @Test
+ public void testBulkRequest_Delete() {
+ BulkRequest request = new BulkRequest();
+ BulkOperation operation = new BulkOperation();
+ Document document = new Document();
+ BulkMetaData metaData = getMetaData();
+ operation.setMetaData(metaData);
+ operation.setDocument(document);
+ Assert.assertNotNull(operation.getDocument());
+ Assert.assertNotNull(operation.getMetaData());
+ Assert.assertNotNull(operation.toString());
+
+ request.setDelete(operation);
+ Assert.assertNotNull(request.getDelete());
+ Assert.assertEquals(operation, request.getOperation());
+ Assert.assertEquals(BulkRequest.OperationType.DELETE, request.getOperationType());
+ Assert.assertTrue(request.toString().contains("delete:"));
+
+
+ }
+
+ @Test
+ public void testBulkRequest_Update() {
+ BulkRequest request = new BulkRequest();
+ BulkOperation operation = new BulkOperation();
+ Document document = new Document();
+ BulkMetaData metaData = getMetaData();
+ operation.setMetaData(metaData);
+ operation.setDocument(document);
+ Assert.assertNotNull(operation.getDocument());
+ Assert.assertNotNull(operation.getMetaData());
+ Assert.assertNotNull(operation.toString());
+
+ request.setUpdate(operation);
+ Assert.assertNotNull(request.getUpdate());
+ Assert.assertEquals(operation, request.getOperation());
+ Assert.assertEquals(BulkRequest.OperationType.UPDATE, request.getOperationType());
+ Assert.assertTrue(request.toString().contains("update:"));
+
+ }
+
+ @Test
+ public void testBulkRequest_Create() {
+ BulkRequest request = new BulkRequest();
+ BulkOperation operation = new BulkOperation();
+ Document document = new Document();
+ BulkMetaData metaData = getMetaData();
+ operation.setMetaData(metaData);
+ operation.setDocument(document);
+ Assert.assertNotNull(operation.getDocument());
+ Assert.assertNotNull(operation.getMetaData());
+ Assert.assertNotNull(operation.toString());
+
+ request.setCreate(operation);
+ Assert.assertNotNull(request.getCreate());
+ Assert.assertEquals(operation, request.getOperation());
+ Assert.assertEquals(BulkRequest.OperationType.CREATE, request.getOperationType());
+ Assert.assertTrue(request.toString().contains("create:"));
+
+ }
+
+ @Test
+ public void testBulkRequest_Undefined() {
+ BulkRequest request = new BulkRequest();
+ Assert.assertNull(request.getOperation());
+ Assert.assertNull(request.getOperationType());
+ Assert.assertEquals("UNDEFINED", request.toString());
+ }
+
+ @Test
+ public void testGetIndex() {
+ BulkRequest request = new BulkRequest();
+ BulkOperation operation = new BulkOperation();
+ BulkMetaData metaData = new BulkMetaData();
+ metaData.setUrl("/test/indexes/index1");
+ operation.setMetaData(metaData);
+ request.setCreate(operation);
+ String index = request.getIndex();
+ Assert.assertEquals(index, "index1");
+ }
+
+ @Test
+ public void testGetId() {
+ BulkRequest request = new BulkRequest();
+ BulkOperation operation = new BulkOperation();
+ BulkMetaData metaData = new BulkMetaData();
+ metaData.setUrl("/test/documents/document1");
+ operation.setMetaData(metaData);
+ request.setCreate(operation);
+ String index = request.getId();
+ Assert.assertEquals(index, "document1");
+ }
+
+ @Test
+ public void testApiUtils() {
+ Assert.assertEquals("services/search-data-service/v1/search/indexes/index1", ApiUtils.buildIndexUri("index1"));
+ Assert.assertEquals("services/search-data-service/v1/search/indexes/index1/documents/document1",
+ ApiUtils.buildDocumentUri("index1", "document1"));
+ Assert.assertTrue(ApiUtils.validateIndexUri("services/search-data-service/v1/search/indexes/index1"));
+ Assert.assertTrue(ApiUtils.validateDocumentUri(
+ "services/search-data-service/v1/search/indexes/index1/documents/document1", true));
+ Assert.assertTrue(ApiUtils.validateDocumentUri(
+ "services/search-data-service/v1/search/indexes/index1/documents/document1", false));
+ }
+
+ private BulkMetaData getMetaData() {
+ BulkMetaData metaData = new BulkMetaData();
+ metaData.setUrl("http://127.0.0.1");
+ metaData.setEtag("etag-1");
+ Assert.assertEquals(metaData.getUrl(), "http://127.0.0.1");
+ Assert.assertEquals(metaData.getEtag(), "etag-1");
+ Assert.assertNotNull(metaData.toString());
+ return metaData;
+ }
+}
diff --git a/src/test/java/org/onap/aai/sa/rest/DocumentApiTest.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/DocumentApiTest.java
index 865f981..865f981 100644
--- a/src/test/java/org/onap/aai/sa/rest/DocumentApiTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/DocumentApiTest.java
diff --git a/src/test/java/org/onap/aai/sa/rest/DocumentSchemaTest.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/DocumentSchemaTest.java
index c2d5021..c2d5021 100644
--- a/src/test/java/org/onap/aai/sa/rest/DocumentSchemaTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/DocumentSchemaTest.java
diff --git a/src/test/java/org/onap/aai/sa/rest/DocumentTest.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/DocumentTest.java
index e780e3b..e4cf335 100644
--- a/src/test/java/org/onap/aai/sa/rest/DocumentTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/DocumentTest.java
@@ -1,727 +1,727 @@
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.aai.sa.rest;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-// import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MultivaluedMap;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-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.DocumentStoreInterface;
-import org.onap.aai.sa.searchdbabstraction.elasticsearch.dao.ElasticSearchHttpController;
-import org.onap.aai.sa.searchdbabstraction.elasticsearch.exception.DocumentStoreOperationException;
-import org.onap.aai.sa.searchdbabstraction.entity.DocumentOperationResult;
-import org.onap.aai.sa.searchdbabstraction.entity.ErrorResult;
-import org.onap.aai.sa.searchdbabstraction.entity.SearchHits;
-import org.onap.aai.sa.searchdbabstraction.entity.SearchOperationResult;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import java.util.Properties;
-
-
-public class DocumentTest {
-
- @Mock
- SearchServiceApi searchServiceApi;
-
- @Mock
- HttpServletRequest request;
-
- @Mock
- HttpHeaders headers;
-
- @Mock
- HttpServletResponse httpResponse;
-
- @Mock
- DocumentStoreInterface documentStore;
-
- @Mock
- MultivaluedMap<String, String> multivaluedMap;
-
- @InjectMocks
- IndexApi indexApi;
-
- DocumentApi documentApi;
-
- @Mock
- ElasticSearchHttpController httpController;
-
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
- documentApi = new DocumentApi(searchServiceApi);
- }
-
- @Test
- public void testDocumentClass_AllMethods() throws JsonProcessingException {
- Document doc = new Document();
- doc.setField("name-1", "value-1");
- Assert.assertTrue(doc.getFields().size() == 1);
- Assert.assertTrue(doc.toJson().contains("value-1"));
- Assert.assertNotNull(doc.toString());
- Assert.assertTrue(doc.toString().contains("name-1"));
- }
-
- @Test
- public void testProcessPost_NullContent() {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = null;
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- ResponseEntity<String> response =
- documentApi.processPost(content, request, headers, httpResponse, "index", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.BAD_REQUEST.value() == response.getStatusCodeValue());
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testProcessPost_NotNullContent() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenThrow(IllegalArgumentException.class);
- ResponseEntity<?> response =
- documentApi.processPost(content, request, headers, httpResponse, "index", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- //
- @Test
- public void testProcessPost_ValidRequest() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- DocumentOperationResult result = new DocumentOperationResult();
- result.setResultCode(150);
- result.setError(new ErrorResult("type-1", "reason-1"));
- result.setFailureCause("test-failure");
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(true);
- Mockito.when(documentStore.createDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class),
- Mockito.anyBoolean())).thenReturn(result);
- Mockito.doNothing().when(httpResponse).setHeader(Mockito.anyString(), Mockito.anyString());
- ResponseEntity<String> response =
- documentApi.processPost(content, request, headers, httpResponse, "index", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.INTERNAL_SERVER_ERROR.value() == response.getStatusCodeValue());
- }
-
- //
- @Test
- public void testProcessSearchWithGet_Created() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- SearchOperationResult result = new SearchOperationResult();
- result.setResultCode(201);
- SearchHits hits = new SearchHits();
- hits.setTotalHits("2");
- result.setSearchResult(hits);
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(true);
- Mockito.when(documentStore.search(Mockito.anyString(), Mockito.anyString())).thenReturn(result);
- ResponseEntity<String> response =
- documentApi.processSearchWithGet(content, request, headers, "index-1", "query-text", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.CREATED.value() == response.getStatusCodeValue());
-
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testProcessSearchWithGet_ValidateThrowsException() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- SearchOperationResult result = new SearchOperationResult();
- result.setResultCode(201);
- SearchHits hits = new SearchHits();
- hits.setTotalHits("2");
- result.setSearchResult(hits);
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenThrow(IllegalArgumentException.class);
- Mockito.when(documentStore.search(Mockito.anyString(), Mockito.anyString())).thenReturn(result);
- ResponseEntity<String> response =
- documentApi.processSearchWithGet(content, request, headers, "index-1", "query-text", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
-
- }
-
- @Test
- public void testProcessSearchWithGet_ValidateIsFalse() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- SearchOperationResult result = new SearchOperationResult();
- result.setResultCode(201);
- SearchHits hits = new SearchHits();
- hits.setTotalHits("2");
- result.setSearchResult(hits);
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(false);
- Mockito.when(documentStore.search(Mockito.anyString(), Mockito.anyString())).thenReturn(result);
- ResponseEntity<String> response =
- documentApi.processSearchWithGet(content, request, headers, "index-1", "query-text", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
-
- }
-
- @Test
- public void testProcessSearchWithGet_InvalidResult() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- SearchOperationResult result = new SearchOperationResult();
- result.setResultCode(302);
- SearchHits hits = new SearchHits();
- hits.setTotalHits("2");
- result.setSearchResult(hits);
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(true);
- Mockito.when(documentStore.search(Mockito.anyString(), Mockito.anyString())).thenReturn(result);
- ResponseEntity<String> response =
- documentApi.processSearchWithGet(content, request, headers, "index-1", "query-text", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());
-
- }
-
- @Test
- public void testProcessPut_NullContent() {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = null;
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- ResponseEntity<String> response =
- documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.BAD_REQUEST.value() == response.getStatusCodeValue());
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testProcessPut_RequestThrowsException() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenThrow(IllegalArgumentException.class);
- ResponseEntity<String> response =
- documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testProcessPut_RequestInvalid() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(false);
- ResponseEntity<String> response =
- documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testProcessPut_ResultInvalid() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- DocumentOperationResult result = new DocumentOperationResult();
- result.setResultCode(302);
- result.setError(new ErrorResult("type-1", "reason-1"));
- result.setFailureCause("test-failure");
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(true);
- Mockito.when(documentStore.createDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class),
- Mockito.anyBoolean())).thenReturn(result);
- ResponseEntity<String> response =
- documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testProcessDelete_RequestThrowsException() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenThrow(IllegalArgumentException.class);
- ResponseEntity<String> response =
- documentApi.processDelete(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testProcessDelete_RequestInvalid() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(false);
- ResponseEntity<String> response =
- documentApi.processDelete(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @Ignore
- @Test
- public void testProcessDelete_ResultInvalid() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- DocumentOperationResult result = new DocumentOperationResult();
- result.setResultCode(302);
- result.setError(new ErrorResult("type-1", "reason-1"));
- result.setFailureCause("test-failure");
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(true);
- Mockito.when(documentStore.deleteDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class)))
- .thenReturn(result);
- ResponseEntity<String> response =
- documentApi.processDelete(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testProcessGet_RequestThrowsException() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenThrow(IllegalArgumentException.class);
- ResponseEntity<String> response =
- documentApi.processGet(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testProcessGet_RequestInvalid() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(false);
- ResponseEntity<String> response =
- documentApi.processGet(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testProcessGet_ResultInvalid() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- DocumentOperationResult result = new DocumentOperationResult();
- result.setResultCode(302);
- result.setError(new ErrorResult("type-1", "reason-1"));
- result.setFailureCause("test-failure");
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(true);
- Mockito.when(documentStore.getDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class)))
- .thenReturn(result);
- ResponseEntity<String> response =
- documentApi.processGet(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testQueryWithGetWithPayload_NullContent() {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = null;
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- ResponseEntity<String> response =
- documentApi.queryWithGetWithPayload(content, request, headers, "index-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.BAD_REQUEST.value() == response.getStatusCodeValue());
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testQueryWithGetWithPayload_RequestThrowsException() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenThrow(IllegalArgumentException.class);
- ResponseEntity<String> response =
- documentApi.queryWithGetWithPayload(content, request, headers, "index-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testQueryWithGetWithPayload_RequestInvalid() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(false);
- ResponseEntity<String> response =
- documentApi.queryWithGetWithPayload(content, request, headers, "index-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testCreateProcessIndex_IndexApi_RequestInvalid() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(false);
- ResponseEntity<String> response =
- indexApi.processCreateIndex("document-1", request, headers, "index-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testCreateProcessIndex_IndexApi_RequestThrowsException() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenThrow(IllegalArgumentException.class);
- ResponseEntity<String> response =
- indexApi.processCreateIndex("document-1", request, headers, "index-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testCreateProcessIndex_IndexApi_NullDocument() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String documentSchema = null;
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(true);
- ResponseEntity<String> response =
- indexApi.processCreateIndex(documentSchema, request, headers, "index-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.INTERNAL_SERVER_ERROR.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testProcessDelete_IndexApi_RequestInvalid() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(false);
- ResponseEntity<String> response = indexApi.processDelete("document-1", request, headers, documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testProcessDelete_IndexApi_RequestThrowsException() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenThrow(IllegalArgumentException.class);
- ResponseEntity<String> response = indexApi.processDelete("document-1", request, headers, documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testProcessDelete_IndexApi_DeleteIndexException() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenReturn(true);
- Mockito.when(documentStore.deleteIndex(Mockito.anyString())).thenThrow(DocumentStoreOperationException.class);
- ResponseEntity<String> response = indexApi.processDelete("document-1", request, headers, documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.INTERNAL_SERVER_ERROR.value() == response.getStatusCodeValue());
- }
-
- @Test
- public void testUserAuthorization() throws Exception {
- String transactionId = "transactionId-1";
- String remoteAddr = "http://127.0.0.1";
- String content = "content";
- // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
- Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
- Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
- Mockito.when(request.getMethod()).thenReturn("testMethod");
- Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
- Mockito.when(request.getRemoteHost()).thenReturn("localhost");
- Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
- Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
- .thenCallRealMethod();
-
- Mockito.doAnswer(new Answer<ElasticSearchConfig>() {
- public ElasticSearchConfig answer(InvocationOnMock invocation) {
- Properties properties = new Properties();
- return new ElasticSearchConfig(properties);
- }
- }).when(httpController).getElasticSearchConfig();
-
- searchServiceApi.documentStore = httpController;
-
- ResponseEntity<String> response =
- documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
-
- Mockito.doAnswer(new Answer<ElasticSearchConfig>() {
- public ElasticSearchConfig answer(InvocationOnMock invocation) {
- Properties properties = new Properties();
- properties.put(ElasticSearchConfig.ES_AUTH_ENABLED, "true");
- return new ElasticSearchConfig(properties);
- }
- }).when(httpController).getElasticSearchConfig();
-
-
- response = documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
-
- Mockito.doAnswer(new Answer<ElasticSearchConfig>() {
- public ElasticSearchConfig answer(InvocationOnMock invocation) {
- Properties properties = new Properties();
- properties.put(ElasticSearchConfig.ES_AUTH_ENABLED, "false");
- return new ElasticSearchConfig(properties);
- }
- }).when(httpController).getElasticSearchConfig();
-
- DocumentOperationResult result = new DocumentOperationResult();
- result.setResultCode(302);
- result.setError(new ErrorResult("type-1", "reason-1"));
- result.setFailureCause("test-failure");
- Mockito.when(documentStore.createDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class),
- Mockito.anyBoolean())).thenReturn(result);
- response = documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
- Assert.assertNotNull(response);
- Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());
-
- }
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sa.rest;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+// import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MultivaluedMap;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+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.DocumentStoreInterface;
+import org.onap.aai.sa.searchdbabstraction.elasticsearch.dao.ElasticSearchHttpController;
+import org.onap.aai.sa.searchdbabstraction.elasticsearch.exception.DocumentStoreOperationException;
+import org.onap.aai.sa.searchdbabstraction.entity.DocumentOperationResult;
+import org.onap.aai.sa.searchdbabstraction.entity.ErrorResult;
+import org.onap.aai.sa.searchdbabstraction.entity.SearchHits;
+import org.onap.aai.sa.searchdbabstraction.entity.SearchOperationResult;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import java.util.Properties;
+
+
+public class DocumentTest {
+
+ @Mock
+ SearchServiceApi searchServiceApi;
+
+ @Mock
+ HttpServletRequest request;
+
+ @Mock
+ HttpHeaders headers;
+
+ @Mock
+ HttpServletResponse httpResponse;
+
+ @Mock
+ DocumentStoreInterface documentStore;
+
+ @Mock
+ MultivaluedMap<String, String> multivaluedMap;
+
+ @InjectMocks
+ IndexApi indexApi;
+
+ DocumentApi documentApi;
+
+ @Mock
+ ElasticSearchHttpController httpController;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ documentApi = new DocumentApi(searchServiceApi);
+ }
+
+ @Test
+ public void testDocumentClass_AllMethods() throws JsonProcessingException {
+ Document doc = new Document();
+ doc.setField("name-1", "value-1");
+ Assert.assertTrue(doc.getFields().size() == 1);
+ Assert.assertTrue(doc.toJson().contains("value-1"));
+ Assert.assertNotNull(doc.toString());
+ Assert.assertTrue(doc.toString().contains("name-1"));
+ }
+
+ @Test
+ public void testProcessPost_NullContent() {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = null;
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ ResponseEntity<String> response =
+ documentApi.processPost(content, request, headers, httpResponse, "index", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.BAD_REQUEST.value() == response.getStatusCodeValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testProcessPost_NotNullContent() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenThrow(IllegalArgumentException.class);
+ ResponseEntity<?> response =
+ documentApi.processPost(content, request, headers, httpResponse, "index", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ //
+ @Test
+ public void testProcessPost_ValidRequest() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ DocumentOperationResult result = new DocumentOperationResult();
+ result.setResultCode(150);
+ result.setError(new ErrorResult("type-1", "reason-1"));
+ result.setFailureCause("test-failure");
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(true);
+ Mockito.when(documentStore.createDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class),
+ Mockito.anyBoolean())).thenReturn(result);
+ Mockito.doNothing().when(httpResponse).setHeader(Mockito.anyString(), Mockito.anyString());
+ ResponseEntity<String> response =
+ documentApi.processPost(content, request, headers, httpResponse, "index", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.INTERNAL_SERVER_ERROR.value() == response.getStatusCodeValue());
+ }
+
+ //
+ @Test
+ public void testProcessSearchWithGet_Created() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ SearchOperationResult result = new SearchOperationResult();
+ result.setResultCode(201);
+ SearchHits hits = new SearchHits();
+ hits.setTotalHits("2");
+ result.setSearchResult(hits);
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(true);
+ Mockito.when(documentStore.search(Mockito.anyString(), Mockito.anyString())).thenReturn(result);
+ ResponseEntity<String> response =
+ documentApi.processSearchWithGet(content, request, headers, "index-1", "query-text", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.CREATED.value() == response.getStatusCodeValue());
+
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testProcessSearchWithGet_ValidateThrowsException() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ SearchOperationResult result = new SearchOperationResult();
+ result.setResultCode(201);
+ SearchHits hits = new SearchHits();
+ hits.setTotalHits("2");
+ result.setSearchResult(hits);
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenThrow(IllegalArgumentException.class);
+ Mockito.when(documentStore.search(Mockito.anyString(), Mockito.anyString())).thenReturn(result);
+ ResponseEntity<String> response =
+ documentApi.processSearchWithGet(content, request, headers, "index-1", "query-text", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+
+ }
+
+ @Test
+ public void testProcessSearchWithGet_ValidateIsFalse() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ SearchOperationResult result = new SearchOperationResult();
+ result.setResultCode(201);
+ SearchHits hits = new SearchHits();
+ hits.setTotalHits("2");
+ result.setSearchResult(hits);
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(false);
+ Mockito.when(documentStore.search(Mockito.anyString(), Mockito.anyString())).thenReturn(result);
+ ResponseEntity<String> response =
+ documentApi.processSearchWithGet(content, request, headers, "index-1", "query-text", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+
+ }
+
+ @Test
+ public void testProcessSearchWithGet_InvalidResult() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ SearchOperationResult result = new SearchOperationResult();
+ result.setResultCode(302);
+ SearchHits hits = new SearchHits();
+ hits.setTotalHits("2");
+ result.setSearchResult(hits);
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(true);
+ Mockito.when(documentStore.search(Mockito.anyString(), Mockito.anyString())).thenReturn(result);
+ ResponseEntity<String> response =
+ documentApi.processSearchWithGet(content, request, headers, "index-1", "query-text", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());
+
+ }
+
+ @Test
+ public void testProcessPut_NullContent() {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = null;
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ ResponseEntity<String> response =
+ documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.BAD_REQUEST.value() == response.getStatusCodeValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testProcessPut_RequestThrowsException() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenThrow(IllegalArgumentException.class);
+ ResponseEntity<String> response =
+ documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testProcessPut_RequestInvalid() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(false);
+ ResponseEntity<String> response =
+ documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testProcessPut_ResultInvalid() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ DocumentOperationResult result = new DocumentOperationResult();
+ result.setResultCode(302);
+ result.setError(new ErrorResult("type-1", "reason-1"));
+ result.setFailureCause("test-failure");
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(true);
+ Mockito.when(documentStore.createDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class),
+ Mockito.anyBoolean())).thenReturn(result);
+ ResponseEntity<String> response =
+ documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testProcessDelete_RequestThrowsException() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenThrow(IllegalArgumentException.class);
+ ResponseEntity<String> response =
+ documentApi.processDelete(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testProcessDelete_RequestInvalid() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(false);
+ ResponseEntity<String> response =
+ documentApi.processDelete(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @Ignore
+ @Test
+ public void testProcessDelete_ResultInvalid() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ DocumentOperationResult result = new DocumentOperationResult();
+ result.setResultCode(302);
+ result.setError(new ErrorResult("type-1", "reason-1"));
+ result.setFailureCause("test-failure");
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(true);
+ Mockito.when(documentStore.deleteDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class)))
+ .thenReturn(result);
+ ResponseEntity<String> response =
+ documentApi.processDelete(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testProcessGet_RequestThrowsException() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenThrow(IllegalArgumentException.class);
+ ResponseEntity<String> response =
+ documentApi.processGet(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testProcessGet_RequestInvalid() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(false);
+ ResponseEntity<String> response =
+ documentApi.processGet(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testProcessGet_ResultInvalid() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ DocumentOperationResult result = new DocumentOperationResult();
+ result.setResultCode(302);
+ result.setError(new ErrorResult("type-1", "reason-1"));
+ result.setFailureCause("test-failure");
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(true);
+ Mockito.when(documentStore.getDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class)))
+ .thenReturn(result);
+ ResponseEntity<String> response =
+ documentApi.processGet(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testQueryWithGetWithPayload_NullContent() {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = null;
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ ResponseEntity<String> response =
+ documentApi.queryWithGetWithPayload(content, request, headers, "index-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.BAD_REQUEST.value() == response.getStatusCodeValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testQueryWithGetWithPayload_RequestThrowsException() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenThrow(IllegalArgumentException.class);
+ ResponseEntity<String> response =
+ documentApi.queryWithGetWithPayload(content, request, headers, "index-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testQueryWithGetWithPayload_RequestInvalid() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(false);
+ ResponseEntity<String> response =
+ documentApi.queryWithGetWithPayload(content, request, headers, "index-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testCreateProcessIndex_IndexApi_RequestInvalid() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(false);
+ ResponseEntity<String> response =
+ indexApi.processCreateIndex("document-1", request, headers, "index-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testCreateProcessIndex_IndexApi_RequestThrowsException() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenThrow(IllegalArgumentException.class);
+ ResponseEntity<String> response =
+ indexApi.processCreateIndex("document-1", request, headers, "index-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testCreateProcessIndex_IndexApi_NullDocument() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String documentSchema = null;
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(true);
+ ResponseEntity<String> response =
+ indexApi.processCreateIndex(documentSchema, request, headers, "index-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.INTERNAL_SERVER_ERROR.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testProcessDelete_IndexApi_RequestInvalid() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(false);
+ ResponseEntity<String> response = indexApi.processDelete("document-1", request, headers, documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testProcessDelete_IndexApi_RequestThrowsException() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenThrow(IllegalArgumentException.class);
+ ResponseEntity<String> response = indexApi.processDelete("document-1", request, headers, documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testProcessDelete_IndexApi_DeleteIndexException() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenReturn(true);
+ Mockito.when(documentStore.deleteIndex(Mockito.anyString())).thenThrow(DocumentStoreOperationException.class);
+ ResponseEntity<String> response = indexApi.processDelete("document-1", request, headers, documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.INTERNAL_SERVER_ERROR.value() == response.getStatusCodeValue());
+ }
+
+ @Test
+ public void testUserAuthorization() throws Exception {
+ String transactionId = "transactionId-1";
+ String remoteAddr = "http://127.0.0.1";
+ String content = "content";
+ // Mockito.when(headers.getRequestHeaders()).thenReturn(multivaluedMap);;
+ Mockito.when(multivaluedMap.getFirst(Mockito.anyString())).thenReturn(transactionId);
+ Mockito.when(request.getRemoteAddr()).thenReturn(remoteAddr);
+ Mockito.when(request.getMethod()).thenReturn("testMethod");
+ Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("http://127.0.0.1"));
+ Mockito.when(request.getRemoteHost()).thenReturn("localhost");
+ Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),
+ Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))
+ .thenCallRealMethod();
+
+ Mockito.doAnswer(new Answer<ElasticSearchConfig>() {
+ public ElasticSearchConfig answer(InvocationOnMock invocation) {
+ Properties properties = new Properties();
+ return new ElasticSearchConfig(properties);
+ }
+ }).when(httpController).getElasticSearchConfig();
+
+ searchServiceApi.documentStore = httpController;
+
+ ResponseEntity<String> response =
+ documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+
+ Mockito.doAnswer(new Answer<ElasticSearchConfig>() {
+ public ElasticSearchConfig answer(InvocationOnMock invocation) {
+ Properties properties = new Properties();
+ properties.put(ElasticSearchConfig.ES_AUTH_ENABLED, "true");
+ return new ElasticSearchConfig(properties);
+ }
+ }).when(httpController).getElasticSearchConfig();
+
+
+ response = documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());
+
+ Mockito.doAnswer(new Answer<ElasticSearchConfig>() {
+ public ElasticSearchConfig answer(InvocationOnMock invocation) {
+ Properties properties = new Properties();
+ properties.put(ElasticSearchConfig.ES_AUTH_ENABLED, "false");
+ return new ElasticSearchConfig(properties);
+ }
+ }).when(httpController).getElasticSearchConfig();
+
+ DocumentOperationResult result = new DocumentOperationResult();
+ result.setResultCode(302);
+ result.setError(new ErrorResult("type-1", "reason-1"));
+ result.setFailureCause("test-failure");
+ Mockito.when(documentStore.createDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class),
+ Mockito.anyBoolean())).thenReturn(result);
+ response = documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);
+ Assert.assertNotNull(response);
+ Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());
+
+ }
} \ No newline at end of file
diff --git a/src/test/java/org/onap/aai/sa/rest/IndexApiTest.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/IndexApiTest.java
index ed84a7a..ed84a7a 100644
--- a/src/test/java/org/onap/aai/sa/rest/IndexApiTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/IndexApiTest.java
diff --git a/src/test/java/org/onap/aai/sa/rest/SearchServiceApiHarness.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/SearchServiceApiHarness.java
index 93e1d49..93e1d49 100644
--- a/src/test/java/org/onap/aai/sa/rest/SearchServiceApiHarness.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/SearchServiceApiHarness.java
diff --git a/src/test/java/org/onap/aai/sa/rest/SettingConfigurationTest.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/SettingConfigurationTest.java
index 9cc4e3b..9cc4e3b 100644
--- a/src/test/java/org/onap/aai/sa/rest/SettingConfigurationTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/SettingConfigurationTest.java
diff --git a/src/test/java/org/onap/aai/sa/rest/StubEsController.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/StubEsController.java
index cb4edbc..cb4edbc 100644
--- a/src/test/java/org/onap/aai/sa/rest/StubEsController.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/StubEsController.java
diff --git a/src/test/java/org/onap/aai/sa/rest/TestUtils.java b/search-data-service/src/test/java/org/onap/aai/sa/rest/TestUtils.java
index 0d2c615..0d2c615 100644
--- a/src/test/java/org/onap/aai/sa/rest/TestUtils.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/rest/TestUtils.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfigTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfigTest.java
index b976f17..e840e2c 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfigTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfigTest.java
@@ -1,53 +1,53 @@
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.aai.sa.searchdbabstraction.elasticsearch.config;
-
-import java.util.Properties;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class ElasticSearchConfigTest {
-
- @Autowired
- ElasticSearchConfig elasticSearchConfig;
-
- @Before
- public void setUp() {
- Properties prop = new Properties();
- prop.put("es.cluster-name", "cluster-1");
- prop.put("es.ip-address", "127.0.0.1");
- prop.put("es.http-port", "9001");
- // elasticSearchConfig = new ElasticSearchConfig(prop);
- }
-
- @Ignore
- @Test
- public void testAllGetMethods() {
- Assert.assertEquals(elasticSearchConfig.getClusterName(), "cluster-1");
- Assert.assertEquals(elasticSearchConfig.getIpAddress(), "127.0.0.1");
- Assert.assertEquals(elasticSearchConfig.getHttpPort(), "9001");
- Assert.assertEquals(elasticSearchConfig.getJavaApiPort(), "9300");
- Assert.assertNotNull(elasticSearchConfig.toString());
- }
-}
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sa.searchdbabstraction.elasticsearch.config;
+
+import java.util.Properties;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class ElasticSearchConfigTest {
+
+ @Autowired
+ ElasticSearchConfig elasticSearchConfig;
+
+ @Before
+ public void setUp() {
+ Properties prop = new Properties();
+ prop.put("es.cluster-name", "cluster-1");
+ prop.put("es.ip-address", "127.0.0.1");
+ prop.put("es.http-port", "9001");
+ // elasticSearchConfig = new ElasticSearchConfig(prop);
+ }
+
+ @Ignore
+ @Test
+ public void testAllGetMethods() {
+ Assert.assertEquals(elasticSearchConfig.getClusterName(), "cluster-1");
+ Assert.assertEquals(elasticSearchConfig.getIpAddress(), "127.0.0.1");
+ Assert.assertEquals(elasticSearchConfig.getHttpPort(), "9001");
+ Assert.assertEquals(elasticSearchConfig.getJavaApiPort(), "9300");
+ Assert.assertNotNull(elasticSearchConfig.toString());
+ }
+}
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/AggregationResponseParsingTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/AggregationResponseParsingTest.java
index fbc077d..fbc077d 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/AggregationResponseParsingTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/AggregationResponseParsingTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpControllerTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpControllerTest.java
index 007e3fc..007e3fc 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpControllerTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchHttpControllerTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItemTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItemTest.java
index 43203c9..eef7742 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItemTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/dao/ElasticSearchResultItemTest.java
@@ -1,119 +1,119 @@
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.aai.sa.searchdbabstraction.elasticsearch.dao;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class ElasticSearchResultItemTest {
-
- @Test
- public void testAllMethods() {
- ElasticSearchShardStatus shardStatus = new ElasticSearchShardStatus();
- shardStatus.setTotal(10);
- shardStatus.setSuccessful(0);
- shardStatus.setFailed(1);
- Assert.assertEquals(shardStatus.getTotal(), 10);
- Assert.assertEquals(shardStatus.getSuccessful(), 0);
- Assert.assertEquals(shardStatus.getFailed(), 1);
-
- ElasticSearchCause cause = new ElasticSearchCause();
- cause.setType("type-1");
- cause.setReason("reason-1");
- Assert.assertEquals(cause.getType(), "type-1");
- Assert.assertEquals(cause.getReason(), "reason-1");
-
- ElasticSearchError error = new ElasticSearchError();
- error.setType("type-1");
- error.setReason("reason-1");
- error.setCausedBy(cause);
- Assert.assertEquals(error.getType(), "type-1");
- Assert.assertEquals(error.getReason(), "reason-1");
- Assert.assertNotNull(error.getCausedBy());
- error.setAdditionalProperties("name-1", "value-1");
- Assert.assertNotNull(error.getAdditionalProperties());
-
- // Create Status
- ElasticSearchResultItem resultItem1 = new ElasticSearchResultItem();
- resultItem1.setCreate(getStatus(shardStatus, error));
- Assert.assertNotNull(resultItem1.getCreate());
- Assert.assertEquals(resultItem1.operationType(), "create");
- Assert.assertEquals(resultItem1.operationStatus(), resultItem1.getCreate());
- Assert.assertTrue(resultItem1.toString().contains("create"));
- Assert.assertNotNull(resultItem1.toJson());
-
- // Index Status
- ElasticSearchResultItem resultItem2 = new ElasticSearchResultItem();
- resultItem2.setIndex(getStatus(shardStatus, error));
- Assert.assertNotNull(resultItem2.getIndex());
- Assert.assertEquals(resultItem2.operationType(), "update");
- Assert.assertEquals(resultItem2.operationStatus(), resultItem2.getIndex());
- Assert.assertTrue(resultItem2.toString().contains("index"));
- Assert.assertNotNull(resultItem2.toJson());
-
- // Delete Status
- ElasticSearchResultItem resultItem3 = new ElasticSearchResultItem();
- resultItem3.setDelete(getStatus(shardStatus, error));
- Assert.assertNotNull(resultItem3.getDelete());
- Assert.assertEquals(resultItem3.operationType(), "delete");
- Assert.assertEquals(resultItem3.operationStatus(), resultItem3.getDelete());
- Assert.assertTrue(resultItem3.toString().contains("delete"));
- Assert.assertNotNull(resultItem3.toJson());
-
- // Unknown Status
- ElasticSearchResultItem resultItem4 = new ElasticSearchResultItem();
- Assert.assertEquals(resultItem4.operationType(), "unknown");
- Assert.assertNull(resultItem4.operationStatus());
-
- // ElasticSearchBulkOperationResult
- ElasticSearchResultItem[] resultItems = {resultItem1, resultItem2, resultItem3};
- ElasticSearchBulkOperationResult result = new ElasticSearchBulkOperationResult();
- result.setErrors(true);
- result.setTook(new Integer(10));
- result.setItems(resultItems);
- Assert.assertTrue(result.getErrors());
- Assert.assertEquals(result.getTook(), new Integer(10));
- Assert.assertNotNull(result.getItems());
- Assert.assertNotNull(result.toString());
- }
-
- private ElasticSearchOperationStatus getStatus(ElasticSearchShardStatus shardStatus, ElasticSearchError error) {
- ElasticSearchOperationStatus status = new ElasticSearchOperationStatus();
- status.setIndex("index-1");
- status.setType("type-1");
- status.setId("id-1");
- status.setVersion("1.0");
- status.setShards(shardStatus);
- status.setStatus(new Integer(1));
- status.setError(error);
- status.setAdditionalProperties("REQUEST_URL", "http://127.0.0.1");
- Assert.assertEquals(status.getIndex(), "index-1");
- Assert.assertEquals(status.getType(), "type-1");
- Assert.assertEquals(status.getId(), "id-1");
- Assert.assertEquals(status.getVersion(), "1.0");
- Assert.assertEquals(status.getStatus(), new Integer(1));
- Assert.assertNotNull(status.getShards());
- Assert.assertNotNull(status.getError());
- Assert.assertNotNull(status.getAdditionalProperties());
- return status;
- }
-
-}
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sa.searchdbabstraction.elasticsearch.dao;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ElasticSearchResultItemTest {
+
+ @Test
+ public void testAllMethods() {
+ ElasticSearchShardStatus shardStatus = new ElasticSearchShardStatus();
+ shardStatus.setTotal(10);
+ shardStatus.setSuccessful(0);
+ shardStatus.setFailed(1);
+ Assert.assertEquals(shardStatus.getTotal(), 10);
+ Assert.assertEquals(shardStatus.getSuccessful(), 0);
+ Assert.assertEquals(shardStatus.getFailed(), 1);
+
+ ElasticSearchCause cause = new ElasticSearchCause();
+ cause.setType("type-1");
+ cause.setReason("reason-1");
+ Assert.assertEquals(cause.getType(), "type-1");
+ Assert.assertEquals(cause.getReason(), "reason-1");
+
+ ElasticSearchError error = new ElasticSearchError();
+ error.setType("type-1");
+ error.setReason("reason-1");
+ error.setCausedBy(cause);
+ Assert.assertEquals(error.getType(), "type-1");
+ Assert.assertEquals(error.getReason(), "reason-1");
+ Assert.assertNotNull(error.getCausedBy());
+ error.setAdditionalProperties("name-1", "value-1");
+ Assert.assertNotNull(error.getAdditionalProperties());
+
+ // Create Status
+ ElasticSearchResultItem resultItem1 = new ElasticSearchResultItem();
+ resultItem1.setCreate(getStatus(shardStatus, error));
+ Assert.assertNotNull(resultItem1.getCreate());
+ Assert.assertEquals(resultItem1.operationType(), "create");
+ Assert.assertEquals(resultItem1.operationStatus(), resultItem1.getCreate());
+ Assert.assertTrue(resultItem1.toString().contains("create"));
+ Assert.assertNotNull(resultItem1.toJson());
+
+ // Index Status
+ ElasticSearchResultItem resultItem2 = new ElasticSearchResultItem();
+ resultItem2.setIndex(getStatus(shardStatus, error));
+ Assert.assertNotNull(resultItem2.getIndex());
+ Assert.assertEquals(resultItem2.operationType(), "update");
+ Assert.assertEquals(resultItem2.operationStatus(), resultItem2.getIndex());
+ Assert.assertTrue(resultItem2.toString().contains("index"));
+ Assert.assertNotNull(resultItem2.toJson());
+
+ // Delete Status
+ ElasticSearchResultItem resultItem3 = new ElasticSearchResultItem();
+ resultItem3.setDelete(getStatus(shardStatus, error));
+ Assert.assertNotNull(resultItem3.getDelete());
+ Assert.assertEquals(resultItem3.operationType(), "delete");
+ Assert.assertEquals(resultItem3.operationStatus(), resultItem3.getDelete());
+ Assert.assertTrue(resultItem3.toString().contains("delete"));
+ Assert.assertNotNull(resultItem3.toJson());
+
+ // Unknown Status
+ ElasticSearchResultItem resultItem4 = new ElasticSearchResultItem();
+ Assert.assertEquals(resultItem4.operationType(), "unknown");
+ Assert.assertNull(resultItem4.operationStatus());
+
+ // ElasticSearchBulkOperationResult
+ ElasticSearchResultItem[] resultItems = {resultItem1, resultItem2, resultItem3};
+ ElasticSearchBulkOperationResult result = new ElasticSearchBulkOperationResult();
+ result.setErrors(true);
+ result.setTook(new Integer(10));
+ result.setItems(resultItems);
+ Assert.assertTrue(result.getErrors());
+ Assert.assertEquals(result.getTook(), new Integer(10));
+ Assert.assertNotNull(result.getItems());
+ Assert.assertNotNull(result.toString());
+ }
+
+ private ElasticSearchOperationStatus getStatus(ElasticSearchShardStatus shardStatus, ElasticSearchError error) {
+ ElasticSearchOperationStatus status = new ElasticSearchOperationStatus();
+ status.setIndex("index-1");
+ status.setType("type-1");
+ status.setId("id-1");
+ status.setVersion("1.0");
+ status.setShards(shardStatus);
+ status.setStatus(new Integer(1));
+ status.setError(error);
+ status.setAdditionalProperties("REQUEST_URL", "http://127.0.0.1");
+ Assert.assertEquals(status.getIndex(), "index-1");
+ Assert.assertEquals(status.getType(), "type-1");
+ Assert.assertEquals(status.getId(), "id-1");
+ Assert.assertEquals(status.getVersion(), "1.0");
+ Assert.assertEquals(status.getStatus(), new Integer(1));
+ Assert.assertNotNull(status.getShards());
+ Assert.assertNotNull(status.getError());
+ Assert.assertNotNull(status.getAdditionalProperties());
+ return status;
+ }
+
+}
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatementTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatementTest.java
index bff0f4f..bff0f4f 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatementTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationStatementTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationTest.java
index 12b18d1..12b18d1 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/AggregationTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregationTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregationTest.java
index 005cb76..005cb76 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregationTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregationTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregationTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregationTest.java
index 45e7c51..45e7c51 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregationTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeAggregationTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeTest.java
index ef7325e..ef7325e 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRangeTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/FilterTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/FilterTest.java
index 81fa07f..81fa07f 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/FilterTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/FilterTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregationTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregationTest.java
index 1ebed91..1ebed91 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregationTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/GroupByAggregationTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryTest.java
index 1f4887f..1f4887f 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/QueryTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQueryTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQueryTest.java
index e58e545..e58e545 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQueryTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/RangeQueryTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatementTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatementTest.java
index 45ad666..45ad666 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatementTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SearchStatementTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SortTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SortTest.java
index 832fa98..832fa98 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SortTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/SortTest.java
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQueryTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQueryTest.java
index 5a15913..9eab5f4 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQueryTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/TermQueryTest.java
@@ -1,63 +1,63 @@
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.aai.sa.searchdbabstraction.searchapi;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.IOException;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class TermQueryTest {
-
- @Test
- public void testAllMethods() throws IOException {
- String field = "searchTags.nested";
- String stringValue = "theValue.nested";
- String termQueryWithStringValueJson = "{\"field\": \"" + field + "\", \"value\": \"" + stringValue + "\"}";
-
- ObjectMapper mapper = new ObjectMapper();
- TermQuery stringTermQuery = mapper.readValue(termQueryWithStringValueJson, TermQuery.class);
- Assert.assertEquals(stringValue, stringTermQuery.getValue());
- Assert.assertEquals("searchTags.nested", stringTermQuery.getField());
- stringTermQuery.setOperator("operator-1");
- Assert.assertEquals("operator-1", stringTermQuery.getOperator());
- stringTermQuery.setSearchAnalyzer("search-1");
- Assert.assertEquals("search-1", stringTermQuery.getSearchAnalyzer());
-
- String field1 = "searchTags-1 searchTags.second";
- String stringValue1 = "theValue-1 theValue.second";
- String multiFieldTermQueryJSon = "{\"field\": \"" + field1 + "\", \"value\": \"" + stringValue1 + "\"}";
- TermQuery multiFieldTermQuery = mapper.readValue(multiFieldTermQueryJSon, TermQuery.class);
- multiFieldTermQuery.setOperator("and");
- multiFieldTermQuery.setSearchAnalyzer("search-1");
- Assert.assertNotNull(multiFieldTermQuery.toElasticSearch());
- Assert.assertNotNull(multiFieldTermQuery.pathForNestedField(field1));
-
- String field2 = "search11 search2";
- String stringValue2 = "theValue1 theValue2";
- String multiFieldTermJSon = "{\"field\": \"" + field2 + "\", \"value\": \"" + stringValue2 + "\"}";
- TermQuery multiFieldTerm = mapper.readValue(multiFieldTermJSon, TermQuery.class);
- multiFieldTerm.setOperator("or");
- multiFieldTerm.setSearchAnalyzer("search-1");
- Assert.assertNotNull(multiFieldTerm.toElasticSearch());
- }
-
-}
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sa.searchdbabstraction.searchapi;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TermQueryTest {
+
+ @Test
+ public void testAllMethods() throws IOException {
+ String field = "searchTags.nested";
+ String stringValue = "theValue.nested";
+ String termQueryWithStringValueJson = "{\"field\": \"" + field + "\", \"value\": \"" + stringValue + "\"}";
+
+ ObjectMapper mapper = new ObjectMapper();
+ TermQuery stringTermQuery = mapper.readValue(termQueryWithStringValueJson, TermQuery.class);
+ Assert.assertEquals(stringValue, stringTermQuery.getValue());
+ Assert.assertEquals("searchTags.nested", stringTermQuery.getField());
+ stringTermQuery.setOperator("operator-1");
+ Assert.assertEquals("operator-1", stringTermQuery.getOperator());
+ stringTermQuery.setSearchAnalyzer("search-1");
+ Assert.assertEquals("search-1", stringTermQuery.getSearchAnalyzer());
+
+ String field1 = "searchTags-1 searchTags.second";
+ String stringValue1 = "theValue-1 theValue.second";
+ String multiFieldTermQueryJSon = "{\"field\": \"" + field1 + "\", \"value\": \"" + stringValue1 + "\"}";
+ TermQuery multiFieldTermQuery = mapper.readValue(multiFieldTermQueryJSon, TermQuery.class);
+ multiFieldTermQuery.setOperator("and");
+ multiFieldTermQuery.setSearchAnalyzer("search-1");
+ Assert.assertNotNull(multiFieldTermQuery.toElasticSearch());
+ Assert.assertNotNull(multiFieldTermQuery.pathForNestedField(field1));
+
+ String field2 = "search11 search2";
+ String stringValue2 = "theValue1 theValue2";
+ String multiFieldTermJSon = "{\"field\": \"" + field2 + "\", \"value\": \"" + stringValue2 + "\"}";
+ TermQuery multiFieldTerm = mapper.readValue(multiFieldTermJSon, TermQuery.class);
+ multiFieldTerm.setOperator("or");
+ multiFieldTerm.setSearchAnalyzer("search-1");
+ Assert.assertNotNull(multiFieldTerm.toElasticSearch());
+ }
+
+}
diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslatorTest.java b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslatorTest.java
index 877b64f..877b64f 100644
--- a/src/test/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslatorTest.java
+++ b/search-data-service/src/test/java/org/onap/aai/sa/searchdbabstraction/util/ElasticSearchPayloadTranslatorTest.java
diff --git a/src/test/resources/json/analysis-config.json b/search-data-service/src/test/resources/json/analysis-config.json
index a622dcf..a622dcf 100644
--- a/src/test/resources/json/analysis-config.json
+++ b/search-data-service/src/test/resources/json/analysis-config.json
diff --git a/src/test/resources/json/bulk-ops-invalid.json b/search-data-service/src/test/resources/json/bulk-ops-invalid.json
index 4708498..4708498 100644
--- a/src/test/resources/json/bulk-ops-invalid.json
+++ b/search-data-service/src/test/resources/json/bulk-ops-invalid.json
diff --git a/src/test/resources/json/bulk-ops-valid.json b/search-data-service/src/test/resources/json/bulk-ops-valid.json
index 6e805cf..6e805cf 100644
--- a/src/test/resources/json/bulk-ops-valid.json
+++ b/search-data-service/src/test/resources/json/bulk-ops-valid.json
diff --git a/src/test/resources/json/dynamic-custom-template.json b/search-data-service/src/test/resources/json/dynamic-custom-template.json
index a7bd5ae..a7bd5ae 100644
--- a/src/test/resources/json/dynamic-custom-template.json
+++ b/search-data-service/src/test/resources/json/dynamic-custom-template.json
diff --git a/src/test/resources/json/dynamicIndex.json b/search-data-service/src/test/resources/json/dynamicIndex.json
index 5df4069..5df4069 100644
--- a/src/test/resources/json/dynamicIndex.json
+++ b/search-data-service/src/test/resources/json/dynamicIndex.json
diff --git a/src/test/resources/json/es-payload-translation.json b/search-data-service/src/test/resources/json/es-payload-translation.json
index 58ed8f6..58ed8f6 100644
--- a/src/test/resources/json/es-payload-translation.json
+++ b/search-data-service/src/test/resources/json/es-payload-translation.json
diff --git a/src/test/resources/json/filter-config.json b/search-data-service/src/test/resources/json/filter-config.json
index d1de1d7..d1de1d7 100644
--- a/src/test/resources/json/filter-config.json
+++ b/search-data-service/src/test/resources/json/filter-config.json
diff --git a/src/test/resources/json/index-mapping.json b/search-data-service/src/test/resources/json/index-mapping.json
index e447092..e447092 100644
--- a/src/test/resources/json/index-mapping.json
+++ b/search-data-service/src/test/resources/json/index-mapping.json
diff --git a/src/test/resources/json/nested-document.json b/search-data-service/src/test/resources/json/nested-document.json
index 8373a6d..8373a6d 100644
--- a/src/test/resources/json/nested-document.json
+++ b/search-data-service/src/test/resources/json/nested-document.json
diff --git a/src/test/resources/json/queries/query-with-subrange.json b/search-data-service/src/test/resources/json/queries/query-with-subrange.json
index 36e5f15..36e5f15 100644
--- a/src/test/resources/json/queries/query-with-subrange.json
+++ b/search-data-service/src/test/resources/json/queries/query-with-subrange.json
diff --git a/src/test/resources/json/queries/simple-parsed-query.json b/search-data-service/src/test/resources/json/queries/simple-parsed-query.json
index 50ce681..50ce681 100644
--- a/src/test/resources/json/queries/simple-parsed-query.json
+++ b/search-data-service/src/test/resources/json/queries/simple-parsed-query.json
diff --git a/src/test/resources/json/search_policy.json b/search-data-service/src/test/resources/json/search_policy.json
index 63c6785..b1abe3c 100644
--- a/src/test/resources/json/search_policy.json
+++ b/search-data-service/src/test/resources/json/search_policy.json
@@ -1,63 +1,63 @@
-{
- "roles": [
- {
- "name": "testRole",
- "functions": [{
- "name": "testFunction",
- "methods": [{
- "name": "GET"
- }, {
- "name": "DELETE"
- }, {
- "name": "PUT"
- }
- ]
- }
- ],
- "users": [{
- "username": "testUser"
- }
-
- ]
- },
-
- {
- "name": "devRole",
- "functions": [{
- "name": "search",
- "methods": [{
- "name": "GET"
- }, {
- "name": "DELETE"
- }, {
- "name": "PUT"
- }
- ]
- }
- ],
- "users": [
- {
- "username": "cn=onap, ou=onap, o=onap, l=ottawa, st=ontario, c=ca"
- }
-
- ]
- },
-
- {
- "name": "testBasicAuth",
- "functions": [{
- "name": "testBasicAuthFuncyion",
- "methods": [{
- "name": "GET"
- }
- ]
- }
- ],
- "users": [{
- "user": "testBasicAuthUser",
- "pass": "OBF:1ytc1vu91v2p1rxf1mqh1v8s1z0d1msn1san1mqf1z0h1v9u1msl1rvf1v1p1vv11yta"
- }
- ]
- }
- ]
+{
+ "roles": [
+ {
+ "name": "testRole",
+ "functions": [{
+ "name": "testFunction",
+ "methods": [{
+ "name": "GET"
+ }, {
+ "name": "DELETE"
+ }, {
+ "name": "PUT"
+ }
+ ]
+ }
+ ],
+ "users": [{
+ "username": "testUser"
+ }
+
+ ]
+ },
+
+ {
+ "name": "devRole",
+ "functions": [{
+ "name": "search",
+ "methods": [{
+ "name": "GET"
+ }, {
+ "name": "DELETE"
+ }, {
+ "name": "PUT"
+ }
+ ]
+ }
+ ],
+ "users": [
+ {
+ "username": "cn=onap, ou=onap, o=onap, l=ottawa, st=ontario, c=ca"
+ }
+
+ ]
+ },
+
+ {
+ "name": "testBasicAuth",
+ "functions": [{
+ "name": "testBasicAuthFuncyion",
+ "methods": [{
+ "name": "GET"
+ }
+ ]
+ }
+ ],
+ "users": [{
+ "user": "testBasicAuthUser",
+ "pass": "OBF:1ytc1vu91v2p1rxf1mqh1v8s1z0d1msn1san1mqf1z0h1v9u1msl1rvf1v1p1vv11yta"
+ }
+ ]
+ }
+ ]
} \ No newline at end of file
diff --git a/src/test/resources/json/settings-config.json b/search-data-service/src/test/resources/json/settings-config.json
index 5ebdbcc..5ebdbcc 100644
--- a/src/test/resources/json/settings-config.json
+++ b/search-data-service/src/test/resources/json/settings-config.json
diff --git a/src/test/resources/json/simpleDocument.json b/search-data-service/src/test/resources/json/simpleDocument.json
index c21c574..c21c574 100644
--- a/src/test/resources/json/simpleDocument.json
+++ b/search-data-service/src/test/resources/json/simpleDocument.json
diff --git a/src/test/resources/json/tier-support-document.json b/search-data-service/src/test/resources/json/tier-support-document.json
index c6a20db..c6a20db 100644
--- a/src/test/resources/json/tier-support-document.json
+++ b/search-data-service/src/test/resources/json/tier-support-document.json