package Ġcom . dr ab ar z . kar ol ina . test platform runner Ċ Ċ import Ġcom . dr ab ar z . kar ol ina . test platform runner . service . helper . Path Prov Ċ import Ġorg . junit . After Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . springframework . boot . test . context . SpringBootTest Ċ import Ġorg . springframework . test . context . junit 4 . Spring Runner Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . boot . test . context . SpringBootTest . Web Environment Ċ import Ġorg . springframework . boot . test . context . Test Component Ċ import Ġorg . springframework . boot . test . web . client . Test Rest Template Ċ import Ġorg . springframework . http . HttpHeaders Ċ import Ġorg . springframework . http . MediaType Ċ import Ġorg . springframework . util . Multi Value Map Ċ import Ġorg . springframework . http . Http Entity Ċ import Ġorg . springframework . util . Linked Multi Value Map Ċ import Ġorg . springframework . boot . test . context . Test Configuration Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Import Ċ import Ġorg . springframework . context . annotation . Primary Ċ import Ġjava . nio . file . Files Ċ import Ġjava . nio . file . Path Ċ import Ġjava . nio . file . Paths ĊĊ Ċ @ RunWith ( Spring Runner :: class ) Ċ @ SpringBootTest ( web Environment Ġ= ĠWeb Environment . RANDOM _ PORT , Ġclasses Ġ= Ġ[ Test Platform Runner Application Tests . Path Prov Impl TestContext Configuration :: class ]) Ċ class ĠTest Platform Runner Application Tests Ġ{ ĊĊĠĠĠ Ġ@ Test Configuration ĊĠĠĠ Ġ@ Import ( Test Platform Runner Application :: class ) ĊĠĠĠ Ġclass ĠPath Prov Impl TestContext Configuration Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ@ Bean ĊĠĠĠĠĠĠĠ Ġ@ Primary ĊĠĠĠĠĠĠĠ Ġfun Ġpath Prov (): ĠPath Prov Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠTest Path Provider () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊ ĉ @ Autowired Ċ ĉ private Ġval Ġrest Template : ĠTest Rest Template ? Ġ= Ġnull ĊĊ ĉ @ After Ċ ĉ fun Ġclean () Ġ{ Ċĉ ĉ Files . walk ( Paths . get ( Test Path Provider (). projects Path )) Ċĉĉĉ ĉ . sorted ( Comparator . reverse Order ()) Ċĉĉĉ ĉ . map ( Path :: to File ) Ċĉĉĉ ĉ . forEach (:: println ) Ċ ĉ } ĊĊ ĉ @ Test Ċ ĉ fun Ġshould Create Project () Ġ{ Ċĉ ĉ val Ġheaders Ġ= ĠHttp Headers () Ċĉ ĉ headers . set ContentType ( MediaType . APPLICATION _ FORM _ URL ENCODE D ) ĊĊĉ ĉ val Ġmap Ġ= ĠLinked Multi Value Map < String , ĠString >() Ċĉ ĉ map . add (" projectName ", Ġ" test _ project ") ĊĊĉ ĉ val Ġrequest Ġ= ĠHttp Entity < Multi Value Map < String , ĠString >>( map , Ġheaders ) ĊĊĉ ĉ val Ġbody Ġ= Ġthis . rest Template !!. post For Object ("/ project ", Ġrequest , ĠObject :: class . java ) Ċĉ ĉ println ( body ) Ċ ĉ } Ċ } Ċ Ċ @ Test Component Ċ class ĠTest Path Provider : ĠPath Prov Ġ{ Ċ ĉ private Ġfinal Ġval Ġpath Prefix Ġ= Ġ"/ home / kar ol ina / MGR / test / platform " Ċ ĉ final Ġoverride Ġval Ġstudents Path Ġ= Ġ"$ path Prefix / bins " Ċ ĉ final Ġoverride Ġval Ġprojects Path Ġ= Ġ"$ path Prefix / projects " Ċ }