@Test public void getStreamConnectionDetailsFromPaymentPointer() { String testClient = "testClient"; String sharedSecret = "Nf9wCXI1OZLM/QIWdZZ2Q39limh6+Yxhm/FB1bUpZLA="; String wiremockIlpAddress = "test.wiremock"; stubFor(get(urlEqualTo("/" + testClient)) .withHeader("Accept", equalTo(SpspClient.APPLICATION_SPSP4_JSON_VALUE)) .willReturn(aResponse() .withStatus(200) .withBody("{\"destination_account\":\"" + wiremockIlpAddress + "." + testClient + "\"," + "\"shared_secret\":\"" + sharedSecret + "\"}") )); StreamConnectionDetails response = client.getStreamConnectionDetails(paymentPointer(testClient)); assertThat(response) .isEqualTo(StreamConnectionDetails.builder() .destinationAddress(InterledgerAddress.of(wiremockIlpAddress + "." + testClient)) .sharedSecret(SharedSecret.of(sharedSecret)) .build()); }
@Override public StreamConnectionDetails getStreamConnectionDetails(final PaymentPointer paymentPointer) throws InvalidReceiverClientException { Objects.requireNonNull(paymentPointer); return getStreamConnectionDetails(paymentPointerResolver.resolveHttpUrl(paymentPointer)); }
SimpleSpspClient implements SpspClient { @Override public StreamConnectionDetails getStreamConnectionDetails(final PaymentPointer paymentPointer) throws InvalidReceiverClientException { Objects.requireNonNull(paymentPointer); return getStreamConnectionDetails(paymentPointerResolver.resolveHttpUrl(paymentPointer)); } }
SimpleSpspClient implements SpspClient { @Override public StreamConnectionDetails getStreamConnectionDetails(final PaymentPointer paymentPointer) throws InvalidReceiverClientException { Objects.requireNonNull(paymentPointer); return getStreamConnectionDetails(paymentPointerResolver.resolveHttpUrl(paymentPointer)); } SimpleSpspClient();  SimpleSpspClient(
      final OkHttpClient httpClient, final PaymentPointerResolver paymentPointerResolver,
      final ObjectMapper objectMapper
  ); }
SimpleSpspClient implements SpspClient { @Override public StreamConnectionDetails getStreamConnectionDetails(final PaymentPointer paymentPointer) throws InvalidReceiverClientException { Objects.requireNonNull(paymentPointer); return getStreamConnectionDetails(paymentPointerResolver.resolveHttpUrl(paymentPointer)); } SimpleSpspClient();  SimpleSpspClient(
      final OkHttpClient httpClient, final PaymentPointerResolver paymentPointerResolver,
      final ObjectMapper objectMapper
  ); @Override StreamConnectionDetails getStreamConnectionDetails(final PaymentPointer paymentPointer); @Override StreamConnectionDetails getStreamConnectionDetails(final HttpUrl spspUrl); }
SimpleSpspClient implements SpspClient { @Override public StreamConnectionDetails getStreamConnectionDetails(final PaymentPointer paymentPointer) throws InvalidReceiverClientException { Objects.requireNonNull(paymentPointer); return getStreamConnectionDetails(paymentPointerResolver.resolveHttpUrl(paymentPointer)); } SimpleSpspClient();  SimpleSpspClient(
      final OkHttpClient httpClient, final PaymentPointerResolver paymentPointerResolver,
      final ObjectMapper objectMapper
  ); @Override StreamConnectionDetails getStreamConnectionDetails(final PaymentPointer paymentPointer); @Override StreamConnectionDetails getStreamConnectionDetails(final HttpUrl spspUrl);  }