test_class.declarator: successResponse =
              "{\"stellar_address\":\"bob*stellar.org\",\"account_id\":\"GCW667JUHCOP5Y7KY6KGDHNPHFM4CS3FCBQ7QWDUALXTX3PGXLSOEALY\"}"
test_class.modifier: private final
test_class.original_string: private final String successResponse =
              "{\"stellar_address\":\"bob*stellar.org\",\"account_id\":\"GCW667JUHCOP5Y7KY6KGDHNPHFM4CS3FCBQ7QWDUALXTX3PGXLSOEALY\"}";
test_class.type: String
test_class.var_name: successResponse
test_class.declarator: successResponseWithMemo =
              "{\"stellar_address\":\"bob*stellar.org\",\"account_id\":\"GCW667JUHCOP5Y7KY6KGDHNPHFM4CS3FCBQ7QWDUALXTX3PGXLSOEALY\", \"memo_type\": \"text\", \"memo\": \"test\"}"
test_class.modifier: private final
test_class.original_string: private final String successResponseWithMemo =
              "{\"stellar_address\":\"bob*stellar.org\",\"account_id\":\"GCW667JUHCOP5Y7KY6KGDHNPHFM4CS3FCBQ7QWDUALXTX3PGXLSOEALY\", \"memo_type\": \"text\", \"memo\": \"test\"}";
test_class.type: String
test_class.var_name: successResponseWithMemo
test_class.declarator: notFoundResponse =
              "{\"code\":\"not_found\",\"message\":\"Account not found\"}"
test_class.modifier: private final
test_class.original_string: private final String notFoundResponse =
              "{\"code\":\"not_found\",\"message\":\"Account not found\"}";
test_class.type: String
test_class.var_name: notFoundResponse
test_class.declarator: stellarToml =
              "FEDERATION_SERVER = \"https://api.stellar.org/federation\""
test_class.modifier: private final
test_class.original_string: private final String stellarToml =
              "FEDERATION_SERVER = \"https://api.stellar.org/federation\"";
test_class.type: String
test_class.var_name: stellarToml
test_class.declarator: fakeClient
test_class.modifier: private
test_class.original_string: private OkHttpClient fakeClient;
test_class.type: OkHttpClient
test_class.var_name: fakeClient
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: server
test_class.modifier: private
test_class.original_string: private FederationServer server;
test_class.type: FederationServer
test_class.var_name: server
test_class.file: kin-sdk/kin-base/src/test/java/kin/base/federation/FederationServerTest.java
test_class.identifier: FederationServerTest
test_class.superclass: extends TestCase
test_case.body: @Test
      public void testNameFederationSuccess() throws IOException {
          mockWebServer.enqueue(
                  new MockResponse()
                          .setResponseCode(200)
                          .setBody(successResponse)
          );
  
          FederationResponse response = server.resolveAddress("bob*stellar.org");
          assertEquals(response.getStellarAddress(), "bob*stellar.org");
          assertEquals(response.getAccountId(), "GCW667JUHCOP5Y7KY6KGDHNPHFM4CS3FCBQ7QWDUALXTX3PGXLSOEALY");
          assertNull(response.getMemoType());
          assertNull(response.getMemo());
      }
