package Ġcom . github . si os io . up source . internal Ċ Ċ import Ġcom . github . si os io . up source . bean .* Ċ import Ġorg . apache . http .* Ċ import Ġorg . apache . http . client . methods .* Ċ import Ġorg . apache . http . impl . client .* Ċ import Ġorg . apache . http . message .* Ċ import Ġorg . mockito .* Ċ import Ġjava . io .* Ċ Ċ internal Ġabstract Ġclass ĠU ps ource Api Test Support Ġ{ ĊĊĠ Ġprotected Ġval Ġmock HttpClient : ĠClose able HttpClient Ġ= ĠMockito . mock ( Closeable HttpClient :: class . java ) ĊĊĠ Ġprotected Ġval Ġmock Response : ĠClose able HttpResponse Ġ= ĠMockito . mock ( Closeable HttpResponse :: class . java ) ĊĊĠ Ġprotected Ġval Ġhttp Post : ĠArgument Captor < HttpPost > Ġ= ĠArgument Captor . for Class ( HttpPost :: class . java ) ĊĊĠ Ġprotected Ġval Ġsut Ġ= ĠU ps ource Api (" http :// test server ", ĠU ps ource Account (" user ", Ġ" password "), Ġmock HttpClient ) ĊĊĠ Ġinit Ġ{ ĊĠĠĠ ĠMockito .` when `( mock HttpClient . execute ( http Post . capture ())). thenReturn ( mock Response ) ĊĠĠĠ ĠMockito .` when `( mock Response . status Line ). thenReturn ( Basic Status Line ( Http Version ( 1 , Ġ 0 ), Ġ 2 0 0 , Ġ"")) ĊĠ Ġ} ĊĊĠ Ġfun ĠInputStream . read Text (): ĠString Ġ{ ĊĠĠĠ Ġuse Ġ{ ĊĠĠĠĠĠ Ġreturn Ġit . buffered Reader ( charset (" utf - 8 ")). read Text () ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