@Test public void listSansRetry() { NakadiClient client = spy(NakadiClient.newBuilder() .baseURI("http: .build()); OkHttpResource r0 = spy(new OkHttpResource( new OkHttpClient.Builder().build(), new GsonSupport(), mock(MetricCollector.class))); when(client.resourceProvider()).thenReturn(mock(ResourceProvider.class)); when(client.resourceProvider().newResource()).thenReturn(r0); try { new SubscriptionResourceReal(client) .list(); } catch (RetryableException | NotFoundException ignored) { } verify(r0, times(1)).okHttpRequest(Matchers.anyObject()); }
@Override public SubscriptionCollection list() throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException, NakadiException { return list(new QueryParams()); }
SubscriptionResourceReal implements SubscriptionResource { @Override public SubscriptionCollection list() throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException, NakadiException { return list(new QueryParams()); } }
SubscriptionResourceReal implements SubscriptionResource { @Override public SubscriptionCollection list() throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException, NakadiException { return list(new QueryParams()); } SubscriptionResourceReal(NakadiClient client); }
SubscriptionResourceReal implements SubscriptionResource { @Override public SubscriptionCollection list() throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException, NakadiException { return list(new QueryParams()); } SubscriptionResourceReal(NakadiClient client); @Deprecated @Override SubscriptionResource scope(String scope); @Override SubscriptionResource retryPolicy(RetryPolicy retryPolicy); @Override Response createReturningResponse(Subscription subscription); @Override Subscription create(Subscription subscription); @Override Subscription find(String id); @Override Optional<Subscription> tryFind(String id); @Override SubscriptionCollection list(); @Override SubscriptionCollection list(QueryParams params); @Override Response delete(String id); @Override CursorCommitResultCollection checkpoint(Map<String, String> context, Cursor... cursors); @Override Response reset(String id, List<Cursor> cursors); @Override SubscriptionCursorCollection cursors(String id); @Override SubscriptionEventTypeStatsCollection stats(String id); }
SubscriptionResourceReal implements SubscriptionResource { @Override public SubscriptionCollection list() throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException, NakadiException { return list(new QueryParams()); } SubscriptionResourceReal(NakadiClient client); @Deprecated @Override SubscriptionResource scope(String scope); @Override SubscriptionResource retryPolicy(RetryPolicy retryPolicy); @Override Response createReturningResponse(Subscription subscription); @Override Subscription create(Subscription subscription); @Override Subscription find(String id); @Override Optional<Subscription> tryFind(String id); @Override SubscriptionCollection list(); @Override SubscriptionCollection list(QueryParams params); @Override Response delete(String id); @Override CursorCommitResultCollection checkpoint(Map<String, String> context, Cursor... cursors); @Override Response reset(String id, List<Cursor> cursors); @Override SubscriptionCursorCollection cursors(String id); @Override SubscriptionEventTypeStatsCollection stats(String id);  }