From 1acaa2eeae7a185534e2d4bf99300bd8bab73abb Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 23 Jun 2021 11:02:05 -0400 Subject: Only enable CadiFilter if prop file set Only enable CadiFilter if cadi.properties.path property is set Issue-ID: CCSDK-3349 Signed-off-by: Dan Timoney Change-Id: If275fb839996ebb93317e9de8a2f2256c99b87b9 --- .../src/main/java/org/onap/ccsdk/apps/ms/sliboot/SlibootApp.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ms/sliboot/src') diff --git a/ms/sliboot/src/main/java/org/onap/ccsdk/apps/ms/sliboot/SlibootApp.java b/ms/sliboot/src/main/java/org/onap/ccsdk/apps/ms/sliboot/SlibootApp.java index 0d7a547f..36048ea4 100644 --- a/ms/sliboot/src/main/java/org/onap/ccsdk/apps/ms/sliboot/SlibootApp.java +++ b/ms/sliboot/src/main/java/org/onap/ccsdk/apps/ms/sliboot/SlibootApp.java @@ -24,6 +24,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.ComponentScan; @@ -49,7 +50,10 @@ public class SlibootApp { SpringApplication.run(SlibootApp.class, args); } + + @Bean + @ConditionalOnProperty("cadi.properties.path") @Order(1) public FilterRegistrationBean cadiFilter() { CadiFilter filter = new CadiFilter(); -- cgit 1.2.3-korg