From 6b79a386cd7bc3cac6bc03fec9d5405b5a6c50cf Mon Sep 17 00:00:00 2001 From: Kai Date: Wed, 18 Mar 2020 14:37:00 +0800 Subject: modify aai enrichment can be disabled Issue-ID: DCAEGEN2-2145 Signed-off-by: Kai Lu Change-Id: I6e9b733e4e49829778dc285979ee0405ea9da96e --- .../main/java/org/onap/dcae/analytics/tca/web/TcaAppProperties.java | 2 +- .../java/org/onap/dcae/analytics/tca/web/config/TcaAaiConfig.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'dcae-analytics') diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/TcaAppProperties.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/TcaAppProperties.java index 2698d9b..fe905f4 100644 --- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/TcaAppProperties.java +++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/TcaAppProperties.java @@ -88,7 +88,7 @@ public class TcaAppProperties extends BaseConfigBindingServiceProperties { aai.setUrl(environment.getProperty(ConfigBindingServiceConstants.AAIURL)); aai.setUsername(environment.getProperty(ConfigBindingServiceConstants.AAIUSERNAME)); aai.setPassword(environment.getProperty(ConfigBindingServiceConstants.AAIPASSWORD)); - aai.setGenericVnfPath(ConfigBindingServiceConstants.AAIGENERICVNFPATH); + aai.setGenericVnfPath(environment.getProperty(ConfigBindingServiceConstants.AAIGENERICVNFPATH)); aai.setNodeQueryPath(environment.getProperty(ConfigBindingServiceConstants.AAINODEQUERYPATH)); tca.setAai(aai); diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaAaiConfig.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaAaiConfig.java index 773b9d3..4ec42d5 100644 --- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaAaiConfig.java +++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaAaiConfig.java @@ -46,6 +46,9 @@ public class TcaAaiConfig { @Bean public RestTemplate aaiRestTemplate(final TcaAaiRestClientPreferences aaiRestClientPreferences, final RestTemplateBuilder restTemplateBuilder) { + if(aaiRestClientPreferences == null) { + return null; + } return restTemplateBuilder .additionalCustomizers(new HttpClientPreferencesCustomizer<>(aaiRestClientPreferences)) .build(); @@ -54,6 +57,9 @@ public class TcaAaiConfig { @Bean public TcaAaiEnrichmentService aaiEnrichmentService(final TcaAppProperties tcaAppProperties, final RestTemplate aaiRestTemplate) { + if (aaiRestTemplate == null) { + return null; + } return new TcaAaiEnrichmentServiceImpl(tcaAppProperties, aaiRestTemplate); } -- cgit 1.2.3-korg