/* Ċ Ġ* ĠCopyright Ġ 2 0 1 2 - 2 0 2 2 Ġthe Ġoriginal Ġauthor Ġor Ġauthors . Ċ Ġ* Ċ Ġ* Ġ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 Ġorg . springframework . boot . docs . features . testing . spring boot applications . auto configured spring rest docs . with rest ass ured Ċ Ċ import Ġio . rest ass ured . Rest Ass ured Ċ import Ġio . rest ass ured . specification . Request Specification Ċ import Ġorg . hamcrest . Matchers Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . boot . test . autoconfigure . rest docs . Auto Configure Rest Docs Ċ import Ġorg . springframework . boot . test . context . SpringBootTest Ċ import Ġorg . springframework . boot . test . context . SpringBootTest . Web Environment Ċ import Ġorg . springframework . boot . web . server . Local Server Port Ċ import Ġorg . springframework . rest docs . rest ass ured . Rest Ass ured Rest Documentation Ċ Ċ @ SpringBootTest ( web Environment Ġ= ĠWeb Environment . RANDOM _ PORT ) Ċ @ Auto Configure Rest Docs Ċ class ĠMy User Documentation Tests Ġ{ ĊĊ ĉ @ Test Ċ ĉ fun Ġlist Users (@ Autowired Ġdocumentation Spec : ĠRequest Specification ?, Ġ@ Local Server Port Ġport : ĠInt ) Ġ{ Ċĉ ĉ Rest Ass ured . given ( documentation Spec ) Ċĉĉ ĉ . filter ( Rest Ass ured Rest Documentation . document (" list - users ")) Ċĉĉ ĉ .` when `() Ċĉĉ ĉ . port ( port )[" / "] Ċĉĉ ĉ . then (). assertThat () Ċĉĉ ĉ . statusCode ( Matchers .` is `( 2 0 0 )) Ċ ĉ } Ċ Ċ }