package Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . smo ket est Ċ Ċ import Ġorg . springframework . beans . factory . annotation . Value Ċ import Ġorg . springframework . boot . autoconfigure . condition . Conditional On Property Ċ import Ġorg . springframework . boot . autoconfigure . security . oauth 2 . client . servlet . OAuth 2 Client Auto Configuration Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Import Ċ import Ġorg . springframework . security . config . annotation . web . configuration . Enable Web Security Ċ import Ġorg . springframework . security . oauth 2 . client . Authorized Client Service OAuth 2 Authorized Client Manager Ċ import Ġorg . springframework . security . oauth 2 . client . OAuth 2 Authorized Client Manager Ċ import Ġorg . springframework . security . oauth 2 . client . OAuth 2 Authorized Client Provider Builder Ċ import Ġorg . springframework . security . oauth 2 . client . OAuth 2 Authorized Client Service Ċ import Ġorg . springframework . security . oauth 2 . client . registration . Client Registration Repository Ċ import Ġorg . springframework . security . oauth 2 . client . web . reactive . function . client . Servlet OAuth 2 Authorized Client Exchange Filter Function Ċ import Ġorg . springframework . web . reactive . function . client . Web Client Ċ import Ġorg . springframework . web . reactive . function . client . Web Client . Builder Ċ Ċ @ Conditional On Property ( name Ġ= Ġ[" smo ket est . enabled "], Ġhaving Value Ġ= Ġ" true ") Ċ @ Enable Web Security Ċ @ Import ( OAuth 2 Client Auto Configuration :: class ) Ċ class ĠS moke Test Configuration (@ Value ("\ ${ smo ket est . endpoint . url }") Ġprivate Ġval Ġs moke Test Url : ĠString ) Ġ{ ĊĠ Ġprivate Ġval Ġweb Client Builder : ĠBuilder Ġ= ĠWeb Client . builder () ĊĊĠ Ġ@ Bean ĊĠ Ġfun Ġs moke Test Web Client ( authorized Client Manager : ĠOAuth 2 Authorized Client Manager ): ĠWeb Client Ġ= Ġweb Client Builder ĊĠĠĠ Ġ. baseUrl ( smoke Test Url ) ĊĠĠĠ Ġ. apply ( ĊĠĠĠĠĠ ĠServlet OAuth 2 Authorized Client Exchange Filter Function ( authorized Client Manager ). also Ġ{ ĊĠĠĠĠĠĠĠ Ġit . setDefault Client Registration Id (" smo ket est - service ") ĊĠĠĠĠĠ Ġ}. oauth 2 Configuration () ĊĠĠĠ Ġ) ĊĠĠĠ Ġ. build () ĊĊĠ Ġ@ Bean ĊĠ Ġfun Ġauthorized Client Manager ( ĊĠĠĠ Ġclient Registration Repository : ĠClient Registration Repository , ĊĠĠĠ Ġo Auth 2 Authorized Client Service : ĠOAuth 2 Authorized Client Service ĊĠ Ġ): ĠOAuth 2 Authorized Client Manager Ġ= ĊĠĠĠ ĠAuthor ized Client Service OAuth 2 Authorized Client Manager ( ĊĠĠĠĠĠ Ġclient Registration Repository , ĊĠĠĠĠĠ Ġo Auth 2 Authorized Client Service ĊĠĠĠ Ġ). apply Ġ{ ĊĠĠĠĠĠ Ġset Authorized Client Provider ( OAuth 2 Authorized Client Provider Builder . builder (). client Credentials (). build ()) ĊĠĠĠ Ġ} Ċ } Ċ