@Test public void hitMock() { List<Contributor> contributors = github.contributors("netflix", "feign"); assertThat(contributors, hasSize(30)); mockClient.verifyStatus(); }
public void verifyStatus() { if (sequential) { boolean unopenedIterator = responseIterator == null && !responses.isEmpty(); if (unopenedIterator || responseIterator.hasNext()) { throw new VerificationAssertionError("More executions were expected"); } } }
MockClient implements Client { public void verifyStatus() { if (sequential) { boolean unopenedIterator = responseIterator == null && !responses.isEmpty(); if (unopenedIterator || responseIterator.hasNext()) { throw new VerificationAssertionError("More executions were expected"); } } } }
MockClient implements Client { public void verifyStatus() { if (sequential) { boolean unopenedIterator = responseIterator == null && !responses.isEmpty(); if (unopenedIterator || responseIterator.hasNext()) { throw new VerificationAssertionError("More executions were expected"); } } } MockClient();  MockClient(boolean sequential); }
MockClient implements Client { public void verifyStatus() { if (sequential) { boolean unopenedIterator = responseIterator == null && !responses.isEmpty(); if (unopenedIterator || responseIterator.hasNext()) { throw new VerificationAssertionError("More executions were expected"); } } } MockClient();  MockClient(boolean sequential); @Override synchronized Response execute(Request request, Request.Options options); MockClient ok(HttpMethod method, String url, InputStream responseBody); MockClient ok(HttpMethod method, String url, String responseBody); MockClient ok(HttpMethod method, String url, byte[] responseBody); MockClient ok(HttpMethod method, String url); MockClient ok(RequestKey requestKey, InputStream responseBody); MockClient ok(RequestKey requestKey, String responseBody); MockClient ok(RequestKey requestKey, byte[] responseBody); MockClient ok(RequestKey requestKey); MockClient add(HttpMethod method, String url, int status, InputStream responseBody); MockClient add(HttpMethod method, String url, int status, String responseBody); MockClient add(HttpMethod method, String url, int status, byte[] responseBody); MockClient add(HttpMethod method, String url, int status); MockClient add(HttpMethod method, String url, Response.Builder response); MockClient add(RequestKey requestKey, int status, InputStream responseBody); MockClient add(RequestKey requestKey, int status, String responseBody); MockClient add(RequestKey requestKey, int status, byte[] responseBody); MockClient add(RequestKey requestKey, int status); MockClient add(RequestKey requestKey, Response.Builder response); @Deprecated MockClient add(HttpMethod method, String url, Response response); MockClient noContent(HttpMethod method, String url); Request verifyOne(HttpMethod method, String url); List<Request> verifyTimes(final HttpMethod method, final String url, final int times); void verifyNever(HttpMethod method, String url); void verifyStatus(); void resetRequests(); }
MockClient implements Client { public void verifyStatus() { if (sequential) { boolean unopenedIterator = responseIterator == null && !responses.isEmpty(); if (unopenedIterator || responseIterator.hasNext()) { throw new VerificationAssertionError("More executions were expected"); } } } MockClient();  MockClient(boolean sequential); @Override synchronized Response execute(Request request, Request.Options options); MockClient ok(HttpMethod method, String url, InputStream responseBody); MockClient ok(HttpMethod method, String url, String responseBody); MockClient ok(HttpMethod method, String url, byte[] responseBody); MockClient ok(HttpMethod method, String url); MockClient ok(RequestKey requestKey, InputStream responseBody); MockClient ok(RequestKey requestKey, String responseBody); MockClient ok(RequestKey requestKey, byte[] responseBody); MockClient ok(RequestKey requestKey); MockClient add(HttpMethod method, String url, int status, InputStream responseBody); MockClient add(HttpMethod method, String url, int status, String responseBody); MockClient add(HttpMethod method, String url, int status, byte[] responseBody); MockClient add(HttpMethod method, String url, int status); MockClient add(HttpMethod method, String url, Response.Builder response); MockClient add(RequestKey requestKey, int status, InputStream responseBody); MockClient add(RequestKey requestKey, int status, String responseBody); MockClient add(RequestKey requestKey, int status, byte[] responseBody); MockClient add(RequestKey requestKey, int status); MockClient add(RequestKey requestKey, Response.Builder response); @Deprecated MockClient add(HttpMethod method, String url, Response response); MockClient noContent(HttpMethod method, String url); Request verifyOne(HttpMethod method, String url); List<Request> verifyTimes(final HttpMethod method, final String url, final int times); void verifyNever(HttpMethod method, String url); void verifyStatus(); void resetRequests();  }