@Test public void testSyncEnabledCached() throws IOException { HackerNewsItem hnItem = mock(HackerNewsItem.class); Call<HackerNewsItem> call = mock(Call.class); when(call.execute()).thenReturn(Response.success(hnItem)); when(TestRestServiceFactory.hnRestService.cachedItem(any())).thenReturn(call); syncScheduler.scheduleSync(service, "1"); adapter.onPerformSync(mock(Account.class), getLastSyncExtras(), null, null, null); verify(TestRestServiceFactory.hnRestService).cachedItem(any()); verify(TestRestServiceFactory.hnRestService, never()).networkItem(any()); assertThat(syncPreferences.getAll()).isEmpty(); }
@Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { createSyncDelegate().performSync(new SyncDelegate.Job(extras)); }
ItemSyncAdapter extends AbstractThreadedSyncAdapter { @Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { createSyncDelegate().performSync(new SyncDelegate.Job(extras)); } }
ItemSyncAdapter extends AbstractThreadedSyncAdapter { @Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { createSyncDelegate().performSync(new SyncDelegate.Job(extras)); } ItemSyncAdapter(Context context, RestServiceFactory factory,
                           ReadabilityClient readabilityClient); }
ItemSyncAdapter extends AbstractThreadedSyncAdapter { @Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { createSyncDelegate().performSync(new SyncDelegate.Job(extras)); } ItemSyncAdapter(Context context, RestServiceFactory factory,
                           ReadabilityClient readabilityClient); @Override void onPerformSync(Account account, Bundle extras, String authority,
                              ContentProviderClient provider, SyncResult syncResult); }
ItemSyncAdapter extends AbstractThreadedSyncAdapter { @Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { createSyncDelegate().performSync(new SyncDelegate.Job(extras)); } ItemSyncAdapter(Context context, RestServiceFactory factory,
                           ReadabilityClient readabilityClient); @Override void onPerformSync(Account account, Bundle extras, String authority,
                              ContentProviderClient provider, SyncResult syncResult);  }