package Ġcom . stripe . android . view Ċ Ċ import Ġandroid . view . input method . Editor Info Ċ import Ġcom . stripe . android . model . PaymentMethod Create Params Interface Ċ import Ġcom . stripe . android . model . PaymentMethod Create Params Fixtures Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . mockito . Mockito .` when ` Ċ import Ġorg . mockito . Mockito . verify Ċ import Ġorg . mockito . kotlin . mock Ċ import Ġorg . ro bo lectric . Ro bo lectric TestRunner Ċ import Ġkotlin . test . Test Ċ Ċ @ RunWith ( Ro bo lectric TestRunner :: class ) Ċ class ĠAdd PaymentMethod Card View Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġactivity : ĠAdd PaymentMethod Activity Ġ= Ġmock () ĊĠĠĠ Ġprivate Ġval Ġadd PaymentMethod Card View : ĠAdd PaymentMethod Card View Ġ= Ġmock () ĊĠĠĠ Ġprivate Ġval Ġkeyboard Controller : ĠKeyboard Controller Ġ= Ġmock () ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsoft Enter Key _ when Data IsValid _ hide s Keyboard And Attempts To Save () Ġ{ ĊĠĠĠĠĠĠĠ Ġ` when `< PaymentMethod Create Params Interface >( add PaymentMethod Card View . create Params ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. thenReturn ( PaymentMethod Create Params Fixtures . DEFAULT _ CARD ) ĊĊĠĠĠĠĠĠĠ ĠAdd PaymentMethod Card View . On Editor ActionListener Impl ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġactivity , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd PaymentMethod Card View , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġkeyboard Controller ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. on Editor Action ( null , ĠEditor Info . IME _ ACTION _ DONE , Ġnull ) ĊĊĠĠĠĠĠĠĠ Ġverify ( keyboard Controller ). hide () ĊĠĠĠĠĠĠĠ Ġverify ( activity ). on Action Save () ĊĠĠĠ Ġ} Ċ } Ċ