package Ġcom . github . ker ub istan . ker ub . host . fw Ċ Ċ import Ġcom . n ha ar man . mockito _ kotlin . any Ċ import Ġcom . n ha ar man . mockito _ kotlin . mock Ċ import Ġcom . n ha ar man . mockito _ kotlin . verify Ċ import Ġcom . n ha ar man . mockito _ kotlin . wh enever Ċ import Ġorg . apache . commons . io . input . Null InputStream Ċ import Ġorg . apache . ss hd . client . channel . Channel Exec Ċ import Ġorg . apache . ss hd . client . session . Client Session Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ class ĠI pt ables Fire Wall Test Ġ{ ĊĊ ĉ val Ġsession : ĠClient Session Ġ= Ġmock () Ċ ĉ val Ġchannel : ĠChannel Exec Ġ= Ġmock () ĊĊ ĉ @ Before Ċ ĉ fun Ġsetup () Ġ{ Ċĉ ĉ wh enever ( session . create Exec Channel ( any ())). thenReturn ( channel ) Ċĉ ĉ wh enever ( channel . inverted Err ). thenReturn ( Null InputStream ( 0 )) Ċĉ ĉ wh enever ( channel . inverted Out ). thenReturn ( Null InputStream ( 0 )) Ċĉ ĉ wh enever ( channel . open ()). thenReturn ( mock ()) Ċ ĉ } ĊĊ ĉ @ Test Ċ ĉ fun Ġtest Open () Ġ{ Ċĉ ĉ I pt ables Fire Wall ( session ). open ( 1 2 3 4 , Ġ" tcp ") Ċĉ ĉ verify ( channel ). open () Ċĉ ĉ verify ( session ). create Exec Channel ( any ()) Ċ ĉ } ĊĊ ĉ @ Test Ċ ĉ fun Ġtest Close () Ġ{ Ċĉ ĉ I pt ables Fire Wall ( session ). close ( 1 2 3 4 , Ġ" tcp ") Ċĉ ĉ verify ( channel ). open () Ċĉ ĉ verify ( session ). create Exec Channel ( any ()) Ċ ĉ } Ċ }