@Test public void handleInsertOrUpdateForNonExistingNewFile() { when(driveStreamMappings.postInsertSyncState()).thenReturn(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(false); driveReceiptsManager.handleInsertOrUpdate(receipt1); verify(receiptTableController).update(receiptCaptor.capture(), updatedReceiptCaptor.capture(), operationMetadataCaptor.capture()); assertNotNull(receiptCaptor.getValue()); assertEquals(receipt1, updatedReceiptCaptor.getValue()); assertEquals(newSyncState1, updatedReceiptCaptor.getValue().getSyncState()); assertEquals(OperationFamilyType.Sync, operationMetadataCaptor.getValue().getOperationFamilyType()); }
public synchronized void handleInsertOrUpdate(@NonNull final Receipt receipt) { if (!mIsInitializing.get()) { handleInsertOrUpdateInternal(receipt); } }
DriveReceiptsManager { public synchronized void handleInsertOrUpdate(@NonNull final Receipt receipt) { if (!mIsInitializing.get()) { handleInsertOrUpdateInternal(receipt); } } }
DriveReceiptsManager { public synchronized void handleInsertOrUpdate(@NonNull final Receipt receipt) { if (!mIsInitializing.get()) { handleInsertOrUpdateInternal(receipt); } } DriveReceiptsManager(@NonNull TableController<Receipt> receiptsTableController, @NonNull TripsTable tripsTable,
                                @NonNull ReceiptsTable receiptsTable, @NonNull DriveStreamsManager driveTaskManager,
                                @NonNull DriveDatabaseManager driveDatabaseManager, @NonNull NetworkManager networkManager,
                                @NonNull Analytics analytics);  DriveReceiptsManager(@NonNull TableController<Receipt> receiptsTableController,
                                @NonNull TripsTable tripsTable,
                                @NonNull ReceiptsTable receiptsTable,
                                @NonNull DriveStreamsManager driveTaskManager,
                                @NonNull DriveDatabaseManager driveDatabaseManager,
                                @NonNull NetworkManager networkManager,
                                @NonNull Analytics analytics,
                                @NonNull DriveStreamMappings driveStreamMappings,
                                @NonNull ReceiptBuilderFactoryFactory receiptBuilderFactoryFactory,
                                @NonNull Scheduler observeOnScheduler,
                                @NonNull Scheduler subscribeOnScheduler); }
DriveReceiptsManager { public synchronized void handleInsertOrUpdate(@NonNull final Receipt receipt) { if (!mIsInitializing.get()) { handleInsertOrUpdateInternal(receipt); } } DriveReceiptsManager(@NonNull TableController<Receipt> receiptsTableController, @NonNull TripsTable tripsTable,
                                @NonNull ReceiptsTable receiptsTable, @NonNull DriveStreamsManager driveTaskManager,
                                @NonNull DriveDatabaseManager driveDatabaseManager, @NonNull NetworkManager networkManager,
                                @NonNull Analytics analytics);  DriveReceiptsManager(@NonNull TableController<Receipt> receiptsTableController,
                                @NonNull TripsTable tripsTable,
                                @NonNull ReceiptsTable receiptsTable,
                                @NonNull DriveStreamsManager driveTaskManager,
                                @NonNull DriveDatabaseManager driveDatabaseManager,
                                @NonNull NetworkManager networkManager,
                                @NonNull Analytics analytics,
                                @NonNull DriveStreamMappings driveStreamMappings,
                                @NonNull ReceiptBuilderFactoryFactory receiptBuilderFactoryFactory,
                                @NonNull Scheduler observeOnScheduler,
                                @NonNull Scheduler subscribeOnScheduler); @SuppressLint("CheckResult") synchronized void syncReceipts(); synchronized void enable(); synchronized void disable(); synchronized void handleInsertOrUpdate(@NonNull final Receipt receipt); synchronized void handleDelete(@NonNull final Receipt receipt); }
DriveReceiptsManager { public synchronized void handleInsertOrUpdate(@NonNull final Receipt receipt) { if (!mIsInitializing.get()) { handleInsertOrUpdateInternal(receipt); } } DriveReceiptsManager(@NonNull TableController<Receipt> receiptsTableController, @NonNull TripsTable tripsTable,
                                @NonNull ReceiptsTable receiptsTable, @NonNull DriveStreamsManager driveTaskManager,
                                @NonNull DriveDatabaseManager driveDatabaseManager, @NonNull NetworkManager networkManager,
                                @NonNull Analytics analytics);  DriveReceiptsManager(@NonNull TableController<Receipt> receiptsTableController,
                                @NonNull TripsTable tripsTable,
                                @NonNull ReceiptsTable receiptsTable,
                                @NonNull DriveStreamsManager driveTaskManager,
                                @NonNull DriveDatabaseManager driveDatabaseManager,
                                @NonNull NetworkManager networkManager,
                                @NonNull Analytics analytics,
                                @NonNull DriveStreamMappings driveStreamMappings,
                                @NonNull ReceiptBuilderFactoryFactory receiptBuilderFactoryFactory,
                                @NonNull Scheduler observeOnScheduler,
                                @NonNull Scheduler subscribeOnScheduler); @SuppressLint("CheckResult") synchronized void syncReceipts(); synchronized void enable(); synchronized void disable(); synchronized void handleInsertOrUpdate(@NonNull final Receipt receipt); synchronized void handleDelete(@NonNull final Receipt receipt);  }