### Question:
AuthorizationService extends EscrowAgentService { public RequestToken authorizeRequestToken() throws IOException, EscrowAgentErrorResponseException { clientCredentials.checkNotNull(); requestToken.checkNotNull(); String url = "https: + EscrowAgent.getAuthorizationService(); TreeMap<String, String> parameters = getParameters(); SignatureBase signatureBase = new SignatureBase(parameters, url, "POST"); String parametersQuery = signRequest(signatureBase, clientCredentials.getClientSecret() + "&" + requestToken.getTokenSecret()); String response = callEscrowAgentService(parametersQuery, url); return (RequestToken) ResponseParser.toObject(response, RequestToken.class); } AuthorizationService(final ClientCredentials clientCredentials,
            final EscrowAgent escrowAgent, final SecureConnection con,
            final AuthorizationBundle authBundle, final RequestToken rtoken,
            final PDGuardRequestType requestType); @Override final TreeMap<String, String> getParameters(); RequestToken authorizeRequestToken();  }### Answer:
@Test public void testAuthorizeRequestToken() throws IOException, EscrowAgentErrorResponseException { AuthorizationService mockService = Mockito.spy(new AuthorizationService( client, escrowAgent, secure, encryptBundle, requestToken, PDGuardRequestType.ENCRYPTION)); Mockito.doReturn("request_token=token&token_secret=secret&authorized=true") .when((EscrowAgentService) mockService) .callEscrowAgentService(Mockito.anyString(), Mockito.anyString()); RequestToken reqToken = mockService.authorizeRequestToken(); Assert.assertEquals(reqToken.getRequestToken(), "token"); Assert.assertEquals(reqToken.getTokenSecret(), "secret"); Assert.assertTrue(reqToken.isAuthorized()); Mockito.verify((EscrowAgentService) mockService, Mockito.times(1)) .callEscrowAgentService(Mockito.anyString(), Mockito.anyString()); }