TrainingSyncAdapter { protected String onPerformSync() { context = LMISApp.getContext(); triggerFakeSync(); return "immediate sync up requested"; }  void requestSync();  }
@Test @Ignore public void shouldRequestTrainingSyncWhenTrainingFeatureIsOn() throws Exception { LMISTestApp.getInstance().setFeatureToggle(R.bool.feature_training, true); trainingSyncAdapter.onPerformSync(); verify(mockSyncUpManager).fakeSyncRnr(); verify(mockSyncUpManager).fakeSyncStockCards(); verify(mockSyncUpManager).fakeSyncUpCmms(); when(mockSyncUpManager.fakeSyncRnr()).thenReturn(true); when(mockSyncUpManager.fakeSyncStockCards()).thenReturn(true); trainingSyncAdapter.onPerformSync(); long lastRnrFormSyncedTimestamp = sharedPreferenceMgr.getRnrLastSyncTime(); long lastStockCardSyncedTimestamp = sharedPreferenceMgr.getStockLastSyncTime(); DateTime rnrFormDate = new DateTime(lastRnrFormSyncedTimestamp); DateTime stockCardDate = new DateTime(lastStockCardSyncedTimestamp); DateTime expectDate = new DateTime(); assertThat(rnrFormDate.getDayOfMonth(), is(expectDate.getDayOfMonth())); assertThat(rnrFormDate.getHourOfDay(), is(expectDate.getHourOfDay())); assertThat(stockCardDate.getDayOfMonth(), is(expectDate.getDayOfMonth())); assertThat(stockCardDate.getHourOfDay(), is(expectDate.getHourOfDay())); }