package Ġz iel u . git toolbox . startup Ċ Ċ import Ġcom . intellij . openapi . project . Project Ċ import Ġio . mock k . every Ċ import Ġio . mock k . impl . annotations . Mock K Ċ import Ġio . mock k . junit 5 . Mock K Extension Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . assertj . core . api . Soft Assertions . assert Soft ly Ċ import Ġorg . junit . jupiter . api . BeforeEach Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . extension . Extend With Ċ import Ġz iel u . git toolbox . config . Config Overrides Migr ator Ċ import Ġz iel u . git toolbox . config . Extras Config Ċ import Ġz iel u . git toolbox . config . Git Tool Box Config Pr j Ċ Ċ @ Extend With ( Mock K Extension :: class ) Ċ internal Ġclass ĠConfig Overrides Migr ator Test Ġ{ ĊĠ Ġprivate Ġval Ġproject Present able Url Ġ= Ġ"/ this / is / path / to / project " ĊĠ Ġ@ Mock K ĊĠ Ġprivate Ġlateinit Ġvar Ġproject Mock : ĠProject ĊĊĠ Ġ@ BeforeEach ĊĠ Ġfun ĠbeforeEach () Ġ{ ĊĠĠĠ Ġevery Ġ{ Ġproject Mock . present able Url Ġ} Ġreturns Ġproject Present able Url ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġoverride Ġauto Ġfetch Ġenabled `() Ġ{ ĊĠĠĠ Ġ// Ġgiven ĊĠĠĠ Ġval Ġoverrides Ġ= ĠEx tras Config () ĊĠĠĠ Ġoverrides . auto Fetch Enabled Override . enabled Ġ= Ġtrue ĊĠĠĠ Ġoverrides . auto Fetch Enabled Override . value Ġ= Ġfalse ĊĊĠĠĠ Ġval Ġconfig Ġ= ĠGit Tool Box Config Pr j () ĊĠĠĠ Ġval Ġmigr ator Ġ= ĠConfig Overrides Migr ator ( project Mock , Ġoverrides ) ĊĊĠĠĠ Ġ// Ġwhen ĊĠĠĠ Ġval Ġmigrated Ġ= Ġmigr ator . migrate ( config ) ĊĊĠĠĠ Ġ// Ġthen ĊĠĠĠ Ġassert Soft ly Ġ{ Ġsoft ly Ġ-> ĊĠĠĠĠĠ Ġsoft ly . assertThat ( migr ated ). isTrue ĊĠĠĠĠĠ Ġsoft ly . assertThat ( config . auto Fetch ). isFalse ĊĠĠĠĠĠ Ġsoft ly . assertThat ( overrides . auto Fetch Enabled Override . applied ). isNotEmpty . all Satisf y Ġ{ Ġoverride Ġ-> ĊĠĠĠĠĠĠĠ ĠassertThat ( override . project Path ). isEqualTo ( project Present able Url ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġoverride Ġauto Ġfetch Ġon Ġbranch Ġswitch Ġenabled `() Ġ{ ĊĠĠĠ Ġ// Ġgiven ĊĠĠĠ Ġval Ġoverrides Ġ= ĠEx tras Config () ĊĠĠĠ Ġoverrides . auto Fetch On Branch Switch Override . enabled Ġ= Ġtrue ĊĠĠĠ Ġoverrides . auto Fetch On Branch Switch Override . value Ġ= Ġfalse ĊĊĠĠĠ Ġval Ġconfig Ġ= ĠGit Tool Box Config Pr j () ĊĠĠĠ Ġval Ġmigr ator Ġ= ĠConfig Overrides Migr ator ( project Mock , Ġoverrides ) ĊĊĠĠĠ Ġ// Ġwhen ĊĠĠĠ Ġval Ġmigrated Ġ= Ġmigr ator . migrate ( config ) ĊĊĠĠĠ Ġ// Ġthen ĊĠĠĠ Ġassert Soft ly Ġ{ Ġsoft ly Ġ-> ĊĠĠĠĠĠ Ġsoft ly . assertThat ( migr ated ). isTrue ĊĠĠĠĠĠ Ġsoft ly . assertThat ( config . auto Fetch On Branch Switch ). isFalse ĊĠĠĠĠĠ Ġsoft ly . assertThat ( overrides . auto Fetch On Branch Switch Override . applied ). isNotEmpty . all Satisf y Ġ{ Ġoverride Ġ-> ĊĠĠĠĠĠĠĠ ĠassertThat ( override . project Path ). isEqualTo ( project Present able Url ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