@Test
public void onUpdateException() throws Exception {

    final KeyedObject oldItem = new KeyedObject();
    final KeyedObject newItem = new KeyedObject();
    final Exception e = new Exception();
    final DatabaseOperationMetadata databaseOperationMetadata = new DatabaseOperationMetadata();
    when(mTableActionAlterations.preUpdate(oldItem, newItem)).thenReturn(Single.just(newItem));
    when(mTable.update(oldItem, newItem, databaseOperationMetadata)).thenReturn(Single.error(e));
    when(mTableActionAlterations.postUpdate(oldItem, newItem)).thenReturn(Single.just(newItem));
    mAbstractTableController.unsubscribe(mListener2);
    mAbstractTableController.update(oldItem, newItem, databaseOperationMetadata);
    verify(mAnalytics).record(any(ErrorEvent.class));
    verify(mListener1).onUpdateFailure(oldItem, e, databaseOperationMetadata);
    verify(mListener3).onUpdateFailure(oldItem, e, databaseOperationMetadata);
    verifyZeroInteractions(mListener2);
}