package Ġcom . example . kotlin spring a opt est Ċ Ċ import Ġorg . assertj . core . api . Assertions . assertThat Code Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . assert Throws Ċ import Ġorg . springframework . aop . aspect j . annotation . Aspect J Proxy Factory Ċ Ċ internal Ġclass ĠMy Aspect UnitTest Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġinvoke () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġproxy Ġ= ĠAs pect J Proxy Factory ( My Aspect TestClass ()). also Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . add Aspect ( My Aspect ()) ĊĠĠĠĠĠĠĠ Ġ}. get Proxy < My Aspect TestClass >() ĊĊĠĠĠĠĠĠĠ ĠassertThat Code Ġ{ Ġproxy . should Not Block () Ġ}. does Not Throw Any Exception () ĊĠĠĠĠĠĠĠ ĠassertThrows < Block Me Exception > Ġ{ Ġproxy . should Block () Ġ} ĊĠĠĠ Ġ} Ċ } Ċ