@Test
public void handleInsertOrUpdateForNewFileButStaleReceipt() {

    when(driveStreamsManager.uploadFileToDrive(syncState1, file)).thenReturn(Single.just(newSyncState1));
    when(syncState1.getSyncId(SyncProvider.GoogleDrive)).thenReturn(null);
    when(syncState1.isSynced(SyncProvider.GoogleDrive)).thenReturn(false);
    when(syncState1.isMarkedForDeletion(SyncProvider.GoogleDrive)).thenReturn(false);
    when(receipt1.getFile()).thenReturn(file);
    when(file.exists()).thenReturn(true);
    when(receiptsTable.findByPrimaryKey(RECEIPT_1_PRIMARY_KEY)).thenReturn(Single.just(mock(Receipt.class)));
    driveReceiptsManager.handleInsertOrUpdate(receipt1);
    verify(receiptTableController, never()).update(receiptCaptor.capture(), updatedReceiptCaptor.capture(), operationMetadataCaptor.capture());
}