/* Ċ Ġ* ĠCopyright Ġ 2 0 1 7 Ġvin ay ag as und ar Ċ Ġ* ĠCopyright Ġ 2 0 1 7 Ġrand hir gu pta Ċ Ġ* Ċ Ġ* Ġ ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġ Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* Ġ ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* Ġ ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġ Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* Ġ ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* Ġ ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġ Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġyou . dev kn ights . minimal weather . network Ċ Ċ import Ġorg . junit . Fix Method Order Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . junit . runners . JUnit 4 Ċ import Ġorg . junit . runners . Method Sort ers Ċ Ċ import Ġokhttp 3 . MediaType Ċ import Ġokhttp 3 . ResponseBody Ċ import Ġretrofit 2 . Response Ċ Ċ import Ġorg . hamcrest . Matcher Assert . assertThat Ċ import Ġorg . hamcrest . Matchers .` is ` Ċ import Ġorg . hamcrest . Matchers . notNull Value Ċ import Ġorg . hamcrest . Matchers . null Value Ċ Ċ /** Ċ Ġ* Ġ@ author Ġvin ay ag as und ar Ċ Ġ*/ Ċ Ċ @ RunWith ( JUnit 4 :: class ) Ċ @ Fix Method Order ( Method Sort ers . NAME _ ASC ENDING ) Ċ class ĠApiResponse Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġexception () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexception Ġ= ĠException (" foo ") ĊĠĠĠĠĠĠĠ Ġval Ġapi Response Ġ= ĠApiResponse < String >( exception ) ĊĠĠĠĠĠĠĠ ĠassertThat < Map < String , ĠString >>( api Response . links , Ġnot NullValue ()) ĊĠĠĠĠĠĠĠ ĠassertThat < String >( api Response . body , Ġnull Value ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( api Response . code , Ġ` is `( 5 0 0 )) ĊĠĠĠĠĠĠĠ ĠassertThat < String >( api Response . errorMessage , Ġ` is ` (" foo ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsuccess () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġapi Response Ġ= ĠApiResponse ( Response . success (" foo ")) ĊĠĠĠĠĠĠĠ ĠassertThat < String >( api Response . errorMessage , Ġnull Value ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( api Response . code , Ġ` is `( 2 0 0 )) ĊĠĠĠĠĠĠĠ ĠassertThat < String >( api Response . body , Ġ` is ` (" foo ")) ĊĠĠĠĠĠĠĠ ĠassertThat < Int >( api Response . next Page , Ġ` is `( null Value ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġerror () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġapi Response Ġ= ĠApiResponse ( Response . error < String >( 4 0 0 , ĠResponse Body . create ( MediaType . parse (" application / txt "), Ġ" Not ĠFound "))) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( api Response . code , Ġ` is `( 4 0 0 )) ĊĠĠĠĠĠĠĠ ĠassertThat < String >( api Response . body , Ġnull Value ()) ĊĠĠĠĠĠĠĠ ĠassertThat < String >( api Response . errorMessage , Ġ` is ` (" Not ĠFound ")) ĊĠĠĠ Ġ} Ċ } Ċ