package Ġorg . v accine impact . reporting _ api . tests . integration _ tests . tests Ċ Ċ import Ġcom . fasterxml . jackson . databind . node . Array Node Ċ import Ġorg . assertj . core . api . Assertions Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Fix Method Order Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runners . Method Sort ers Ċ import Ġorg . v accine impact . reporting _ api . db . J oo q Context Ċ import Ġorg . v accine impact . reporting _ api . db . Tables Ċ import Ġorg . v accine impact . reporting _ api . db . Tables . REPORT _ VERSION Ċ import Ġorg . v accine impact . reporting _ api . security . Internal User Ċ import Ġorg . v accine impact . reporting _ api . tests . insert Report Ċ Ċ @ Fix Method Order ( Method Sort ers . NAME _ ASC ENDING ) Ċ class ĠVersion Tests Ġ: ĠIntegration Test () Ċ { ĊĠĠĠ Ġ@ Test Ġ// Ġmethod Ġname Ġprefixed Ġwith ĠA Ġso Ġruns Ġfirst ĊĠĠĠ Ġfun Ġ` A Ġpub lishes Ġreport `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġun published Version Ġ= ĠJ oo q Context (" git / order ly . sqlite "). use Ġ{ ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . dsl . select ( Tables . REPORT _ VERSION . ID , ĠREPORT _ VERSION . REPORT ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. from ( Tables . REPORT _ VERSION ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. fetch Any () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġversion Id Ġ= Ġun published Version [ REPORT _ VERSION . ID ] ĊĠĠĠĠĠĠĠ Ġval Ġreport Name Ġ= Ġun published Version [ REPORT _ VERSION . REPORT ] ĊĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . post ("/ reports /$ report Name / versions /$ version Id / publish /", Ġmap Of (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= Ġrequest Helper . fake Reviewer ) ĊĠĠĠĠĠĠĠ Ġassert Successful With Response Text ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Publish ") ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= ĠJSON Validator . getData ( response . text ). as Boolean () ĊĠĠĠĠĠĠĠ ĠassertThat ( data ). isEqualTo ( true ) ĊĊĠĠĠĠĠĠĠ Ġval Ġpublish Status Ġ= ĠJ oo q Context (" git / order ly . sqlite "). use Ġ{ ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . dsl . select ( Tables . REPORT _ VERSION . PUBL ISHED ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. from ( Tables . REPORT _ VERSION ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. where ( Tables . REPORT _ VERSION . REPORT . eq ( report Name )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. and ( Tables . REPORT _ VERSION . ID . eq ( version Id )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. fetch Into ( Boolean :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. first () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠassertThat ( publish Status ). isTrue () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġ// Ġmethod Ġname Ġprefixed Ġwith ĠB Ġso Ġruns Ġfirst ĊĠĠĠ Ġfun Ġ` B Ġun pub lishes Ġreport `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpublished Version Ġ= ĠJ oo q Context (" git / order ly . sqlite "). use Ġ{ ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . dsl . select ( Tables . REPORT _ VERSION . ID , ĠREPORT _ VERSION . REPORT ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. from ( Tables . REPORT _ VERSION ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. where ( Tables . REPORT _ VERSION . PUBL ISHED . eq ( true )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. fetch Any () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġversion Id Ġ= Ġpublished Version [ REPORT _ VERSION . ID ] ĊĠĠĠĠĠĠĠ Ġval Ġreport Name Ġ= Ġpublished Version [ REPORT _ VERSION . REPORT ] ĊĊĠĠĠĠĠĠĠ Ġ// Ġnow Ġun publish ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . post ("/ reports /$ report Name / versions /$ version Id / publish /? value = false ", Ġmap Of (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= Ġrequest Helper . fake Reviewer ) ĊĊĠĠĠĠĠĠĠ Ġassert Successful With Response Text ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Publish ") ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= ĠJSON Validator . getData ( response . text ). as Boolean () ĊĠĠĠĠĠĠĠ ĠassertThat ( data ). isEqualTo ( false ) ĊĊĠĠĠĠĠĠĠ Ġval Ġpublish Status Ġ= ĠJ oo q Context (" git / order ly . sqlite "). use Ġ{ ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . dsl . select ( Tables . REPORT _ VERSION . PUBL ISHED ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. from ( Tables . REPORT _ VERSION ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. where ( Tables . REPORT _ VERSION . REPORT . eq ( report Name )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. and ( Tables . REPORT _ VERSION . ID . eq ( version Id )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. fetch Into ( Boolean :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. first () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠassertThat ( publish Status ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġall Ġversions Ġwith Ġglobal Ġreport Ġreading Ġpermissions `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ versions /", Ġuser Ġ= Ġrequest Helper . fake Global Report Reader ) ĊĊĠĠĠĠĠĠĠ Ġassert Successful ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Reports ") ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= ĠJSON Validator . getData ( response . text ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġthere Ġare Ġ 6 Ġreport Ġversions Ġin Ġthe Ġtest Ġdata Ġset , Ġplus Ġthe Ġone Ġwe Ġadded Ġabove ĊĠĠĠĠĠĠĠ ĠassertThat ( data . count ()). isEqualTo ( 8 ) ĊĠĠĠĠĠĠĠ Ġval Ġnames Ġ= Ġdata . map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . get (" name "). as Text () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ ĠassertThat ( names . sorted ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. contains Exactly Elements Of ( listOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" html ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" minimal ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" multi - art ef act ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" mult if ile - art ef act ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" other ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" other ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" test name ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" use _ resource " ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ)) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġall Ġversions Ġwith Ġspecific Ġreport Ġreading Ġpermissions `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ versions /", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= ĠInternal User (" test username ", Ġ" user ", Ġ" */ can - login , report : test name / reports . read ")) ĊĊĠĠĠĠĠĠĠ Ġassert Successful ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Reports ") ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= ĠJSON Validator . getData ( response . text ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( data . count ()). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( data [ 0 ]. get (" name "). as Text ()). isEqualTo (" test name ") ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġreport Ġversions Ġby Ġname Ġwith Ġglobal Ġreport Ġreading Ġpermissions `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name ", Ġuser Ġ= Ġrequest Helper . fake Global Report Reader ) ĊĊĠĠĠĠĠĠĠ Ġassert Successful ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Versions ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġreport Ġversions Ġby Ġname Ġwith Ġspecific Ġreport Ġreading Ġpermissions `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name ", Ġuser Ġ= ĠInternal User (" test username ", Ġ" user ", Ġ" */ can - login , report : test name / reports . read ")) ĊĊĠĠĠĠĠĠĠ Ġassert Successful ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Versions ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` get Ġreport Ġversions Ġthrows Ġ 4 0 3 Ġif Ġuser Ġnot Ġauthorized Ġto Ġread Ġreport `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name ", Ġuser Ġ= Ġfake Report Reader (" bad report name ")) ĊĊĠĠĠĠĠĠĠ Ġassert Unauthorized ( response , Ġ" test name ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġreport Ġby Ġname Ġand Ġversion Ġwith Ġglobal Ġpermission ss `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name / versions / test version ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= Ġrequest Helper . fake Global Report Reader ) ĊĠĠĠĠĠĠĠ Ġassert Successful ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Version ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġreport Ġby Ġname Ġand Ġversion Ġwith Ġscoped Ġpermission `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name / versions / test version ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= ĠInternal User (" test username ", Ġ" user ", Ġ" */ can - login , report : test name / reports . read ")) ĊĠĠĠĠĠĠĠ Ġassert Successful ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Version ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` get Ġby Ġname Ġand Ġversion Ġreturns Ġ 4 0 3 Ġif Ġreport Ġnot Ġin Ġscoped Ġpermissions `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name / versions / test version ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= Ġfake Report Reader (" bad report name ")) ĊĠĠĠĠĠĠĠ Ġassert Unauthorized ( response , Ġ" test name ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` reviewer Ġcan Ġget Ġun published Ġreport Ġby Ġname Ġand Ġversion `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ", Ġpublished Ġ= Ġfalse ) ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name / versions / test version ", Ġuser Ġ= Ġrequest Helper . fake Reviewer ) ĊĊĠĠĠĠĠĠĠ Ġassert Successful ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Version ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` gets Ġ 4 0 4 Ġif Ġreport Ġversion Ġdoesnt Ġexist `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfake Version Ġ= Ġ" hf 6 4 7 rh j " ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name / versions /$ fake Version ") ĊĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠassertThat ( response . statusCode ). isEqualTo ( 4 0 4 ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Error ( response . text , Ġ" unknown - report - version ", Ġ" Unknown Ġreport - version Ġ: Ġ' test name -$ fake Version '") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġversion Ġchangelog Ġby Ġname Ġand Ġversion `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name / versions / test version / changelog /", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= Ġrequest Helper . fake Reviewer ) ĊĠĠĠĠĠĠĠ Ġassert Successful ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Change log ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġempty Ġversion Ġchangelog Ġby Ġname Ġand Ġversion `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ", Ġchangelog Ġ= ĠlistOf ()) ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name / versions / test version / changelog /", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= Ġrequest Helper . fake Reviewer ) ĊĠĠĠĠĠĠĠ Ġassert Successful ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Change log ") ĊĠĠĠĠĠĠĠ Ġval Ġcount Ġ= Ġ( JSON Validator . getData ( response . text ) Ġas ĠArray Node ). size () ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( count ). isEqualTo ( 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġversion Ġchangelog Ġby Ġname Ġand Ġversion Ġif Ġglobal Ġreader Ġpermissions Ġonly `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġ// reader Ġnow Ġhas Ġpermission Ġto Ġget Ġpublic Ġchangelog Ġitems Ġfor Ġpublished Ġreports Ġwhich Ġthey Ġhave Ġperms Ġto Ġread ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name / versions / test version / changelog /", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= Ġrequest Helper . fake Global Report Reader ) ĊĠĠĠĠĠĠĠ Ġassert Successful ( response ) ĊĠĠĠĠĠĠĠ Ġassert Json ContentType ( response ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Again st Schema ( response . text , Ġ" Change log ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` get Ġchangelog Ġreturns Ġ 4 0 4 Ġif Ġversion Ġdoes Ġnot Ġbelong Ġto Ġreport `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ") ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name / versions / not atest version / changelog ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= Ġrequest Helper . fake Reviewer ) ĊĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( response . statusCode ). isEqualTo ( 4 0 4 ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Error ( response . text , Ġ" unknown - report - version ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" Unknown Ġreport - version ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` get Ġchangelog Ġreturns Ġ 4 0 4 Ġif Ġversion Ġis Ġnot Ġpublished Ġand Ġuser Ġhas Ġreader Ġpermission Ġonly `() ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Report (" test name ", Ġ" test version ", Ġpublished Ġ= Ġfalse ) ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest Helper . get ("/ reports / test name / versions / test version / changelog ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Ġ= Ġrequest Helper . fake Global Report Reader ) ĊĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( response . statusCode ). isEqualTo ( 4 0 4 ) ĊĠĠĠĠĠĠĠ ĠJSON Validator . validate Error ( response . text , Ġ" unknown - report - version ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" Unknown Ġreport - version ") ĊĠĠĠ Ġ} Ċ Ċ }