package Ġde . k lg 7 1 . keycloak migration . change Control . actions . client . mapper Ċ Ċ 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 . client . Add Simple Client Action Ċ import Ġde . k lg 7 1 . keycloak migration . keycloak api . Key cloak Client Ċ import Ġde . k lg 7 1 . keycloak migration . keycloak api . client UUID Ċ 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 Ċ Ċ class ĠAdd Audience Mapper Action Inte g Test Ġ: ĠAbstract IntegrationTest () Ġ{ ĊĊĠĠĠ Ġval Ġclient Ġby Ġinject < Key cloak Client >() ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Add Mapper () Ġ{ ĊĠĠĠĠĠĠĠ ĠAdd Simple Client Action ( test Realm , Ġ" simple Client "). execute It () ĊĠĠĠĠĠĠĠ Ġval Ġmapper Name Ġ= Ġ" test Mapper " ĊĠĠĠĠĠĠĠ Ġval Ġprotocol Ġ= Ġ" openid - connect " ĊĠĠĠĠĠĠĠ Ġval Ġprotocol Mapper Ġ= Ġ" oidc - audience - mapper " ĊĠĠĠĠĠĠĠ ĠAdd Audience Mapper Action ( test Realm , Ġ" simple Client ", Ġmapper Name , Ġclient Audience Ġ= Ġ" client Audience ", custom Audience Ġ= Ġ" custom Audience "). execute It () ĊĊĠĠĠĠĠĠĠ Ġval Ġmap pers Ġ= Ġclient . map pers ( client . client UUID (" simple Client ", Ġtest Realm ), Ġtest Realm ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( map pers ). has Size ( 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġmapper Ġ= Ġmap pers [ 0 ] ĊĠĠĠĠĠĠĠ ĠassertThat ( mapper . name ). isEqualTo ( mapper Name ) ĊĠĠĠĠĠĠĠ ĠassertThat ( mapper . protocol ). isEqualTo ( protocol ) ĊĠĠĠĠĠĠĠ ĠassertThat ( mapper . protocol Mapper ). isEqualTo ( protocol Mapper ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Add Existing Mapper () Ġ{ ĊĠĠĠĠĠĠĠ ĠAdd Simple Client Action ( test Realm , Ġ" simple Client "). execute It () ĊĠĠĠĠĠĠĠ Ġval Ġmapper Name Ġ= Ġ" test Mapper " ĊĠĠĠĠĠĠĠ ĠAdd Audience Mapper Action ( test Realm , Ġ" simple Client ", Ġmapper Name , Ġclient Audience Ġ= Ġ" client Audience ", custom Audience Ġ= Ġ" custom Audience "). execute It () ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAdd Audience Mapper Action ( test Realm , Ġ" simple Client ", Ġmapper Name , Ġclient Audience Ġ= Ġ" client Audience ", custom Audience Ġ= Ġ" custom Audience "). execute It () ĊĠĠĠĠĠĠĠ Ġ}. isInstanceOf ( Migration Exception :: class . java ). has Message (" Mapper Ġwith Ġname : Ġ$ mapper Name Ġalready Ġexists Ġin Ġclient : Ġsimple Client Ġon Ġrealm : Ġ$ test Realm !") ĊĊĠĠĠ Ġ} Ċ } Ċ