/* Ċ Ġ* ĠLicensed Ġto Ġthe ĠApache ĠSoftware ĠFoundation Ġ( ASF ) Ġunder Ġone Ġor Ġmore Ċ Ġ* Ġcontributor Ġlicense Ġagreements . Ġ ĠSee Ġthe ĠNOTICE Ġfile Ġdistributed Ġwith Ċ Ġ* Ġthis Ġwork Ġfor Ġadditional Ġinformation Ġregarding Ġcopyright Ġownership . Ċ Ġ* ĠThe ĠASF Ġlicenses Ġthis Ġfile Ġto ĠYou Ġ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 Ġorg . apache . tu w eni . h ob bits Ċ Ċ import Ġorg . apache . tu w eni . bytes . Bytes Ċ import Ġorg . junit . jupiter . api . Assertions . assertEquals Ċ import Ġorg . junit . jupiter . api . Test Ċ Ċ class ĠMessage Test Ġ{ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġparse Message Round trip () Ġ{ ĊĠĠĠ Ġval Ġmsg Ġ= ĠMessage ( command Ġ= Ġ" RPC ", Ġheaders Ġ= ĠBytes . from HexString (" dead beef "), ĊĠĠĠĠĠ Ġbody Ġ= ĠBytes . from HexString (" dead beef ")) ĊĠĠĠ Ġval Ġserialized Ġ= Ġmsg . to Bytes () ĊĠĠĠ Ġval Ġread Ġ= ĠMessage . read Message ( serialized ) !! ĊĠĠĠ ĠassertEquals (" E WP ", Ġread . protocol ) ĊĠĠĠ ĠassertEquals (" 0 . 2 ", Ġread . version ) ĊĠĠĠ ĠassertEquals (" RPC ", Ġread . command ) ĊĠĠĠ ĠassertEquals ( Bytes . from HexString (" dead beef "), Ġread . headers ) ĊĠĠĠ ĠassertEquals ( Bytes . from HexString (" dead beef "), Ġread . body ) ĊĠ Ġ} Ċ } Ċ