package Ġcom . netflix . spin n aker . k ork . plugins . remote . extension ĊĊ Ċ import Ġcom . netflix . spin n aker . k ork . plugins . remote . extension . transport . Remote Extension Payload Ċ import Ġcom . netflix . spin n aker . k ork . plugins . remote . extension . transport . Remote Extension Query Ċ import Ġcom . netflix . spin n aker . k ork . plugins . remote . extension . transport . Remote Extension Response Ċ import Ġcom . netflix . spin n aker . k ork . plugins . remote . extension . transport . Remote Extension Transport Ċ import Ġdev . min ut est . junit . JUnit 5 Min ut ests Ċ import Ġdev . min ut est . root Context Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Ċ import Ġstri kt . api . expect That Ċ import Ġstri kt . assertions . is A Ċ Ċ class ĠRemote Extension Test Ġ: ĠJ Unit 5 Min ut ests Ġ{ ĊĠ Ġfun Ġtests () Ġ= Ġroot Context < Fixture > Ġ{ ĊĠĠĠ Ġfixture Ġ{ ĊĠĠĠĠĠ ĠFix ture () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġtest Ġ(" Get Ġconfig Ġtype ") Ġ{ ĊĠĠĠĠĠ Ġval Ġresult Ġ= Ġsubject . get Typed Config < Config Type >() ĊĠĠĠĠĠ Ġexpect That ( result ). is A < Config Type >() ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġtest (" Invoke Ġis Ġvoid ") Ġ{ ĊĠĠĠĠĠ Ġval Ġresult Ġ= Ġsubject . invoke ( remote Extension Payload ) ĊĠĠĠĠĠ Ġexpect That ( result ). is A < Unit >() ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġtest (" Returns Ġthe Ġwrite Ġresponse ") Ġ{ ĊĠĠĠĠĠ Ġevery Ġ{ Ġtransport . write ( any ()) Ġ} Ġreturns Ġwrite Response ĊĠĠĠĠĠ Ġval Ġresult Ġ= Ġsubject . write < Write Response >( remote Extension Payload ) ĊĠĠĠĠĠ Ġexpect That ( result ). is A < Write Response >() ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġtest (" Returns Ġthe Ġread Ġresponse ") Ġ{ ĊĠĠĠĠĠ Ġevery Ġ{ Ġtransport . read ( any ()) Ġ} Ġreturns Ġread Response ĊĠĠĠĠĠ Ġval Ġresult Ġ= Ġsubject . read < Read Response >( remote Extension Query ) ĊĠĠĠĠĠ Ġexpect That ( result ). is A < Read Response >() ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġclass ĠFix ture Ġ{ ĊĠĠĠ Ġval Ġwrite Response Ġ= ĠWrite Response () ĊĠĠĠ Ġval Ġread Response Ġ= ĠRead Response () ĊĠĠĠ Ġval Ġremote Extension Payload Ġ= ĠPayload () ĊĠĠĠ Ġval Ġremote Extension Query Ġ= ĠQuery () ĊĠĠĠ Ġval Ġtransport : ĠRemote Extension Transport Ġ= Ġmock k ( relax ed Ġ= Ġtrue ) ĊĊĠĠĠ Ġval Ġsubject : ĠRemote Extension Ġ= ĠRemote Extension ( ĊĠĠĠĠĠ Ġ" remote . stage ", ĊĠĠĠĠĠ Ġ" netflix . remote ", ĊĠĠĠĠĠ Ġ" stage ", ĊĠĠĠĠĠ ĠConfig Type (), ĊĠĠĠĠĠ Ġtransport ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġclass ĠPayload : ĠRemote Extension Payload ĊĠ Ġprivate Ġclass ĠQuery : ĠRemote Extension Query ĊĠ Ġprivate Ġclass ĠConfig Type : ĠRemote Extension Point Config ĊĠ Ġprivate Ġclass ĠWrite Response : ĠRemote Extension Response ĊĠ Ġprivate Ġclass ĠRead Response : ĠRemote Extension Response Ċ } Ċ