@Test
public void uploadFileToDriveWithSyncState() throws Exception {

    final java.io.File file = new java.io.File("/");
    when(driveDataStreams.getSmartReceiptsFolder()).thenReturn(Observable.just(driveFile));
    when(driveDataStreams.createFileInFolder(driveFile, file)).thenReturn(Single.just(driveFile));
    when(driveStreamMappings.postInsertSyncState(driveFile)).thenReturn(newSyncState);
    final TestObserver<SyncState> testObserver = driveStreamsManager.uploadFileToDrive(currentSyncState, file).test();
    testObserver.assertValue(newSyncState);
    testObserver.assertComplete();
    testObserver.assertNoErrors();
}