package Ġde . k lg 7 1 . keycloak migration . change Control . actions . role Ċ Ċ import Ġde . k lg 7 1 . keycloak migration . Abstract IntegrationTest Ċ import Ġde . k lg 7 1 . keycloak migration . change Control . actions . Migration Exception Ċ import Ġde . k lg 7 1 . keycloak migration . keycloak api . model . Role ListItem Ċ import Ġde . k lg 7 1 . keycloak migration . keycloak api . Key cloak Client Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . assertj . core . api . Assertions . assertThat Thrown By Ċ import Ġorg . junit . Test Ċ import Ġorg . k oin . core . inject Ċ import Ġjava . util .* Ċ Ċ class ĠAdd Role Inte g Test Ġ: ĠAbstract IntegrationTest () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġclient Ġby Ġinject < Key cloak Client >() ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Add Role () Ġ{ ĊĠĠĠĠĠĠĠ ĠAdd Role Action ( test Realm , Ġ" integration Test "). execute It () ĊĊĠĠĠĠĠĠĠ ĠRole ListItem ( UUID . randomUUID (), Ġ" integration Test ", Ġ"", Ġfalse , Ġfalse , Ġtest Realm ). let Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( client . role ByName (" integration Test ", Ġtest Realm )). isEqualTo Comp aring Only Given Fields ( it , Ġ" name ", Ġ" description ", Ġ" client Role ", Ġ" composite ", Ġ" container Id ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Add Role Already Existing () Ġ{ ĊĠĠĠĠĠĠĠ ĠAdd Role Action ( test Realm , Ġ" integration Test "). execute It () ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAdd Role Action ( test Realm , Ġ" integration Test "). execute It () ĊĠĠĠĠĠĠĠ Ġ}. isInstanceOf ( Migration Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message (" Role Ġwith Ġname : Ġintegration Test Ġalready Ġexists Ġin Ġrealm : Ġ${ test Realm } !") ĊĊĠĠĠ Ġ} Ċ } Ċ