AVA-12458 Potential issue in Spring Cloud OpenFeign article (#12821)

* AVA-12458 Potential issue in Spring Cloud OpenFeign article

* AVA-12458 Commit to re-run he Jenkins build

* JAVA-12458 Revert formatting changes as Jenkins build has passed
This commit is contained in:
anuragkumawat 2022-10-05 19:15:35 +05:30 committed by GitHub
parent ca42c91c55
commit da42c4af4f
2 changed files with 11 additions and 9 deletions

View File

@ -1,15 +1,14 @@
package com.baeldung.cloud.openfeign.config; package com.baeldung.cloud.openfeign.config;
import org.apache.http.entity.ContentType;
import org.springframework.context.annotation.Bean;
import feign.Logger; import feign.Logger;
import feign.RequestInterceptor; import feign.RequestInterceptor;
import feign.auth.BasicAuthRequestInterceptor; import feign.auth.BasicAuthRequestInterceptor;
import feign.codec.ErrorDecoder; import feign.codec.ErrorDecoder;
import feign.okhttp.OkHttpClient; import feign.okhttp.OkHttpClient;
import org.apache.http.entity.ContentType;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ClientConfiguration { public class ClientConfiguration {
@Bean @Bean
@ -19,7 +18,7 @@ public class ClientConfiguration {
@Bean @Bean
public ErrorDecoder errorDecoder() { public ErrorDecoder errorDecoder() {
return new ErrorDecoder.Default(); return new CustomErrorDecoder();
} }
@Bean @Bean

View File

@ -1,13 +1,16 @@
package com.baeldung.cloud.openfeign.oauthfeign; package com.baeldung.cloud.openfeign.oauthfeign;
import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.security.oauth2.client.AuthorizedClientServiceOAuth2AuthorizedClientManager;
import org.springframework.security.oauth2.client.*; import org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager;
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider;
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientProviderBuilder;
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService;
import org.springframework.security.oauth2.client.registration.ClientRegistration; import org.springframework.security.oauth2.client.registration.ClientRegistration;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
@Configuration import feign.RequestInterceptor;
public class OAuthFeignConfig { public class OAuthFeignConfig {
public static final String CLIENT_REGISTRATION_ID = "keycloak"; public static final String CLIENT_REGISTRATION_ID = "keycloak";