### Question:
RequestTokenService extends EscrowAgentService { public RequestToken getRequestToken() throws IOException, EscrowAgentErrorResponseException { clientCredentials.checkNotNull(); String url = "https: + EscrowAgent.getRequestTokenService(); TreeMap<String, String> parameters = getParameters(); SignatureBase signatureBase = new SignatureBase(parameters, url, "POST"); String parametersQuery = signRequest(signatureBase, clientCredentials.getClientSecret() + "&"); String response = callEscrowAgentService(parametersQuery, url); return (RequestToken) ResponseParser.toObject(response, RequestToken.class); } RequestTokenService(final ClientCredentials clientCredentials,
            final EscrowAgent escrowAgent, final SecureConnection con); @Override TreeMap<String, String> getParameters(); RequestToken getRequestToken();  }### Answer:
@Test public void testGetRequestToken() throws IOException, EscrowAgentErrorResponseException { RequestTokenService mockService = Mockito.spy(service); Mockito.doReturn("request_token=token&token_secret=secret&authorized=false") .when((EscrowAgentService) mockService) .callEscrowAgentService(Mockito.anyString(), Mockito.anyString()); RequestToken reqToken = mockService.getRequestToken(); Assert.assertEquals(reqToken.getRequestToken(), "token"); Assert.assertEquals(reqToken.getTokenSecret(), "secret"); Assert.assertFalse(reqToken.isAuthorized()); Mockito.verify((EscrowAgentService) mockService, Mockito.times(1)) .callEscrowAgentService(Mockito.anyString(), Mockito.anyString()); }