Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Indexer
Commits
1a56229b
Commit
1a56229b
authored
Dec 22, 2020
by
Sviatoslav Nekhaienko
Browse files
move settings to IndexerConfigurationProperties
parent
dc232e1c
Pipeline
#19916
failed with stage
in 2 minutes and 3 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
indexer-core/src/main/java/org/opengroup/osdu/indexer/config/IndexerConfigurationProperties.java
View file @
1a56229b
...
...
@@ -47,6 +47,7 @@ public class IndexerConfigurationProperties {
private
String
storageQueryRecordHost
;
private
Integer
storageRecordsBatchSize
;
private
String
storageSchemaHost
;
private
String
schemaHost
;
private
String
entitlementsHost
;
private
String
entitlementTargetAudience
;
private
String
indexerQueueHost
;
...
...
indexer-core/src/main/java/org/opengroup/osdu/indexer/service/impl/SchemaServiceImpl.java
View file @
1a56229b
...
...
@@ -22,6 +22,7 @@ import org.opengroup.osdu.core.common.http.IUrlFetchService;
import
org.opengroup.osdu.core.common.logging.JaxRsDpsLog
;
import
org.opengroup.osdu.core.common.model.http.HttpResponse
;
import
org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo
;
import
org.opengroup.osdu.indexer.config.IndexerConfigurationProperties
;
import
org.opengroup.osdu.indexer.schema.converter.interfaces.SchemaToStorageFormat
;
import
org.opengroup.osdu.indexer.service.SchemaService
;
import
org.opengroup.osdu.indexer.service.StorageService
;
...
...
@@ -47,8 +48,8 @@ public class SchemaServiceImpl implements SchemaService {
@Inject
private
IUrlFetchService
urlFetchService
;
@
Value
(
"${SCHEMA_HOST}"
)
private
String
SCHEMA_HOST
;
@
Inject
private
IndexerConfigurationProperties
configurationProperties
;
@Inject
private
IRequestInfo
requestInfo
;
...
...
@@ -95,7 +96,7 @@ public class SchemaServiceImpl implements SchemaService {
}
protected
HttpResponse
getSchemaServiceResponse
(
String
kind
)
throws
UnsupportedEncodingException
,
URISyntaxException
{
String
url
=
String
.
format
(
"%s/%s"
,
SCHEMA_HOST
,
URLEncoder
.
encode
(
kind
,
StandardCharsets
.
UTF_8
.
toString
()));
String
url
=
String
.
format
(
"%s/%s"
,
configurationProperties
.
getSchemaHost
()
,
URLEncoder
.
encode
(
kind
,
StandardCharsets
.
UTF_8
.
toString
()));
FetchServiceHttpRequest
request
=
FetchServiceHttpRequest
.
builder
()
.
httpMethod
(
HttpMethods
.
GET
)
.
headers
(
this
.
requestInfo
.
getHeadersMap
())
...
...
indexer-core/src/test/java/org/opengroup/osdu/indexer/service/impl/SchemaServiceImplTest.java
View file @
1a56229b
...
...
@@ -24,6 +24,7 @@ import org.mockito.Spy;
import
org.opengroup.osdu.core.common.http.IUrlFetchService
;
import
org.opengroup.osdu.core.common.logging.JaxRsDpsLog
;
import
org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo
;
import
org.opengroup.osdu.indexer.config.IndexerConfigurationProperties
;
import
org.opengroup.osdu.indexer.schema.converter.SchemaToStorageFormatImpl
;
import
org.opengroup.osdu.indexer.service.StorageService
;
import
org.opengroup.osdu.indexer.service.impl.SchemaServiceImpl
;
...
...
@@ -55,6 +56,9 @@ public class SchemaServiceImplTest {
@Mock
private
StorageService
storageService
;
@Mock
private
IndexerConfigurationProperties
configurationProperties
;
@InjectMocks
private
SchemaServiceImpl
sut
;
...
...
provider/indexer-azure/src/test/java/org/opengroup/osdu/indexer/azure/service/SchemaServiceTest.java
View file @
1a56229b
...
...
@@ -24,6 +24,7 @@ import org.opengroup.osdu.core.common.http.IUrlFetchService;
import
org.opengroup.osdu.core.common.logging.JaxRsDpsLog
;
import
org.opengroup.osdu.core.common.model.http.HttpResponse
;
import
org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo
;
import
org.opengroup.osdu.indexer.config.IndexerConfigurationProperties
;
import
org.opengroup.osdu.indexer.schema.converter.SchemaToStorageFormatImpl
;
import
org.opengroup.osdu.indexer.service.StorageService
;
import
org.opengroup.osdu.indexer.service.impl.SchemaServiceImpl
;
...
...
@@ -54,6 +55,8 @@ public class SchemaServiceTest {
private
IRequestInfo
requestInfo
;
@Mock
private
StorageService
storageService
;
@Mock
private
IndexerConfigurationProperties
configurationProperties
;
@InjectMocks
private
SchemaServiceImpl
sut
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment