Redemption extends AbsModule<Redemption.ExtAsync, Redemption.ExtRxJava> { public VoucherRedemptionResult redeem(PromotionTier promotionTier, RedemptionContext redemptionContext) throws IOException { return api.redeemPromotion(promotionTier.getId(), redemptionContext, trackingId).execute().body(); } Redemption(VoucherifyApi api, Scheduler scheduler, String trackingId); VoucherRedemptionResult redeem(PromotionTier promotionTier, RedemptionContext redemptionContext); VoucherRedemptionResult redeem(String code); VoucherRedemptionResult redeem(
            String code, RedemptionContext redemptionContext);  }
@Test public void redeem_passCode_invokeRedeemVoucherWithRightParameters() throws Exception { redemption.redeem("SAMPLE_CODE"); verify(api, times(1)).redeemVoucher("SAMPLE_CODE", "TRACKING_ID"); }
@Test public void redeem_passCOdeAndContext_invokeRedeemVoucherWithRightParameters() throws Exception { RedemptionContext voucherRedemptionContext = new RedemptionContext(null); redemption.redeem("SAMPLE_CODE", voucherRedemptionContext); verify(api, times(1)).redeemVoucher("SAMPLE_CODE", voucherRedemptionContext, "TRACKING_ID"); }