test_class.declarator: mockWebServer
test_class.modifier: private
test_class.original_string: private MockWebServer mockWebServer;
test_class.type: MockWebServer
test_class.var_name: mockWebServer
test_class.declarator: successResponse =
              "{\n" +
                      "  \"_links\": {\n" +
                      "    \"transaction\": {\n" +
                      "      \"href\": \"/transactions/2634d2cf5adcbd3487d1df042166eef53830115844fdde1588828667bf93ff42\"\n" +
                      "    }\n" +
                      "  },\n" +
                      "  \"hash\": \"2634d2cf5adcbd3487d1df042166eef53830115844fdde1588828667bf93ff42\",\n" +
                      "  \"ledger\": 826150,\n" +
                      "  \"envelope_xdr\": \"AAAAAKu3N77S+cHLEDfVD2eW/CqRiN9yvAKH+qkeLjHQs1u+AAAAZAAMkoMAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAbYQq8ek1GitmNBUloGnetfWxSpxlsgK48Xi66dIL3MoAAAAAC+vCAAAAAAAAAAAB0LNbvgAAAEDadQ25SNHWTg0L+2wr/KNWd8/EwSNFkX/ncGmBGA3zkNGx7lAow78q8SQmnn2IsdkD9MwICirhsOYDNbaqShwO\",\n"
                      +
                      "  \"result_xdr\": \"AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=\",\n" +
                      "  \"result_meta_xdr\": \"AAAAAAAAAAEAAAACAAAAAAAMmyYAAAAAAAAAAG2EKvHpNRorZjQVJaBp3rX1sUqcZbICuPF4uunSC9zKAAAAAAvrwgAADJsmAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAMmyYAAAAAAAAAAKu3N77S+cHLEDfVD2eW/CqRiN9yvAKH+qkeLjHQs1u+AAAAFzCfYtQADJKDAAAAAwAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAA\"\n"
                      +
                      "}"
test_class.modifier: private final
test_class.original_string: private final String successResponse =
              "{\n" +
                      "  \"_links\": {\n" +
                      "    \"transaction\": {\n" +
                      "      \"href\": \"/transactions/2634d2cf5adcbd3487d1df042166eef53830115844fdde1588828667bf93ff42\"\n" +
                      "    }\n" +
                      "  },\n" +
                      "  \"hash\": \"2634d2cf5adcbd3487d1df042166eef53830115844fdde1588828667bf93ff42\",\n" +
                      "  \"ledger\": 826150,\n" +
                      "  \"envelope_xdr\": \"AAAAAKu3N77S+cHLEDfVD2eW/CqRiN9yvAKH+qkeLjHQs1u+AAAAZAAMkoMAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAbYQq8ek1GitmNBUloGnetfWxSpxlsgK48Xi66dIL3MoAAAAAC+vCAAAAAAAAAAAB0LNbvgAAAEDadQ25SNHWTg0L+2wr/KNWd8/EwSNFkX/ncGmBGA3zkNGx7lAow78q8SQmnn2IsdkD9MwICirhsOYDNbaqShwO\",\n"
                      +
                      "  \"result_xdr\": \"AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=\",\n" +
                      "  \"result_meta_xdr\": \"AAAAAAAAAAEAAAACAAAAAAAMmyYAAAAAAAAAAG2EKvHpNRorZjQVJaBp3rX1sUqcZbICuPF4uunSC9zKAAAAAAvrwgAADJsmAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAMmyYAAAAAAAAAAKu3N77S+cHLEDfVD2eW/CqRiN9yvAKH+qkeLjHQs1u+AAAAFzCfYtQADJKDAAAAAwAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAA\"\n"
                      +
                      "}";
test_class.type: String
test_class.var_name: successResponse
test_class.declarator: failureResponse =
              "{\n" +
                      "  \"type\": \"https://stellar.org/horizon-errors/transaction_failed\",\n" +
                      "  \"title\": \"Transaction Failed\",\n" +
                      "  \"status\": 400,\n" +
                      "  \"detail\": \"TODO\",\n" +
                      "  \"instance\": \"horizon-testnet-001.prd.stellar001.internal.stellar-ops.com/IxhaI70Tqo-112305\",\n" +
                      "  \"extras\": {\n" +
                      "    \"envelope_xdr\": \"AAAAAK4Pg4OEkjGmSN0AN37K/dcKyKPT2DC90xvjjawKp136AAAAZAAKsZQAAAABAAAAAAAAAAEAAAAJSmF2YSBGVFchAAAAAAAAAQAAAAAAAAABAAAAAG9wfBI7rRYoBlX3qRa0KOnI75W5BaPU6NbyKmm2t71MAAAAAAAAAAABMS0AAAAAAAAAAAEKp136AAAAQOWEjL+Sm+WP2puE9dLIxWlOibIEOz8PsXyG77jOCVdHZfQvkgB49Mu5wqKCMWWIsDSLFekwUsLaunvmXrpyBwQ=\",\n"
                      +
                      "    \"result_codes\": {\n" +
                      "      \"transaction\": \"tx_failed\",\n" +
                      "      \"operations\": [\n" +
                      "        \"op_no_destination\"\n" +
                      "      ]\n" +
                      "    },\n" +
                      "    \"result_xdr\": \"AAAAAAAAAGT/////AAAAAQAAAAAAAAAB////+wAAAAA=\"\n" +
                      "  }\n" +
                      "}"
test_class.modifier: private final
test_class.original_string: private final String failureResponse =
              "{\n" +
                      "  \"type\": \"https://stellar.org/horizon-errors/transaction_failed\",\n" +
                      "  \"title\": \"Transaction Failed\",\n" +
                      "  \"status\": 400,\n" +
                      "  \"detail\": \"TODO\",\n" +
                      "  \"instance\": \"horizon-testnet-001.prd.stellar001.internal.stellar-ops.com/IxhaI70Tqo-112305\",\n" +
                      "  \"extras\": {\n" +
                      "    \"envelope_xdr\": \"AAAAAK4Pg4OEkjGmSN0AN37K/dcKyKPT2DC90xvjjawKp136AAAAZAAKsZQAAAABAAAAAAAAAAEAAAAJSmF2YSBGVFchAAAAAAAAAQAAAAAAAAABAAAAAG9wfBI7rRYoBlX3qRa0KOnI75W5BaPU6NbyKmm2t71MAAAAAAAAAAABMS0AAAAAAAAAAAEKp136AAAAQOWEjL+Sm+WP2puE9dLIxWlOibIEOz8PsXyG77jOCVdHZfQvkgB49Mu5wqKCMWWIsDSLFekwUsLaunvmXrpyBwQ=\",\n"
                      +
                      "    \"result_codes\": {\n" +
                      "      \"transaction\": \"tx_failed\",\n" +
                      "      \"operations\": [\n" +
                      "        \"op_no_destination\"\n" +
                      "      ]\n" +
                      "    },\n" +
                      "    \"result_xdr\": \"AAAAAAAAAGT/////AAAAAQAAAAAAAAAB////+wAAAAA=\"\n" +
                      "  }\n" +
                      "}";
test_class.type: String
test_class.var_name: failureResponse
test_class.declarator: server
test_class.modifier: private
test_class.original_string: private Server server;
test_class.type: Server
test_class.var_name: server
test_class.file: kin-sdk/kin-base/src/test/java/kin/base/ServerTest.java
test_class.identifier: ServerTest
test_class.superclass: extends TestCase
test_case.body: @Test
      public void testSubmitTransactionSuccess() throws IOException {
          mockWebServer.enqueue(
                  new MockResponse()
                          .setResponseCode(200)
                          .setBody(successResponse)
          );
  
          SubmitTransactionResponse response = server.submitTransaction(this.buildTransaction());
          assertTrue(response.isSuccess());
          assertEquals(response.getLedger(), new Long(826150L));
          assertEquals(response.getHash(), "2634d2cf5adcbd3487d1df042166eef53830115844fdde1588828667bf93ff42");
          assertNull(response.getExtras());
      }
