diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-05-07 14:20:16 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-05-07 14:20:16 +0200 |
commit | 25bd84ec32115b346cab66eeed9dc47cd574d12b (patch) | |
tree | 7c8cff4489fe48b54a1a40f152b0d86a56efd0ed /lib/src/main | |
parent | be08f91dac2b018fb9a08c89e3961ebc0263a1a4 (diff) |
Read app version from version.properties
- read app version from version.properties
- make openapi dependencies compileOnly
- run spotless formatter
Issue-ID: PORTALNG-94
Change-Id: I3d3b9f057bc998d90763101ac8f3b32a0df280c1
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'lib/src/main')
-rw-r--r-- | lib/src/main/java/org/onap/portalng/bff/config/BeansConfig.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/src/main/java/org/onap/portalng/bff/config/BeansConfig.java b/lib/src/main/java/org/onap/portalng/bff/config/BeansConfig.java index 3eb5f87..a23ac0c 100644 --- a/lib/src/main/java/org/onap/portalng/bff/config/BeansConfig.java +++ b/lib/src/main/java/org/onap/portalng/bff/config/BeansConfig.java @@ -33,6 +33,7 @@ import java.util.List; import lombok.extern.slf4j.Slf4j; import org.onap.portalng.bff.exceptions.DownstreamApiProblemException; import org.onap.portalng.bff.utils.Logger; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.codec.ClientCodecConfigurer; @@ -58,9 +59,11 @@ public class BeansConfig { "logRequestExchangeFilterFunction"; public static final String LOG_RESPONSE_EXCHANGE_FILTER_FUNCTION = "logResponseExchangeFilterFunction"; - private static final String CLIENT_REGISTRATION_ID = "keycloak"; public static final String X_REQUEST_ID = "X-Request-Id"; + private static final String CLIENT_REGISTRATION_ID = "keycloak"; + private static final ObjectMapper objectMapper = new ObjectMapper(); + @Bean(name = OAUTH2_EXCHANGE_FILTER_FUNCTION) ExchangeFilterFunction oauth2ExchangeFilterFunction( ReactiveOAuth2AuthorizedClientManager authorizedClientManager) { @@ -88,9 +91,8 @@ public class BeansConfig { downstreamExceptionBody -> { try { return Mono.error( - new ObjectMapper() - .readValue( - downstreamExceptionBody, DownstreamApiProblemException.class)); + objectMapper.readValue( + downstreamExceptionBody, DownstreamApiProblemException.class)); } catch (JsonProcessingException e) { return Mono.error(DownstreamApiProblemException.builder().build()); } @@ -130,7 +132,7 @@ public class BeansConfig { } @Bean - ExchangeStrategies exchangeStrategies(ObjectMapper objectMapper) { + ExchangeStrategies exchangeStrategies(@Qualifier("objectMapper") ObjectMapper objectMapper) { return ExchangeStrategies.builder() .codecs( configurer -> { |