/* Ċ Ġ* ĠCopyright Ġ( c ) Ġ 2 0 2 1 Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠ Ġhttps :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġcom . fa endir . z ach tron ics . bot Ċ Ċ import Ġorg . springframework . boot . test . context . SpringBootTest Ċ import Ġorg . springframework . context . ApplicationContext Initializer Ċ import Ġorg . springframework . context . annotation . Annotation Config ApplicationContext Ċ import Ġorg . springframework . core . annotation . Alias For Ċ import Ġorg . springframework . test . annotation . Dir ties Context Ċ import Ġorg . springframework . test . context . Active Profiles Ċ import Ġorg . springframework . test . context . Context Configuration Ċ import Ġjava . lang . annotation . Inherited Ċ import Ġkotlin . reflect . K Class Ċ Ċ @ Target ( Annotation Target . CLASS ) Ċ @ Retention ( Annotation Retention . RUNTIME ) Ċ @ Inherited Ċ @ SpringBootTest ( web Environment Ġ= ĠSpring Boot Test . Web Environment . NONE ) Ċ @ Context Configuration ( initial izers Ġ= Ġ[ Context Initializer :: class ]) Ċ @ Dir ties Context ( class Mode Ġ= ĠD irt ies Context . Class Mode . BEFORE _ EACH _ TEST _ METHOD ) Ċ @ Active Profiles (" test ") Ċ annotation Ġclass ĠBot Test Ċ Ċ class ĠContext Initializer Ġ: ĠApplication Context Initializer < Annotation Config ApplicationContext > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinitialize ( application Context : ĠAnnotation Config ApplicationContext ) Ġ{ ĊĠĠĠĠĠĠĠ Ġapplication Context . register ( Application :: class . java , ĠTest Configuration :: class . java ) ĊĠĠĠĠĠĠĠ Ġapplication Context . add BeanFactory Post Processor Ġ{ Ġfactory Ġ-> Ġfactory . bean Definition Names . map ( factory :: getBean Definition ). forEach Ġ{ Ġit . is Lazy Init Ġ= Ġtrue Ġ} Ġ} ĊĠĠĠ Ġ} Ċ }