tarmogoyf

Bean injection

Oct 8th, 2023
785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.76 KB | Source Code | 0 0
  1.     @Bean
  2.     public OAuth2AccessTokenResponseClient<OAuth2ClientCredentialsGrantRequest> accessTokenResponseClient() {
  3.         Map<String,String> additionalParams = additionalParams();
  4.         if(additionalParams.isEmpty()){
  5.             System.out.println("""
  6.                    ==============================
  7.                    
  8.                    
  9.                    
  10.                    EMPTY
  11.                    
  12.                    
  13.                    =============================
  14.                    """ + Thread.currentThread().getName());
  15.         }else {
  16.                         System.out.println("""
  17.                    ==============================
  18.                    
  19.                    
  20.                    
  21.                    WITH PARAMS
  22.                    
  23.                    
  24.                    =============================
  25.                    """ + Thread.currentThread().getName());
  26.         }
  27.         DefaultClientCredentialsTokenResponseClient tokenResponseClient = new DefaultClientCredentialsTokenResponseClient();
  28.         tokenResponseClient.setRequestEntityConverter(new CustomRequestEntityConverter(additionalParams));
  29.         return tokenResponseClient;
  30.     }
  31.  
  32.  
  33. ============================= CONSOLE LOGS =================================================================
  34. ==============================
  35.  
  36.  
  37.  
  38. WITH PARAMS
  39.  
  40.  
  41. =============================
  42. main
  43. 2023-10-09 07:28:06.522  WARN 13848 --- [           main]  JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
  44. ==============================
  45.  
  46.  
  47.  
  48. EMPTY
  49.  
  50.  
  51. =============================
  52. main
Advertisement
Add Comment
Please, Sign In to add comment