@Test public void getBalance() { String bigBalance = "12345678901234567890.11111"; String testClient = "testClient"; stubFor(get(urlEqualTo("/accounts/" + testClient + "/balance")) .withHeader("Authorization", equalTo("Bearer passwordin")) .willReturn(aResponse() .withStatus(200) .withBody("{\"balance\":\"" + bigBalance + "\"}") )); BigDecimal response = client.getBalance(testClient); assertThat(response).isEqualTo(new BigDecimal(bigBalance)); }
public BigDecimal getBalance(String accountName) throws SpspClientException { return execute(requestBuilder() .url( baseUrl.newBuilder().addPathSegment("accounts").addPathSegment(accountName).addPathSegment("balance").build() ) .get() .build(), BalanceResponse.class) .getBalance(); }
InterledgerRustNodeClient { public BigDecimal getBalance(String accountName) throws SpspClientException { return execute(requestBuilder() .url( baseUrl.newBuilder().addPathSegment("accounts").addPathSegment(accountName).addPathSegment("balance").build() ) .get() .build(), BalanceResponse.class) .getBalance(); } }
InterledgerRustNodeClient { public BigDecimal getBalance(String accountName) throws SpspClientException { return execute(requestBuilder() .url( baseUrl.newBuilder().addPathSegment("accounts").addPathSegment(accountName).addPathSegment("balance").build() ) .get() .build(), BalanceResponse.class) .getBalance(); } @Deprecated  InterledgerRustNodeClient(OkHttpClient okHttpClient, String authToken, String baseUrl);  InterledgerRustNodeClient(
    final OkHttpClient okHttpClient, final String authToken, final HttpUrl baseUrl
  ); }
InterledgerRustNodeClient { public BigDecimal getBalance(String accountName) throws SpspClientException { return execute(requestBuilder() .url( baseUrl.newBuilder().addPathSegment("accounts").addPathSegment(accountName).addPathSegment("balance").build() ) .get() .build(), BalanceResponse.class) .getBalance(); } @Deprecated  InterledgerRustNodeClient(OkHttpClient okHttpClient, String authToken, String baseUrl);  InterledgerRustNodeClient(
    final OkHttpClient okHttpClient, final String authToken, final HttpUrl baseUrl
  ); RustNodeAccount createAccount(RustNodeAccount rustNodeAccount); BigDecimal getBalance(String accountName); }
InterledgerRustNodeClient { public BigDecimal getBalance(String accountName) throws SpspClientException { return execute(requestBuilder() .url( baseUrl.newBuilder().addPathSegment("accounts").addPathSegment(accountName).addPathSegment("balance").build() ) .get() .build(), BalanceResponse.class) .getBalance(); } @Deprecated  InterledgerRustNodeClient(OkHttpClient okHttpClient, String authToken, String baseUrl);  InterledgerRustNodeClient(
    final OkHttpClient okHttpClient, final String authToken, final HttpUrl baseUrl
  ); RustNodeAccount createAccount(RustNodeAccount rustNodeAccount); BigDecimal getBalance(String accountName); static final MediaType JSON; }