package Ġcom . is up atches . wise fy Ċ Ċ import Ġcom . is up atches . wise fy . Wise Fy . Companion . WIFI _ MANAGER _ FAILURE Ċ import Ġcom . is up atches . wise fy . callbacks . Add Network Callbacks Ċ import Ġcom . is up atches . wise fy . constants . MISSING _ PARAMETER Ċ import Ġcom . is up atches . wise fy . internal . base . Base Instrumentation Test Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Assert . assertNot Equals Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Mockito . mock Ċ import Ġorg . mockito . Mockito . timeout Ċ import Ġorg . mockito . Mockito . verify Ċ Ċ /** Ċ Ġ* ĠTests Ġthe Ġability Ġto Ġadd ĠW EP Ġnetworks . Ċ Ġ* Ċ Ġ* Ġ@ author ĠPat ches Ċ Ġ* Ġ@ since Ġ 3 . 0 Ċ Ġ*/ Ċ @ Suppress (" deprecation ") Ċ internal Ġclass ĠAdd WE P Network Tests Ġ: ĠBase Instrumentation Test () Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsync _ failure _ pre checks () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . add Network _ failure () ĊĠĠĠĠĠĠĠ ĠassertEquals ( MISSING _ PARAMETER , Ġwise fy . add WE P Network ( WE P _ NETWORK _ SSID , ĠW EP _ NETWORK _ PASSWORD )) ĊĠĠĠĠĠĠĠ Ġverification Util . did No Try ToAdd Network () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsync _ failure () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . add Network _ success () ĊĠĠĠĠĠĠĠ Ġmock Network Util . add Network _ failure () ĊĠĠĠĠĠĠĠ ĠassertEquals ( WIFI _ MANAGER _ FAILURE , Ġwise fy . add WE P Network ( WE P _ NETWORK _ SSID , ĠW EP _ NETWORK _ PASSWORD )) ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed ToAdd Network () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsync _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . add Network _ success () ĊĠĠĠĠĠĠĠ Ġmock Network Util . add Network _ success () ĊĠĠĠĠĠĠĠ Ġassert Not Equals ( 1 , Ġwise fy . add WE P Network ( WE P _ NETWORK _ SSID , ĠW EP _ NETWORK _ PASSWORD )) ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed ToAdd Network () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ failure _ pre checks () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . add Network _ failure () ĊĠĠĠĠĠĠĠ Ġval Ġmock Callbacks Ġ= Ġmock ( Add Network Callbacks :: class . java ) ĊĠĠĠĠĠĠĠ Ġwise fy . add WE P Network ( WE P _ NETWORK _ SSID , ĠW EP _ NETWORK _ PASSWORD , Ġmock Callbacks ) ĊĠĠĠĠĠĠĠ Ġverify ( mock Callbacks , Ġtimeout ( VER IFICATION _ SUCCESS _ TIMEOUT )). wise fy Failure ( MISSING _ PARAMETER ) ĊĠĠĠĠĠĠĠ Ġverification Util . did No Try ToAdd Network () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ failure _ pre checks _ null Callback () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . add Network _ failure () ĊĠĠĠĠĠĠĠ Ġnull Callback Util . call Add WE P Network ( WE P _ NETWORK _ SSID , ĠW EP _ NETWORK _ PASSWORD ) ĊĠĠĠĠĠĠĠ Ġverification Util . did No Try ToAdd Network () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ failure () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . add Network _ success () ĊĠĠĠĠĠĠĠ Ġmock Network Util . add Network _ failure () ĊĠĠĠĠĠĠĠ Ġval Ġmock Callbacks Ġ= Ġmock ( Add Network Callbacks :: class . java ) ĊĠĠĠĠĠĠĠ Ġwise fy . add WE P Network ( WE P _ NETWORK _ SSID , ĠW EP _ NETWORK _ PASSWORD , Ġmock Callbacks ) ĊĠĠĠĠĠĠĠ Ġverify ( mock Callbacks , Ġtimeout ( VER IFICATION _ SUCCESS _ TIMEOUT )). failure Adding Network ( WIFI _ MANAGER _ FAILURE ) ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed ToAdd Network () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ failure _ null Callback () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . add Network _ success () ĊĠĠĠĠĠĠĠ Ġmock Network Util . add Network _ failure () ĊĠĠĠĠĠĠĠ Ġnull Callback Util . call Add WE P Network ( WE P _ NETWORK _ SSID , ĠW EP _ NETWORK _ PASSWORD ) ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed ToAdd Network () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . add Network _ success () ĊĠĠĠĠĠĠĠ Ġmock Network Util . add Network _ success () ĊĠĠĠĠĠĠĠ Ġval Ġmock Callbacks Ġ= Ġmock ( Add Network Callbacks :: class . java ) ĊĠĠĠĠĠĠĠ Ġwise fy . add WE P Network ( WE P _ NETWORK _ SSID , ĠW EP _ NETWORK _ PASSWORD , Ġmock Callbacks ) ĊĠĠĠĠĠĠĠ Ġverify Network Added ( mock Callbacks ) ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed ToAdd Network () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ success _ null Callback () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . add Network _ success () ĊĠĠĠĠĠĠĠ Ġmock Network Util . add Network _ success () ĊĠĠĠĠĠĠĠ Ġnull Callback Util . call Add WE P Network ( WE P _ NETWORK _ SSID , ĠW EP _ NETWORK _ PASSWORD ) ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed ToAdd Network () ĊĠĠĠ Ġ} Ċ } Ċ