test_case.class_method_signature: ServerTest.testSubmitTransactionSuccess()
test_case.full_signature: @Test public void testSubmitTransactionSuccess()
test_case.identifier: testSubmitTransactionSuccess
test_case.invocations: enqueue setBody setResponseCode submitTransaction buildTransaction assertTrue isSuccess assertEquals getLedger assertEquals getHash assertNull getExtras
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSubmitTransactionSuccess()
focal_class.declarator: TEMPORARY_REDIRECT = 307
focal_class.modifier: private static final
focal_class.original_string: private static final int TEMPORARY_REDIRECT = 307;
focal_class.type: int
focal_class.var_name: TEMPORARY_REDIRECT
focal_class.declarator: LOCATION_HEADER = "Location"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOCATION_HEADER = "Location";
focal_class.type: String
focal_class.var_name: LOCATION_HEADER
focal_class.declarator: serverURI
focal_class.modifier: private
focal_class.original_string: private URI serverURI;
focal_class.type: URI
focal_class.var_name: serverURI
focal_class.declarator: httpClient
focal_class.modifier: private
focal_class.original_string: private OkHttpClient httpClient;
focal_class.type: OkHttpClient
focal_class.var_name: httpClient
focal_class.file: kin-sdk/kin-base/src/main/java/kin/base/Server.java
focal_class.identifier: Server
focal_class.class_method_signature: Server.Server(String uri)
focal_class.full_signature: public  Server(String uri)
focal_class.identifier: Server
focal_class.modifiers: public
focal_class.parameters: (String uri)
focal_class.signature:  Server(String uri)
focal_class.class_method_signature: Server.Server(String uri, OkHttpClient client)
focal_class.full_signature: public  Server(String uri, OkHttpClient client)
focal_class.identifier: Server
focal_class.modifiers: public
focal_class.parameters: (String uri, OkHttpClient client)
focal_class.signature:  Server(String uri, OkHttpClient client)
focal_class.class_method_signature: Server.createUri(String uri)
focal_class.full_signature: private void createUri(String uri)
focal_class.identifier: createUri
focal_class.modifiers: private
focal_class.parameters: (String uri)
focal_class.return: void
focal_class.signature: void createUri(String uri)
focal_class.class_method_signature: Server.accounts()
focal_class.full_signature: public AccountsRequestBuilder accounts()
focal_class.identifier: accounts
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: AccountsRequestBuilder
focal_class.signature: AccountsRequestBuilder accounts()
focal_class.class_method_signature: Server.effects()
focal_class.full_signature: public EffectsRequestBuilder effects()
focal_class.identifier: effects
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: EffectsRequestBuilder
focal_class.signature: EffectsRequestBuilder effects()
focal_class.class_method_signature: Server.ledgers()
focal_class.full_signature: public LedgersRequestBuilder ledgers()
focal_class.identifier: ledgers
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: LedgersRequestBuilder
focal_class.signature: LedgersRequestBuilder ledgers()
focal_class.class_method_signature: Server.offers()
focal_class.full_signature: public OffersRequestBuilder offers()
focal_class.identifier: offers
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: OffersRequestBuilder
focal_class.signature: OffersRequestBuilder offers()
focal_class.class_method_signature: Server.operations()
focal_class.full_signature: public OperationsRequestBuilder operations()
focal_class.identifier: operations
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: OperationsRequestBuilder
focal_class.signature: OperationsRequestBuilder operations()
focal_class.class_method_signature: Server.orderBook()
focal_class.full_signature: public OrderBookRequestBuilder orderBook()
focal_class.identifier: orderBook
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: OrderBookRequestBuilder
focal_class.signature: OrderBookRequestBuilder orderBook()
focal_class.class_method_signature: Server.trades()
focal_class.full_signature: public TradesRequestBuilder trades()
focal_class.identifier: trades
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: TradesRequestBuilder
focal_class.signature: TradesRequestBuilder trades()
focal_class.class_method_signature: Server.paths()
focal_class.full_signature: public PathsRequestBuilder paths()
focal_class.identifier: paths
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: PathsRequestBuilder
focal_class.signature: PathsRequestBuilder paths()
focal_class.class_method_signature: Server.payments()
focal_class.full_signature: public PaymentsRequestBuilder payments()
focal_class.identifier: payments
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: PaymentsRequestBuilder
focal_class.signature: PaymentsRequestBuilder payments()
focal_class.class_method_signature: Server.transactions()
focal_class.full_signature: public TransactionsRequestBuilder transactions()
focal_class.identifier: transactions
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: TransactionsRequestBuilder
focal_class.signature: TransactionsRequestBuilder transactions()
focal_class.class_method_signature: Server.submitTransaction(Transaction transaction, String url)
focal_class.full_signature: private SubmitTransactionResponse submitTransaction(Transaction transaction, String url)
focal_class.identifier: submitTransaction
focal_class.modifiers: private
focal_class.parameters: (Transaction transaction, String url)
focal_class.return: SubmitTransactionResponse
focal_class.signature: SubmitTransactionResponse submitTransaction(Transaction transaction, String url)
focal_class.class_method_signature: Server.submitTransaction(Transaction transaction)
focal_class.full_signature: public SubmitTransactionResponse submitTransaction(Transaction transaction)
focal_class.identifier: submitTransaction
focal_class.modifiers: public
focal_class.parameters: (Transaction transaction)
focal_class.return: SubmitTransactionResponse
focal_class.signature: SubmitTransactionResponse submitTransaction(Transaction transaction)
focal_class.class_method_signature: Server.getUri(String url)
focal_class.full_signature: private URI getUri(String url)
focal_class.identifier: getUri
focal_class.modifiers: private
focal_class.parameters: (String url)
focal_class.return: URI
focal_class.signature: URI getUri(String url)
focal_class.class_method_signature: Server.setHttpClient(OkHttpClient httpClient)
focal_class.full_signature:  void setHttpClient(OkHttpClient httpClient)
focal_class.identifier: setHttpClient
focal_class.parameters: (OkHttpClient httpClient)
focal_class.return: void
focal_class.signature: void setHttpClient(OkHttpClient httpClient)
focal_method.body: private SubmitTransactionResponse submitTransaction(Transaction transaction, String url) throws IOException {
          URI transactionsUri = getUri(url);
  
          RequestBody formBody = new FormBody.Builder()
                  .add("tx", transaction.toEnvelopeXdrBase64())
                  .build();
          Request request = new Request.Builder()
                  .url(transactionsUri.toString())
                  .post(formBody)
                  .build();
  
          Response response = null;
          try {
              response = httpClient.newCall(request).execute();
  
              if (response != null) {
                  String location = response.header(LOCATION_HEADER);
                  if (response.code() == TEMPORARY_REDIRECT && location != null) {
                      return submitTransaction(transaction, location);
                  } else {
                      ResponseBody body = response.body();
                      if (body != null) {
                          String responseString = body.string();
                          return GsonSingleton.getInstance().fromJson(responseString, SubmitTransactionResponse.class);
                      }
                  }
              }
          } finally {
              if (response != null) {
                  response.close();
              }
          }
          return null;
      }
focal_method.class_method_signature: Server.submitTransaction(Transaction transaction, String url)
focal_method.full_signature: private SubmitTransactionResponse submitTransaction(Transaction transaction, String url)
focal_method.identifier: submitTransaction
focal_method.invocations: getUri build add toEnvelopeXdrBase64 build post url toString execute newCall header code submitTransaction body string fromJson getInstance close
focal_method.modifiers: private
focal_method.parameters: (Transaction transaction, String url)
focal_method.return: SubmitTransactionResponse
focal_method.signature: SubmitTransactionResponse submitTransaction(Transaction transaction, String url)