/* Ċ Ġ* ĠCopyright Ġ 2 0 1 7 Ġpak isan Ċ Ġ* Ċ Ġ* ĠPermission Ġis Ġhereby Ġgranted , Ġfree Ġof Ġcharge , Ġto Ġany Ġperson Ġobtaining Ġa Ġcopy Ġof Ċ Ġ* Ġthis Ġsoftware Ġand Ġassociated Ġdocumentation Ġfiles Ġ( the Ġ" Software "), Ġto Ġdeal Ġin Ġthe Ċ Ġ* ĠSoftware Ġwithout Ġrestriction , Ġincluding Ġwithout Ġlimitation Ġthe Ġrights Ġto Ġuse , Ġcopy , Ċ Ġ* Ġmodify , Ġmerge , Ġpublish , Ġdistribute , Ġsublicense , Ġand / or Ġsell Ġcopies Ġof Ġthe ĠSoftware , Ċ Ġ* Ġand Ġto Ġpermit Ġpersons Ġto Ġwhom Ġthe ĠSoftware Ġis Ġfurnished Ġto Ġdo Ġso , Ġsubject Ġto Ġthe Ċ Ġ* Ġfollowing Ġconditions : Ċ Ġ* Ċ Ġ* ĠThe Ġabove Ġcopyright Ġnotice Ġand Ġthis Ġpermission Ġnotice Ġshall Ġbe Ġincluded Ġin Ġall Ġcopies Ċ Ġ* Ġor Ġsubstantial Ġportions Ġof Ġthe ĠSoftware . Ċ Ġ* Ċ Ġ* ĠTHE ĠSOFTWARE ĠIS ĠPROVIDED Ġ" AS ĠIS ", ĠWITHOUT ĠWARRANTY ĠOF ĠANY ĠKIND , ĠEXPRESS ĠOR Ċ Ġ* ĠIMPLIED , ĠINCLUDING ĠBUT ĠNOT ĠLIMITED ĠTO ĠTHE ĠWARRANTIES ĠOF ĠMERCHANTABILITY , Ċ Ġ* ĠFITNESS ĠFOR ĠA ĠPARTICULAR ĠPURPOSE ĠAND ĠNONINFRINGEMENT . ĠIN ĠNO ĠEVENT ĠSHALL Ċ Ġ* ĠTHE ĠAUTHORS ĠOR ĠCOPYRIGHT ĠHOLDERS ĠBE ĠLIABLE ĠFOR ĠANY ĠCLAIM , ĠDAMAGES ĠOR ĠOTHER Ċ Ġ* ĠLIABILITY , ĠWHETHER ĠIN ĠAN ĠACTION ĠOF ĠCONTRACT , ĠTORT ĠOR ĠOTHERWISE , ĠARISING ĠFROM , Ċ Ġ* ĠOUT ĠOF ĠOR ĠIN ĠCONNECTION ĠWITH ĠTHE ĠSOFTWARE ĠOR ĠTHE ĠUSE ĠOR ĠOTHER ĠDEALINGS ĠIN ĠTHE ĠSOFTWARE . Ċ Ġ*/ Ċ Ċ package Ġpak isan . tele graph cli . data . test . response . account Ċ Ċ import Ġcom . google . gson . Gson Ċ import Ġcom . google . gson . reflect . Type Token Ċ import Ġorg . junit . Test Ċ import Ġpak isan . tele graph cli . data . Account Ċ import Ġpak isan . tele graph cli . data . gson . data . G Response Ċ import Ġpak isan . tele graph cli . data . response . Response Ċ import Ġjava . io . FileReader Ċ import Ġjava . nio . file . Files Ċ import Ġjava . nio . file . Paths Ċ import Ġkotlin . test . assertEquals Ċ Ċ class ĠCreate Account Response Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġcreate Account ResponseType Ġ= Ġobject : ĠType Token < Response < Account >>() {}. type ĊĊĠĠĠ Ġval Ġaccount Ġ= ĠAccount ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" Sandbox ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" Anonymous ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ"", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" ca 9 0 f 9 4 4 adb 2 b 8 f 7 f 4 f 9 d 0 7 c 4 cf 6 aae 7 2 af 4 4 6 1 cc 2 5 2 cb cf ad 4 a 2 d 9 ae abd ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" https :// edit . tele gra . ph / auth / X j B 2 s C 7 FZ YS z Fu 3 h 6 1 H ig k GF qj N JL xp GR 0 Hh DO V AK N ", ĊĠĠĠĠĠĠĠĠĠĠĠĠ 0 ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġcreate Account Response Deserialization Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġgson Ġ= ĠGson () ĊĠĠĠĠĠĠĠ Ġval Ġjson As Bytes Ġ= ĠFiles . read All Bytes ( Paths . get ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠCreate Account Response Test :: class . java . getResource ("/ response / account / create Account Response . json "). path )) ĊĠĠĠĠĠĠĠ Ġval Ġcreate Account Response As Json Ġ= ĠString ( json As Bytes ) ĊĠĠĠĠĠĠĠ Ġval Ġcreate Account Response FromJson : ĠResponse < Account > Ġ= Ġgson . fromJson ( create Account Response As Json , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcreate Account ResponseType ) ĊĠĠĠĠĠĠĠ Ġval Ġcreate Account Response : ĠResponse < Account > Ġ= ĠG Response . response ( create Account Response As Json , Ġcreate Account ResponseType ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( create Account Response FromJson , Ġcreate Account Response , Ġ" mal formed Ġcreate Account Ġresponse .") ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġcreate Account Response Serialization () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġgson Ġ= ĠGson () ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠFileReader ( Create Account Response Test :: class . java . getResource ("/ response / account / create Account Response . json "). path ) ĊĠĠĠĠĠĠĠ Ġval Ġcreate Account Response Ġ= Ġgson . toJson ( gson . fromJson < Response < Account >>( json , Ġcreate Account ResponseType )) ĊĠĠĠĠĠĠĠ Ġval Ġg Create Account Response Ġ= ĠResponse ( true , Ġresult Ġ= Ġaccount ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( create Account Response , ĠG Response . response ( g Create Account Response ), Ġ" mal formed Ġcreate Account ĠJSON .") ĊĠĠĠ Ġ} Ċ Ċ }