package Ġg ore p ogen . intellij . plugin Ċ Ċ import Ġcom . intellij . test Framework . fixtures . Base Platform TestCase Ċ import Ġg ore p ogen . intellij . plugin . utils . Message Util Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Object Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Test Ċ import Ġkotlin . test . assert Fails With Ċ Ċ class ĠGenerate Action Test Ġ: ĠBase Platform TestCase () Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Entity Was Not Selected () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġactual Ġ= Ġassert Fails With < RuntimeException > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmy Fixture . test Action ( Generate Action ()) ĊĠĠĠĠĠĠĠ Ġ}. message ĊĠĠĠĠĠĠĠ ĠassertThat ( actual ). isEqualTo (" Please , Ġhighlight Ġentity Ġfirst !") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest G ore p ogen NotFound () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġmock k Object ( Generation Service ) ĊĠĠĠĠĠĠĠ Ġmock k Object ( Message Util ) ĊĊĠĠĠĠĠĠĠ Ġmy Fixture . configure By Text (" user _ entity . go ", Ġ" package Ġentity \ n \ nt ype ĠUser Ġstruct Ġ{} ") ĊĠĠĠĠĠĠĠ Ġmy Fixture . editor . selection Model . setSelection ( 2 1 , Ġ 2 5 ) ĊĊĠĠĠĠĠĠĠ Ġevery Ġ{ ĠGeneration Service . instance . generate For ( any (), Ġany ()) Ġ} Ġthrows ĠNotFound Exception () ĊĠĠĠĠĠĠĠ Ġevery Ġ{ ĠMessage Util . show Download And Install Dialog ( any ()) Ġ} Ġreturns ĠUnit ĊĊĠĠĠĠĠĠĠ ĠassertThat ( my Fixture . test Action ( Generate Action ()). isEnabled And Visible ). isTrue () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Generated () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġmock k Object ( Generation Service ) ĊĊĠĠĠĠĠĠĠ Ġmy Fixture . configure By Text (" user _ entity . go ", Ġ" package Ġentity \ n \ nt ype ĠUser Ġstruct Ġ{} ") ĊĠĠĠĠĠĠĠ Ġmy Fixture . editor . selection Model . setSelection ( 2 1 , Ġ 2 5 ) ĊĊĠĠĠĠĠĠĠ Ġevery Ġ{ ĠGeneration Service . instance . generate For ( any (), Ġany ()) Ġ} Ġreturns Ġ" Success " ĊĊĠĠĠĠĠĠĠ Ġval Ġactual Ġ= Ġassert Fails With < RuntimeException > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmy Fixture . test Action ( Generate Action ()) ĊĠĠĠĠĠĠĠ Ġ}. message ĊĊĠĠĠĠĠĠĠ ĠassertThat ( actual ). isEqualTo (" Success ") ĊĊĠĠĠ Ġ} Ċ Ċ }