@Test
public void consumePurchaseSucceeds() throws Exception {

    // Configure
    when(consumablePurchase.getPurchaseToken()).thenReturn(PURCHASE_TOKEN);
    when(inAppBillingService.consumePurchase(3, packageName, PURCHASE_TOKEN)).thenReturn(RESULT_OK);
    // Test
    purchaseManager.consumePurchase(consumablePurchase).test()
            // Verify
            .assertNoValues()
            .assertComplete()
            .assertNoErrors();
}