### Question:
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);  }### Answer:
@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()); }
@Test public void getStreamConnectionDetailsFromUrl() { 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 + "\"}") )); HttpUrl url = HttpUrl.parse(wireMockRule.baseUrl() + "/" + testClient); StreamConnectionDetails response = client.getStreamConnectionDetails(url); assertThat(response) .isEqualTo(StreamConnectionDetails.builder() .destinationAddress(InterledgerAddress.of(wiremockIlpAddress + "." + testClient)) .sharedSecret(SharedSecret.of(sharedSecret)) .build()); }
@Test(expected = InvalidReceiverClientException.class) public void getStreamConnectionDetails404ThrowsInvalidReceiver() { String testClient = "testClient"; stubFor(get(urlEqualTo("/" + testClient)) .withHeader("Accept", equalTo(SpspClient.APPLICATION_SPSP4_JSON_VALUE)) .willReturn(aResponse() .withStatus(404) )); client.getStreamConnectionDetails(paymentPointer(testClient)); }
@Test(expected = SpspClientException.class) public void getStreamConnectionDetails500ThrowsSpspClientException() { String testClient = "testClient"; stubFor(get(urlEqualTo("/" + testClient)) .withHeader("Accept", equalTo(SpspClient.APPLICATION_SPSP4_JSON_VALUE)) .willReturn(aResponse() .withStatus(503) )); client.getStreamConnectionDetails(paymentPointer(testClient)); }