@Test public void successAtTheMiddleCall() { new StrictExpectations() {{ clientBuilder.build(); result = client; client.register(any); result = client; client.target("https: result = new WebApplicationException(); client.target("https: result = new WebApplicationException(); client.target("https: result = "SUCCESS"; }}; cloudstoreClient = new CloudStoreRestClient("https: String result = cloudstoreClient.getBaseUrl(); assertThat(result).isEqualTo("https: new Verifications() {{ client.target("https: }}; }
public synchronized String getBaseUrl() { if (baseURL == null) { determineBaseUrl(); } return baseURL; }
CloudStoreRestClient { public synchronized String getBaseUrl() { if (baseURL == null) { determineBaseUrl(); } return baseURL; } }
CloudStoreRestClient { public synchronized String getBaseUrl() { if (baseURL == null) { determineBaseUrl(); } return baseURL; } CloudStoreRestClient(final URL url, final ClientBuilder clientBuilder);  CloudStoreRestClient(final String url, final ClientBuilder clientBuilder); }
CloudStoreRestClient { public synchronized String getBaseUrl() { if (baseURL == null) { determineBaseUrl(); } return baseURL; } CloudStoreRestClient(final URL url, final ClientBuilder clientBuilder);  CloudStoreRestClient(final String url, final ClientBuilder clientBuilder); synchronized String getBaseUrl(); R execute(final Request<R> request); Invocation.Builder assignCredentials(final Invocation.Builder builder); Client getClientOrFail(); CredentialsProvider getCredentialsProvider(); void setCredentialsProvider(final CredentialsProvider credentialsProvider); }
CloudStoreRestClient { public synchronized String getBaseUrl() { if (baseURL == null) { determineBaseUrl(); } return baseURL; } CloudStoreRestClient(final URL url, final ClientBuilder clientBuilder);  CloudStoreRestClient(final String url, final ClientBuilder clientBuilder); synchronized String getBaseUrl(); R execute(final Request<R> request); Invocation.Builder assignCredentials(final Invocation.Builder builder); Client getClientOrFail(); CredentialsProvider getCredentialsProvider(); void setCredentialsProvider(final CredentialsProvider credentialsProvider);  }