package Ġnet . nem eros a . on track . service . security Ċ Ċ import Ġnet . nem eros a . on track . model . security .* Ċ import Ġnet . nem eros a . on track . test . assert Present Ċ import Ġorg . junit . Assert . assertFalse Ċ import Ġorg . junit . Assert . assertTrue Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ class ĠRoles ServiceImpl Test Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġroles Service : ĠRoles ServiceImpl ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġinit () Ġ{ ĊĠĠĠĠĠĠĠ Ġroles Service Ġ= ĠRoles ServiceImpl ( emptyList ()) ĊĠĠĠĠĠĠĠ Ġroles Service . start () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Global Role _ administrator () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertTrue ( roles Service . getGlobal Role (" ADMIN ISTR ATOR "). isPresent ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Global Role _ controller () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertTrue ( roles Service . getGlobal Role (" CONTROLLER "). isPresent ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Global Role _ unknown () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertFalse ( roles Service . getGlobal Role (" XXX "). isPresent ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Project Role _ owner () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġowner Ġ= Ġroles Service . getProject Role (" OWNER ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( owner . isPresent ) ĊĠĠĠĠĠĠĠ ĠassertTrue ( owner . get (). functions . contains ( Project Edit :: class . java )) ĊĠĠĠĠĠĠĠ ĠassertFalse ( owner . get (). functions . contains ( Project Delete :: class . java )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Project Role _ participant () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġparticipant Ġ= Ġroles Service . getProject Role (" P ARTIC IP ANT ") ĊĠĠĠĠĠĠĠ Ġassert Present ( participant ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertTrue ( it . functions . contains ( Validation Stamp Filter Create :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertFalse ( it . functions . contains ( Validation Stamp Filter Share :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertFalse ( it . functions . contains ( Validation Stamp Filter M gt :: class . java )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Project Role _ validation _ stamp _ manager () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmanager Ġ= Ġroles Service . getProject Role (" VALIDATION _ MANAGER ") ĊĠĠĠĠĠĠĠ Ġassert Present ( manager ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertTrue ( it . functions . contains ( Validation Stamp Filter Create :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertTrue ( it . functions . contains ( Validation Stamp Filter Share :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertTrue ( it . functions . contains ( Validation Stamp Filter M gt :: class . java )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Project Role _ project _ manager () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmanager Ġ= Ġroles Service . getProject Role (" PROJECT _ MANAGER ") ĊĠĠĠĠĠĠĠ Ġassert Present ( manager ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertTrue ( it . functions . contains ( Validation Stamp Filter Create :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertTrue ( it . functions . contains ( Validation Stamp Filter Share :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertTrue ( it . functions . contains ( Validation Stamp Filter M gt :: class . java )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ Ċ }