@Test
public void shouldRemoveHistoriesAfterSuccessfulSync() throws Exception {

    Child childSpy = spy(new Child("{\"_id\" : \"couch_id\", \"child_name\":\"subhas\",\"unique_identifier\":\"78223s4h1e468f5200edc\"}"));
    doReturn(false).when(childSpy).isNew();
    childHttpDao = mock(EntityHttpDao.class);
    doReturn(childSpy).when(childHttpDao).update(eq(childSpy), anyString(), any(Map.class));
    GenericSyncService<Child> syncService = new GenericSyncService<Child>(mediaSyncHelper, childHttpDao, repository);
    syncService.sync(childSpy, "");
    verify(childSpy).remove(History.HISTORIES);
}