@Test
public void consumePurchaseThrowsRemoteException() throws Exception {

    // Configure
    when(consumablePurchase.getPurchaseToken()).thenReturn(PURCHASE_TOKEN);
    when(inAppBillingService.consumePurchase(3, packageName, PURCHASE_TOKEN)).thenThrow(new RemoteException());
    // Test
    purchaseManager.consumePurchase(consumablePurchase).test()
            // Verify
            .assertNoValues()
            .assertNotComplete()
            .assertError(RemoteException.class);
}