@Test
public void shouldNotSyncChildrenIfCancelled() throws Exception {

    Child child1 = mock(Child.class);
    Child child2 = mock(Child.class);
    given(childRepository.toBeSynced()).willReturn(newArrayList(child1, child2));
    syncAllDataAsyncTask.setContext(rapidFtrActivity);
    syncAllDataAsyncTask = spy(syncAllDataAsyncTask);
    doReturn(true).when(syncAllDataAsyncTask).isCancelled();
    syncAllDataAsyncTask.onPreExecute();
    syncAllDataAsyncTask.doInBackground();
    verify(childSyncService, never()).sync(child1, currentUser);
    verify(childSyncService, never()).sync(child2, currentUser);
}