package Ġcom . mapbox . maps . plugin . viewport . transition Ċ Ċ import Ġandroid . animation . Animator Set Ċ import Ġcom . mapbox . maps . Camera Options Ċ import Ġcom . mapbox . maps . plugin . animation . Camera Animations Plugin Ċ import Ġcom . mapbox . maps . plugin . animation . Camera Animator Options Ċ import Ġcom . mapbox . maps . plugin . animation . camera Ċ import Ġcom . mapbox . maps . plugin . deleg ates . Map Camera Manager Delegate Ċ import Ġcom . mapbox . maps . plugin . deleg ates . Map Delegate Provider Ċ import Ġcom . mapbox . maps . plugin . deleg ates . Map Plugin Provider Delegate Ċ import Ġcom . mapbox . maps . plugin . viewport . CAMERA _ ANIM ATIONS _ UTILS Ċ import Ġcom . mapbox . maps . plugin . viewport . DEFAULT _ FRAME _ ANIM ATION _ DURATION _ MS Ċ import Ġcom . mapbox . maps . plugin . viewport . DEFAULT _ STATE _ TRANS ITION _ MAX _ DURATION _ MS Ċ import Ġcom . mapbox . maps . plugin . viewport . TRANS ITION _ UTILS Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Ċ import Ġio . mock k . mock k Static Ċ import Ġio . mock k . slot Ċ import Ġio . mock k . un mock k Static Ċ import Ġio . mock k . verify Ċ import Ġorg . junit . After Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . ro bo lectric . Ro bo lectric TestRunner Ċ Ċ @ RunWith ( Ro bo lectric TestRunner :: class ) Ċ class ĠMap box Viewport Transition Factory Test Ġ{ ĊĠ Ġprivate Ġval Ġmap Camera Delegate Ġ= Ġmock k < Map Camera Manager Delegate >() ĊĠ Ġprivate Ġval Ġmap Plugin Provider Delegate Ġ= Ġmock k < Map Plugin Provider Delegate >( relax ed Ġ= Ġtrue ) ĊĠ Ġprivate Ġval Ġcamera Plugin Ġ= Ġmock k < Camera Animations Plugin >() ĊĠ Ġprivate Ġval Ġdelegate Provider Ġ= Ġmock k < Map Delegate Provider >( relax ed Ġ= Ġtrue ) ĊĠ Ġprivate Ġval Ġanim ator Set Ġ= Ġmock k < Animator Set >() ĊĠ Ġprivate Ġval Ġconstr ained Set Ġ= Ġmock k < Animator Set >() ĊĠ Ġprivate Ġlateinit Ġvar Ġtransitions Factory : ĠMap box Viewport Transition Factory ĊĊĠ Ġ@ Before ĊĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠ Ġmock k Static ( TRANS ITION _ UTILS ) ĊĠĠĠ Ġmock k Static ( CAMERA _ ANIM ATIONS _ UTILS ) ĊĠĠĠ Ġevery Ġ{ Ġdelegate Provider . map Plugin Provider Delegate Ġ} Ġreturns Ġmap Plugin Provider Delegate ĊĠĠĠ Ġevery Ġ{ Ġmap Plugin Provider Delegate . camera Ġ} Ġreturns Ġcamera Plugin ĊĠĠĠ Ġevery Ġ{ Ġdelegate Provider . map Camera Manager Delegate Ġ} Ġreturns Ġmap Camera Delegate ĊĠĠĠ Ġevery Ġ{ Ġcreate Animator Set ( any ()) Ġ} Ġreturns Ġanim ator Set ĊĠĠĠ Ġevery Ġ{ Ġanim ator Set . constr ain Duration To ( any ()) Ġ} Ġreturns Ġconstr ained Set ĊĠĠĠ Ġevery Ġ{ Ġscreen Distance From Map Center To Target ( map Camera Delegate , Ġany (), Ġany ()) Ġ} Ġreturns Ġ 1 0 0 0 . 0 ĊĠĠĠ Ġevery Ġ{ Ġcamera Plugin . create Center Animator ( any (), Ġany ()) Ġ} Ġreturns Ġmock k () ĊĠĠĠ Ġevery Ġ{ Ġcamera Plugin . create Be aring Animator ( any (), Ġany (), Ġany ()) Ġ} Ġreturns Ġmock k () ĊĠĠĠ Ġevery Ġ{ Ġcamera Plugin . create Pitch Animator ( any (), Ġany ()) Ġ} Ġreturns Ġmock k () ĊĠĠĠ Ġevery Ġ{ Ġcamera Plugin . create Zoom Animator ( any (), Ġany ()) Ġ} Ġreturns Ġmock k () ĊĠĠĠ Ġevery Ġ{ Ġcamera Plugin . create Padding Animator ( any (), Ġany ()) Ġ} Ġreturns Ġmock k () ĊĠĠĠ Ġtransitions Factory Ġ= ĠMap box Viewport Transition Factory ( delegate Provider ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` transition From Low Zoom To High Zoom Ġ- Ġbe aring Ġis Ġnormalized `() Ġ{ ĊĠĠĠ Ġevery Ġ{ Ġmap Camera Delegate . camera State Ġ} Ġreturns Ġmock k Ġ{ ĊĠĠĠĠĠ Ġevery Ġ{ Ġbe aring Ġ} Ġreturns Ġ 1 0 . 0 ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġcamera Options Ġ= ĠCamera Options . Builder () ĊĠĠĠĠĠ Ġ. be aring ( 3 5 0 . 0 ) ĊĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġval Ġvalue Slot Ġ= Ġslot < Camera Animator Options < Double >>() ĊĠĠĠ Ġevery Ġ{ ĊĠĠĠĠĠ Ġcamera Plugin . create Be aring Animator ( capture ( value Slot ), Ġany (), Ġany ()) ĊĠĠĠ Ġ} Ġreturns Ġmock k () ĊĠĠĠ Ġtransitions Factory . transition From Low Zoom To High Zoom ( ĊĠĠĠĠĠ Ġcamera Options , ĊĠĠĠĠĠ ĠDEFAULT _ STATE _ TRANS ITION _ MAX _ DURATION _ MS ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠassertEquals (- 1 0 . 0 , Ġvalue Slot . captured . targets . last (), ĠEPS ) ĊĠĠĠ Ġverify Ġ{ Ġnormalize Be aring ( 1 0 . 0 , Ġ 3 5 0 . 0 ) Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` transition From High Zoom To Low Zoom Ġ- Ġbe aring Ġis Ġnormalized `() Ġ{ ĊĠĠĠ Ġevery Ġ{ Ġmap Camera Delegate . camera State Ġ} Ġreturns Ġmock k Ġ{ ĊĠĠĠĠĠ Ġevery Ġ{ Ġbe aring Ġ} Ġreturns Ġ 1 0 . 0 ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġcamera Options Ġ= ĠCamera Options . Builder () ĊĠĠĠĠĠ Ġ. be aring ( 3 5 0 . 0 ) ĊĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġval Ġvalue Slot Ġ= Ġslot < Camera Animator Options < Double >>() ĊĠĠĠ Ġevery Ġ{ ĊĠĠĠĠĠ Ġcamera Plugin . create Be aring Animator ( capture ( value Slot ), Ġany (), Ġany ()) ĊĠĠĠ Ġ} Ġreturns Ġmock k () ĊĠĠĠ Ġtransitions Factory . transition From High Zoom To Low Zoom ( ĊĠĠĠĠĠ Ġcamera Options , ĊĠĠĠĠĠ ĠDEFAULT _ STATE _ TRANS ITION _ MAX _ DURATION _ MS ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠassertEquals (- 1 0 . 0 , Ġvalue Slot . captured . targets . last (), ĠEPS ) ĊĠĠĠ Ġverify Ġ{ Ġnormalize Be aring ( 1 0 . 0 , Ġ 3 5 0 . 0 ) Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` transition Linear Ġ- Ġbe aring Ġis Ġnormalized `() Ġ{ ĊĠĠĠ Ġevery Ġ{ Ġmap Camera Delegate . camera State Ġ} Ġreturns Ġmock k Ġ{ ĊĠĠĠĠĠ Ġevery Ġ{ Ġbe aring Ġ} Ġreturns Ġ 1 0 . 0 ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġcamera Options Ġ= ĠCamera Options . Builder () ĊĠĠĠĠĠ Ġ. be aring ( 3 5 0 . 0 ) ĊĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġval Ġvalue Slot Ġ= Ġslot < Camera Animator Options < Double >>() ĊĠĠĠ Ġevery Ġ{ ĊĠĠĠĠĠ Ġcamera Plugin . create Be aring Animator ( capture ( value Slot ), Ġany (), Ġany ()) ĊĠĠĠ Ġ} Ġreturns Ġmock k () ĊĠĠĠ Ġtransitions Factory . transition Linear ( camera Options , ĠDEFAULT _ FRAME _ ANIM ATION _ DURATION _ MS ) ĊĊĠĠĠ ĠassertEquals (- 1 0 . 0 , Ġvalue Slot . captured . targets . last (), ĠEPS ) ĊĠĠĠ Ġverify Ġ{ Ġnormalize Be aring ( 1 0 . 0 , Ġ 3 5 0 . 0 ) Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` transition From Low Zoom To High Zoom Ġ- Ġduration Ġconstr ained `() Ġ{ ĊĠĠĠ Ġevery Ġ{ Ġmap Camera Delegate . camera State Ġ} Ġreturns Ġmock k Ġ{ ĊĠĠĠĠĠ Ġevery Ġ{ Ġcenter Ġ} Ġreturns Ġmock k () ĊĠĠĠĠĠ Ġevery Ġ{ Ġzoom Ġ} Ġreturns Ġ 0 . 0 ĊĠĠĠĠĠ Ġevery Ġ{ Ġbe aring Ġ} Ġreturns Ġ 0 . 0 ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġcamera Options : ĠCamera Options Ġ= Ġmock k ( relax ed Ġ= Ġtrue ) ĊĊĠĠĠ Ġval Ġanim ator Ġ= ĊĠĠĠĠĠ Ġtransitions Factory . transition From Low Zoom To High Zoom ( ĊĠĠĠĠĠĠĠ Ġcamera Options , ĊĠĠĠĠĠĠĠ ĠDEFAULT _ STATE _ TRANS ITION _ MAX _ DURATION _ MS ĊĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġverify Ġ{ Ġanim ator Set . constr ain Duration To ( DEFAULT _ STATE _ TRANS ITION _ MAX _ DURATION _ MS ) Ġ} ĊĠĠĠ ĠassertEquals ( constrained Set , Ġanim ator ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` transition From High Zoom To Low Zoom Ġ- Ġduration Ġconstr ained `() Ġ{ ĊĠĠĠ Ġevery Ġ{ Ġmap Camera Delegate . camera State Ġ} Ġreturns Ġmock k Ġ{ ĊĠĠĠĠĠ Ġevery Ġ{ Ġcenter Ġ} Ġreturns Ġmock k () ĊĠĠĠĠĠ Ġevery Ġ{ Ġzoom Ġ} Ġreturns Ġ 0 . 0 ĊĠĠĠĠĠ Ġevery Ġ{ Ġbe aring Ġ} Ġreturns Ġ 0 . 0 ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġcamera Options : ĠCamera Options Ġ= Ġmock k ( relax ed Ġ= Ġtrue ) ĊĊĠĠĠ Ġval Ġanim ator Ġ= ĊĠĠĠĠĠ Ġtransitions Factory . transition From High Zoom To Low Zoom ( ĊĠĠĠĠĠĠĠ Ġcamera Options , ĊĠĠĠĠĠĠĠ ĠDEFAULT _ STATE _ TRANS ITION _ MAX _ DURATION _ MS ĊĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġverify Ġ{ Ġanim ator Set . constr ain Duration To ( DEFAULT _ STATE _ TRANS ITION _ MAX _ DURATION _ MS ) Ġ} ĊĠĠĠ ĠassertEquals ( constrained Set , Ġanim ator ) ĊĠ Ġ} ĊĊĠ Ġ@ After ĊĠ Ġfun ĠtearDown () Ġ{ ĊĠĠĠ Ġun mock k Static ( TRANS ITION _ UTILS ) ĊĠĠĠ Ġun mock k Static ( CAMERA _ ANIM ATIONS _ UTILS ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġconst Ġval ĠEPS Ġ= Ġ 0 . 0 0 0 0 0 0 0 0 0 1 ĊĠ Ġ} Ċ }