package Ġcom . u oooo . vol ley . ext . util Ċ Ċ import Ġcom . android . vol ley . Request Ċ import Ġcom . android . vol ley . Response Ċ import Ġcom . android . vol ley . toolbox . String Request Ċ import Ġcom . u oooo . vol ley . ext . toolbox . Ok HttpRequest Body Request Ċ import Ġio . mock k . mock k Ċ import Ġorg . junit . Assert .* Ċ import Ġorg . junit . Test Ċ Ċ class ĠReflection Test Ġ{ ĊĊĠĠĠ Ġ@ Test ( expected Ġ= ĠNoSuch Field Exception :: class ) ĊĠĠĠ Ġfun Ġthrow Exception When NotExist Field () Ġ{ ĊĠĠĠĠĠĠĠ ĠReflection . getDeclared Field ( Request :: class . java , Ġ" abcd ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġno Throw Exception When Exist Field () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfield Ġ= ĠReflection . getDeclared Field ( Request :: class . java , Ġ" m Error Listener ") ĊĠĠĠĠĠĠĠ ĠassertEquals ( field . name , Ġ" m Error Listener ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ( expected Ġ= ĠNoSuch Field Exception :: class ) ĊĠĠĠ Ġfun Ġthrow Exception When Derived Request Class And NotExist Field () Ġ{ ĊĠĠĠĠĠĠĠ ĠReflection . getDeclared Field ( Ok HttpRequest Body Request :: class . java , Ġ" abcd ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġno Throw Exception When Derived Request Class And Exist Field () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfield Ġ= ĠReflection . getDeclared Field ( Ok HttpRequest Body Request :: class . java , Ġ" m Error Listener ") ĊĠĠĠĠĠĠĠ ĠassertEquals ( field . name , Ġ" m Error Listener ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġreturn Null When NotExist Field () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertNull ( Reflection . getDeclared Field ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmock k < Request < Unit >>() :: class . java , ĠResponse . Listener :: class . java )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġreturn NotNull When Exist Field () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertNotNull ( Reflection . getDeclared Field ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmock k < Request < Unit >>() :: class . java , ĠResponse . Error Listener :: class . java )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġreturn NotNull When Exist Field In String Request () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertNotNull ( Reflection . getDeclared Field ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmock k < String Request >() :: class . java , ĠResponse . Listener :: class . java )) ĊĠĠĠ Ġ} Ċ } Ċ