@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void initializeUploadFailsWith422CodeAndSmartReceiptsApiExceptionWithListOfUnknownErrors() {

    // Configure
    final SmartReceiptsApiErrorResponse errorResponse = new SmartReceiptsApiErrorResponse(Arrays.asList("error1", "error2", "error3"));
    final SmartReceiptsApiException smartReceiptsApiException = new SmartReceiptsApiException(Response.error(422, retrofitResponseBody), new Exception("test"), errorResponse);
    when(purchaseManager.getAllOwnedPurchases()).thenReturn(Observable.just(Collections.singleton(managedProduct)));
    when(mobileAppPurchasesService.addPurchase(any(PurchaseRequest.class))).thenReturn(Observable.error(smartReceiptsApiException));
    // Test
    ocrPurchaseTracker.initialize();
    // Verify
    verify(purchaseManager).addEventListener(ocrPurchaseTracker);
    verify(localOcrScansTracker).setRemainingScans(REMAINING_SCANS);
    verify(defaultInAppPurchaseConsumer, never()).consumePurchase(any(ManagedProduct.class), any(PurchaseFamily.class));
}