diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-06-10 10:53:20 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-06-10 11:50:01 +0200 |
commit | 1efee417abaaa07344f4dbb239d2456841faa091 (patch) | |
tree | a517097a508ad21bb948c3891d9b97fbeeeb11da /sparkybe-onap-application/config | |
parent | f71b22fc3411442c6398866f0c29cbf8f129f26c (diff) |
Add sparky-be integration test
- run spring-boot integration test for the AggregateSummaryProcessor in the main sparkybe-onap-application module [1]
[1] this is specifically ensuring the proper creation of the beans in the spring context which is done using the spring-beans xml files.
In order to replace this outdated approach some time in the future, there have to be integration tests to ensure the proper injection
Issue-ID: AAI-3860
Change-Id: Id1488482ba852cce7407aba3e700fba5dd48ae99
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'sparkybe-onap-application/config')
5 files changed, 127 insertions, 61 deletions
diff --git a/sparkybe-onap-application/config/application.properties b/sparkybe-onap-application/config/application.properties index cdebe11..e96247c 100644 --- a/sparkybe-onap-application/config/application.properties +++ b/sparkybe-onap-application/config/application.properties @@ -1,3 +1,6 @@ +APP_HOME=. +CONFIG_HOME=./config + # # disable the default thyme leaf icon on web-pages # @@ -25,4 +28,62 @@ searchservice.truststore=tomcat_keystore spring.mvc.favicon.enabled=false -schema.ingest.file=${CONFIG_HOME}/schemaIngest.properties
\ No newline at end of file +schema.ingest.file=${CONFIG_HOME}/schemaIngest.properties + +# Properties for the SchemaLocationsBean +# Files named aai_oxm_v*.xml are unpacked here: +# Schema Version Related Attributes +schema.uri.base.path=/aai +# Lists all of the versions in the schema +schema.version.list=v9,v10,v11,v12,v13,v14 +# Specifies from which version should the depth parameter to default to zero +schema.version.depth.start=v10 +# Specifies from which version should the related link be displayed in response payload +schema.version.related.link.start=v10 +# Specifies from which version should the client see only the uri excluding host info +# Before this version server base will also be included +schema.version.app.root.start=v11 +# Specifies from which version should the namespace be changed +schema.version.namespace.change.start=v12 +# Specifies from which version should the client start seeing the edge label in payload +schema.version.edge.label.start=v12 +# Specifies the version that the application should default to +schema.version.api.default=v14 + +# Schema Location Related Attributes +schema.configuration.location=NA + +# New propterties required by the aai-common - aai-schema-ingest lib as of 1.3.0 +schema.configuration.location=N/A +schema.nodes.location=${APP_HOME}/onap/oxm +schema.edges.location= + +# Setting this values to ${oxm.apiVersion} only to ensure the value used exists (we don't use this properties in our application) +# schema.version.depth.start=${oxm.apiVersion} +# schema.version.related.link.start=${oxm.apiVersion} +# schema.version.app.root.start=${oxm.apiVersion} +# schema.version.namespace.change.start=${oxm.apiVersion} +# schema.version.edge.label.start=${oxm.apiVersion} + +# Properties required by AAI Schema Service MS +schema.translator.list=config +schema.service.base.url=${oxm.schemaServiceBaseUrl} +schema.service.nodes.endpoint=nodes?version= +schema.service.edges.endpoint=edgerules?version= +schema.service.versions.endpoint=versions +schema.local=true +schema.filename=mockrequests +#Default rest client is the two-way-ssl +#schema.service.client=two-way-ssl +#Replace the below with the A&AI client key store +schema.service.ssl.key-store=${oxm.schemaServiceKeystore} +#Replace the below with the A&AI tomcat trust store +schema.service.ssl.trust-store=${oxm.schemaServiceTruststore} +schema.service.ssl.key-store-password=${oxm.schemaServiceKeystorePassword} +schema.service.ssl.trust-store-password=${oxm.schemaServiceTruststorePassword} + +spring.application.name=sparky + +nodeDir=src/main/resources/schema/onap/oxm/ +edgeDir=src/main/resources/schema/onap/oxm +schemaIngestPropLoc=src/main/resources/schema/onap/oxm
\ No newline at end of file diff --git a/sparkybe-onap-application/config/logging/logback.xml b/sparkybe-onap-application/config/logging/logback.xml index 3d132b7..0838bda 100644 --- a/sparkybe-onap-application/config/logging/logback.xml +++ b/sparkybe-onap-application/config/logging/logback.xml @@ -164,8 +164,8 @@ <logger name="ch.qos.logback.classic" level="WARN" /> <logger name="ch.qos.logback.core" level="WARN" /> - <root> - <appender-ref ref="asyncEELF" /> + <root level="INFO"> + <appender-ref ref="STDOUT" /> <!-- <appender-ref ref="asyncEELFDebug" /> --> </root> diff --git a/sparkybe-onap-application/config/schemaIngest.properties b/sparkybe-onap-application/config/schemaIngest.properties index f88a7ef..e69de29 100644 --- a/sparkybe-onap-application/config/schemaIngest.properties +++ b/sparkybe-onap-application/config/schemaIngest.properties @@ -1,57 +0,0 @@ -# Properties for the SchemaLocationsBean -# Files named aai_oxm_v*.xml are unpacked here: -# Schema Version Related Attributes -schema.uri.base.path=/aai -# Lists all of the versions in the schema -schema.version.list=v9,v10,v11,v12,v13,v14 -# Specifies from which version should the depth parameter to default to zero -schema.version.depth.start=v10 -# Specifies from which version should the related link be displayed in response payload -schema.version.related.link.start=v10 -# Specifies from which version should the client see only the uri excluding host info -# Before this version server base will also be included -schema.version.app.root.start=v11 -# Specifies from which version should the namespace be changed -schema.version.namespace.change.start=v12 -# Specifies from which version should the client start seeing the edge label in payload -schema.version.edge.label.start=v12 -# Specifies the version that the application should default to -schema.version.api.default=v14 - -# Schema Location Related Attributes -schema.configuration.location=NA - -# New propterties required by the aai-common - aai-schema-ingest lib as of 1.3.0 -schema.configuration.location=N/A -schema.nodes.location=${oxm.schemaNodeDir} -schema.edges.location= -# These versions need to exist if they are included in the list -schema.version.list=${oxm.apiVersionList} -# Decalares the oxm version to load -schema.version.api.default=${oxm.apiVersion} - -# Setting this values to ${oxm.apiVersion} only to ensure the value used exists (we don't use this properties in our application) -schema.version.depth.start=${oxm.apiVersion} -schema.version.related.link.start=${oxm.apiVersion} -schema.version.app.root.start=${oxm.apiVersion} -schema.version.namespace.change.start=${oxm.apiVersion} -schema.version.edge.label.start=${oxm.apiVersion} - -# Properties required by AAI Schema Service MS -schema.translator.list=config -schema.service.base.url=${oxm.schemaServiceBaseUrl} -schema.service.nodes.endpoint=nodes?version= -schema.service.edges.endpoint=edgerules?version= -schema.service.versions.endpoint=versions -schema.local=true -schema.filename=mockrequests -#Default rest client is the two-way-ssl -#schema.service.client=two-way-ssl -#Replace the below with the A&AI client key store -schema.service.ssl.key-store=${oxm.schemaServiceKeystore} -#Replace the below with the A&AI tomcat trust store -schema.service.ssl.trust-store=${oxm.schemaServiceTruststore} -schema.service.ssl.key-store-password=${oxm.schemaServiceKeystorePassword} -schema.service.ssl.trust-store-password=${oxm.schemaServiceTruststorePassword} - -spring.application.name=sparky
\ No newline at end of file diff --git a/sparkybe-onap-application/config/spring-beans/oxm-reader-bean.xml b/sparkybe-onap-application/config/spring-beans/oxm-reader-bean.xml new file mode 100644 index 0000000..74a291c --- /dev/null +++ b/sparkybe-onap-application/config/spring-beans/oxm-reader-bean.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:context="http://www.springframework.org/schema/context" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> + + <context:property-placeholder location="file:${schemaIngestPropLoc}" ignore-unresolvable="true" /> + + <bean id="filtersConfig" class="org.onap.aai.sparky.search.filters.config.FiltersConfig"> + + </bean> + + <bean id="sparkyResourceLoader" class="org.onap.aai.sparky.config.SparkyResourceLoader"> + <property name="configHomeEnvVar" value="${CONFIG_HOME}" /> + </bean> + + <bean id="crossEntityReferenceLookup" + class="org.onap.aai.sparky.config.oxm.CrossEntityReferenceLookup" /> + + <bean id="oxmEntityLookup" class="org.onap.aai.sparky.config.oxm.OxmEntityLookup" /> + + + <bean id="suggestionEntityLookup" class="org.onap.aai.sparky.config.oxm.SuggestionEntityLookup"> + <constructor-arg ref="filtersConfig" /> + </bean> + <bean id="oxmModelProcessorSet" class="org.springframework.beans.factory.config.SetFactoryBean"> + <property name="targetSetClass" value="java.util.HashSet" /> + <property name="sourceSet"> + <set> + <ref bean="oxmEntityLookup" /> + </set> + </property> + </bean> + + <bean id="schemaLocationsBean" class="org.onap.aai.setup.SchemaLocationsBean"> + <!-- When running with AJSC these properties must be injected directly. + The reason for this is unknown. --> + <property name="nodeDirectory" value="${nodeDir}" /> + <property name="edgeDirectory" value="${edgeDir}" /> + </bean> + + <bean id="schemaVersions" class="org.onap.aai.setup.SchemaVersions" /> + + <bean id="oxmConfigTranslator" class="org.onap.aai.setup.AAIConfigTranslator"> + <constructor-arg ref="schemaLocationsBean" /> + <constructor-arg ref="schemaVersions" /> + </bean> + + <bean id="nodeIngestor" class="org.onap.aai.nodes.NodeIngestor"> + <constructor-arg ref="oxmConfigTranslator" /> + </bean> + + + <bean id="oxmModelLoader" class="org.onap.aai.sparky.config.oxm.OxmModelLoader" + init-method="loadModel"> + <!-- <constructor-arg name="apiVersionOverride" value="V11" /> --> + <constructor-arg ref="oxmModelProcessorSet" /> + <constructor-arg ref="schemaVersions" /> + </bean> + +</beans>
\ No newline at end of file diff --git a/sparkybe-onap-application/config/spring-beans/sparky-oxm.xml b/sparkybe-onap-application/config/spring-beans/sparky-oxm.xml index a210d12..c182c98 100644 --- a/sparkybe-onap-application/config/spring-beans/sparky-oxm.xml +++ b/sparkybe-onap-application/config/spring-beans/sparky-oxm.xml @@ -39,7 +39,7 @@ class="org.onap.aai.sparky.search.registry.SearchProviderRegistry" /> <bean id="sparkyResourceLoader" class="org.onap.aai.sparky.config.SparkyResourceLoader"> - <property name="configHomeEnvVar" value="CONFIG_HOME" /> + <property name="configHomeEnvVar" value="${CONFIG_HOME}" /> </bean> <bean id="unifiedSearchProcessor" class="org.onap.aai.sparky.search.UnifiedSearchProcessor"> |