test_case.class_method_signature: FederationServerTest.testNameFederationSuccess()
test_case.full_signature: @Test public void testNameFederationSuccess()
test_case.identifier: testNameFederationSuccess
test_case.invocations: enqueue setBody setResponseCode resolveAddress assertEquals getStellarAddress assertEquals getAccountId assertNull getMemoType assertNull getMemo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNameFederationSuccess()
focal_class.declarator: serverUri
focal_class.modifier: private final
focal_class.original_string: private final URL serverUri;
focal_class.type: URL
focal_class.var_name: serverUri
focal_class.declarator: domain
focal_class.modifier: private final
focal_class.original_string: private final String domain;
focal_class.type: String
focal_class.var_name: domain
focal_class.declarator: httpClient = new OkHttpClient()
focal_class.modifier: private static
focal_class.original_string: private static OkHttpClient httpClient = new OkHttpClient();
focal_class.type: OkHttpClient
focal_class.var_name: httpClient
focal_class.file: kin-sdk/kin-base/src/main/java/kin/base/federation/FederationServer.java
focal_class.identifier: FederationServer
focal_class.class_method_signature: FederationServer.FederationServer(URL serverUri, String domain)
focal_class.full_signature: public  FederationServer(URL serverUri, String domain)
focal_class.identifier: FederationServer
focal_class.modifiers: public
focal_class.parameters: (URL serverUri, String domain)
focal_class.signature:  FederationServer(URL serverUri, String domain)
focal_class.class_method_signature: FederationServer.FederationServer(String serverUri, String domain)
focal_class.full_signature: public  FederationServer(String serverUri, String domain)
focal_class.identifier: FederationServer
focal_class.modifiers: public
focal_class.parameters: (String serverUri, String domain)
focal_class.signature:  FederationServer(String serverUri, String domain)
focal_class.class_method_signature: FederationServer.createForDomain(String domain)
focal_class.full_signature: public static FederationServer createForDomain(String domain)
focal_class.identifier: createForDomain
focal_class.modifiers: public static
focal_class.parameters: (String domain)
focal_class.return: FederationServer
focal_class.signature: FederationServer createForDomain(String domain)
focal_class.class_method_signature: FederationServer.resolveAddress(String address)
focal_class.full_signature: public FederationResponse resolveAddress(String address)
focal_class.identifier: resolveAddress
focal_class.modifiers: public
focal_class.parameters: (String address)
focal_class.return: FederationResponse
focal_class.signature: FederationResponse resolveAddress(String address)
focal_class.class_method_signature: FederationServer.getServerUri()
focal_class.full_signature: public URL getServerUri()
focal_class.identifier: getServerUri
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getServerUri()
focal_class.class_method_signature: FederationServer.getDomain()
focal_class.full_signature: public String getDomain()
focal_class.identifier: getDomain
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDomain()
focal_class.class_method_signature: FederationServer.setHttpClient(OkHttpClient httpClient)
focal_class.full_signature: static void setHttpClient(OkHttpClient httpClient)
focal_class.identifier: setHttpClient
focal_class.modifiers: static
focal_class.parameters: (OkHttpClient httpClient)
focal_class.return: void
focal_class.signature: void setHttpClient(OkHttpClient httpClient)
focal_method.body: public FederationResponse resolveAddress(String address) {
          String[] tokens = address.split("\\*");
          if (tokens.length != 2) {
              throw new MalformedAddressException();
          }
  
          URL uri = HttpUrl.parse(serverUri.toString()).newBuilder()
                  .addQueryParameter("type", "name")
                  .addQueryParameter("q", address)
                  .build().url();
  
          TypeToken type = new TypeToken<FederationResponse>() {
          };
          ResponseHandler<FederationResponse> responseHandler = new ResponseHandler<FederationResponse>(httpClient, type);
  
          Request request = new Request.Builder()
                  .url(uri.toString())
                  .get()
                  .build();
  
          try {
              Response response = httpClient.newCall(request)
                      .execute();
              return responseHandler.handleResponse(response);
          } catch (HttpResponseException e) {
              if (e.getStatusCode() == 404) {
                  throw new NotFoundException();
              } else {
                  throw new ServerErrorException();
              }
          } catch (IOException e) {
              throw new ConnectionErrorException();
          }
      }
focal_method.class_method_signature: FederationServer.resolveAddress(String address)
focal_method.full_signature: public FederationResponse resolveAddress(String address)
focal_method.identifier: resolveAddress
focal_method.invocations: split url build addQueryParameter addQueryParameter newBuilder parse toString build get url toString execute newCall handleResponse getStatusCode
focal_method.modifiers: public
focal_method.parameters: (String address)
focal_method.return: FederationResponse
focal_method.signature: FederationResponse resolveAddress(String address)