@Test
public void onPurchaseSuccessSucceedsButConsumeFails() {

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