@Test
public void onPurchaseSuccessUploadFails() {

    // Configure
    when(mobileAppPurchasesService.addPurchase(any(PurchaseRequest.class))).thenReturn(Observable.error(new Exception("test")));
    // Test
    ocrPurchaseTracker.onPurchaseSuccess(InAppPurchase.OcrScans50, PurchaseSource.Unknown);
    // Verify
    verify(defaultInAppPurchaseConsumer, never()).consumePurchase(any(ManagedProduct.class), any(PurchaseFamily.class));
    verify(localOcrScansTracker, never()).setRemainingScans(REMAINING_SCANS);
}