package Ġdev . ak kin oc . spring . boot . log back . access Ċ Ċ import Ġdev . ak kin oc . spring . boot . log back . access . test . assertion . Assertions . assert Log back Access Events Event ually Ċ import Ġdev . ak kin oc . spring . boot . log back . access . test . extension . Events Capture Ċ import Ġdev . ak kin oc . spring . boot . log back . access . test . extension . Events Capture Extension Ċ import Ġdev . ak kin oc . spring . boot . log back . access . test . type . Jet ty Reactive Web Test Ċ import Ġdev . ak kin oc . spring . boot . log back . access . test . type . Jet ty Servlet Web Test Ċ import Ġdev . ak kin oc . spring . boot . log back . access . test . type . Tom cat Reactive Web Test Ċ import Ġdev . ak kin oc . spring . boot . log back . access . test . type . Tom cat Servlet Web Test Ċ import Ġdev . ak kin oc . spring . boot . log back . access . test . type . Under tow Reactive Web Test Ċ import Ġdev . ak kin oc . spring . boot . log back . access . test . type . Under tow Servlet Web Test Ċ import Ġio . kot est . matchers . collections . shouldBe Singleton Ċ import Ġio . kot est . matchers . shouldBe Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . extension . Extend With Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . boot . autoconfigure . security . reactive . Reactive Security Auto Configuration Ċ import Ġorg . springframework . boot . autoconfigure . security . servlet . Security Auto Configuration Ċ import Ġorg . springframework . boot . test . web . client . Test Rest Template Ċ import Ġorg . springframework . boot . test . web . client . exchange Ċ import Ġorg . springframework . context . annotation . Import Ċ import Ġorg . springframework . http . Request Entity Ċ import Ġorg . springframework . test . context . Test Property Source Ċ Ċ /** Ċ Ġ* ĠTests Ġthe Ġcase Ġwhere ĠSpring ĠSecurity Ġis Ġenabled . Ċ Ġ* Ċ Ġ* Ġ@ property Ġsupports Remote Users ĠWhether Ġto Ġsupport Ġremote Ġusers . Ċ Ġ*/ Ċ @ Extend With ( Events Capture Extension :: class ) Ċ @ Import ( Security Auto Configuration :: class , ĠReactive Security Auto Configuration :: class ) Ċ @ Test Property Source ( ĊĠĠĠĠĠĠĠ Ġproperties Ġ= Ġ[ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" spring . security . user . name = test - user ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" spring . security . user . password = test - password ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" log back . access . config = classpath : log back - access - test . capture . xml ", ĊĠĠĠĠĠĠĠ Ġ], Ċ ) Ċ sealed Ġclass ĠSecurity Attributes Test ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġsupports Remote Users : ĠBoolean , Ċ ) Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Rew rites Ġthe Ġremote Ġuser Ġof Ġthe Ġappended ĠLog back - access Ġevent Ġwith ĠSpring ĠSecurity `( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ@ Autowired Ġrest : ĠTest Rest Template , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcapture : ĠEvents Capture , ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠRequest Entity . get ("/ mock - controller / text "). build () ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrest . with Basic Auth (" test - user ", Ġ" test - password "). exchange < String >( request ) ĊĠĠĠĠĠĠĠ Ġresponse . statusCode Value . shouldBe ( 2 0 0 ) ĊĠĠĠĠĠĠĠ Ġval Ġevent Ġ= Ġassert Log back Access Events Event ually Ġ{ Ġcapture . shouldBe Singleton (). single () Ġ} ĊĠĠĠĠĠĠĠ Ġif Ġ( supports Remote Users ) Ġevent . remote User . shouldBe (" test - user ") ĊĠĠĠĠĠĠĠ Ġelse Ġevent . remote User . shouldBe ("- ") ĊĠĠĠ Ġ} Ċ Ċ } Ċ Ċ /** Ċ Ġ* ĠTests Ġthe Ġ[ Security Attributes Test ] Ġusing Ġthe ĠTom cat Ġservlet Ġweb Ġserver . Ċ Ġ*/ Ċ @ Tom cat Servlet Web Test Ċ class ĠTom cat Servlet Web Security Attributes Test Ġ: ĠSecurity Attributes Test ( ĊĠĠĠĠĠĠĠ Ġsupports Remote Users Ġ= Ġtrue , Ċ ) Ċ Ċ /** Ċ Ġ* ĠTests Ġthe Ġ[ Security Attributes Test ] Ġusing Ġthe ĠTom cat Ġreactive Ġweb Ġserver . Ċ Ġ*/ Ċ @ Tom cat Reactive Web Test Ċ class ĠTom cat Reactive Web Security Attributes Test Ġ: ĠSecurity Attributes Test ( ĊĠĠĠĠĠĠĠ Ġsupports Remote Users Ġ= Ġfalse , Ċ ) Ċ Ċ /** Ċ Ġ* ĠTests Ġthe Ġ[ Security Attributes Test ] Ġusing Ġthe ĠJet ty Ġservlet Ġweb Ġserver . Ċ Ġ*/ Ċ @ Jet ty Servlet Web Test Ċ class ĠJet ty Servlet Web Security Attributes Test Ġ: ĠSecurity Attributes Test ( ĊĠĠĠĠĠĠĠ Ġsupports Remote Users Ġ= Ġtrue , Ċ ) Ċ Ċ /** Ċ Ġ* ĠTests Ġthe Ġ[ Security Attributes Test ] Ġusing Ġthe ĠJet ty Ġreactive Ġweb Ġserver . Ċ Ġ*/ Ċ @ Jet ty Reactive Web Test Ċ class ĠJet ty Reactive Web Security Attributes Test Ġ: ĠSecurity Attributes Test ( ĊĠĠĠĠĠĠĠ Ġsupports Remote Users Ġ= Ġfalse , Ċ ) Ċ Ċ /** Ċ Ġ* ĠTests Ġthe Ġ[ Security Attributes Test ] Ġusing Ġthe ĠUnder tow Ġservlet Ġweb Ġserver . Ċ Ġ*/ Ċ @ Under tow Servlet Web Test Ċ class ĠUnder tow Servlet Web Security Attributes Test Ġ: ĠSecurity Attributes Test ( ĊĠĠĠĠĠĠĠ Ġsupports Remote Users Ġ= Ġtrue , Ċ ) Ċ Ċ /** Ċ Ġ* ĠTests Ġthe Ġ[ Security Attributes Test ] Ġusing Ġthe ĠUnder tow Ġreactive Ġweb Ġserver . Ċ Ġ*/ Ċ @ Under tow Reactive Web Test Ċ class ĠUnder tow Reactive Web Security Attributes Test Ġ: ĠSecurity Attributes Test ( ĊĠĠĠĠĠĠĠ Ġsupports Remote Users Ġ= Ġfalse , Ċ ) Ċ