package Ġde . k lg 7 1 . keycloak migration . change Control . actions . user Ċ Ċ 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 . change Control . actions . role . Add Role Action Ċ import Ġde . k lg 7 1 . keycloak migration . keycloak api . Key cloak Client Ċ import Ġde . k lg 7 1 . keycloak migration . keycloak api . model . Role ListItem Ċ import Ġde . k lg 7 1 . keycloak migration . keycloak api . user ByName Ċ 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 . component . inject Ċ import Ġjava . util . UUID Ċ Ċ class ĠRe voke Role Inte g Test Ġ: ĠAbstract IntegrationTest () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġclient Ġby Ġinject < Key cloak Client >() ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Re voke Role () Ġ{ ĊĠĠĠĠĠĠĠ ĠAdd User Action ( test Realm , Ġ" test Integration "). execute It () ĊĠĠĠĠĠĠĠ ĠAdd Role Action ( test Realm , Ġ" test Role "). execute It () ĊĠĠĠĠĠĠĠ ĠAssign Role Action ( test Realm , Ġ" test Role ", Ġ" test "). execute It () ĊĠĠĠĠĠĠĠ ĠRe voke Role Action ( test Realm , Ġ" test Role ", Ġ" test "). execute It () ĊĊĠĠĠĠĠĠĠ Ġval Ġtest Role Ġ= ĠRole ListItem ( UUID . randomUUID (), Ġ" test Role ", Ġnull , Ġfalse , Ġfalse , Ġtest Realm ) ĊĊĠĠĠĠĠĠĠ Ġclient . user Roles ( test Realm , Ġclient . user ByName (" test Integration ", Ġtest Realm ). id ). let Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( it ). using Element Comparator On Fields (" name ", Ġ" container Id "). does Not Contain ( test Role ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Re voke Role _ user Not Existing () Ġ{ ĊĠĠĠĠĠĠĠ ĠAdd Role Action ( test Realm , Ġ" test Role "). execute It () ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRe voke Role Action ( test Realm , Ġ" test Role ", Ġ" test Integration "). execute It () ĊĠĠĠĠĠĠĠ Ġ}. isInstanceOf ( Migration Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message (" User Ġwith Ġname : Ġtest Integration Ġdoes Ġnot Ġexist Ġin Ġrealm : Ġ${ test Realm } !") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Assign Role _ role Not Existing () Ġ{ ĊĠĠĠĠĠĠĠ ĠAdd User Action ( test Realm , Ġ" test Integration "). execute It () ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRe voke Role Action ( test Realm , Ġ" test Role ", Ġ" test Integration "). execute It () ĊĠĠĠĠĠĠĠ Ġ}. isInstanceOf ( Migration Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message (" Role Ġwith Ġname : Ġtest Role Ġdoes Ġnot Ġexist Ġin Ġrealm : Ġ${ test Realm } !") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Assign Role _ role Not Assigned () Ġ{ ĊĠĠĠĠĠĠĠ ĠAdd User Action ( test Realm , Ġ" test Integration "). execute It () ĊĠĠĠĠĠĠĠ ĠAdd Role Action ( test Realm , Ġ" test Role "). execute It () ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRe voke Role Action ( test Realm , Ġ" test Role ", Ġ" test Integration "). execute It () ĊĠĠĠĠĠĠĠ Ġ}. isInstanceOf ( Migration Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message (" User Ġwith Ġname : Ġtest Integration Ġin Ġrealm : Ġ${ test Realm } Ġdoes Ġnot Ġhave Ġrole : Ġtest Role !") ĊĠĠĠ Ġ} Ċ } Ċ