@Test public void validateVoucher_passCode_invokeApiValidateVoucherWithRightQuery() throws Exception { validation.validate("SAMPLE_CODE"); Map<String, String> expectedQueryParams = new LinkedHashMap<>(); expectedQueryParams.put("channel", "android"); expectedQueryParams.put("code", "SAMPLE_CODE"); verify(api, times(1)).validateVoucher(expectedQueryParams); }
public PromotionResponse validate(ValidationContext context) throws IOException { Map<String, String> queryParams = createQueryParamsForContext(context); return api.validatePromotion(queryParams).execute().body(); }
Validation extends AbsModule<Validation.ExtAsync, Validation.ExtRxJava> { public PromotionResponse validate(ValidationContext context) throws IOException { Map<String, String> queryParams = createQueryParamsForContext(context); return api.validatePromotion(queryParams).execute().body(); } }
Validation extends AbsModule<Validation.ExtAsync, Validation.ExtRxJava> { public PromotionResponse validate(ValidationContext context) throws IOException { Map<String, String> queryParams = createQueryParamsForContext(context); return api.validatePromotion(queryParams).execute().body(); } Validation(VoucherifyApi api, Scheduler scheduler, String trackingId); }
Validation extends AbsModule<Validation.ExtAsync, Validation.ExtRxJava> { public PromotionResponse validate(ValidationContext context) throws IOException { Map<String, String> queryParams = createQueryParamsForContext(context); return api.validatePromotion(queryParams).execute().body(); } Validation(VoucherifyApi api, Scheduler scheduler, String trackingId); PromotionResponse validate(ValidationContext context); VoucherResponse validate(String code); VoucherResponse validate(String code, ValidationContext context); }
Validation extends AbsModule<Validation.ExtAsync, Validation.ExtRxJava> { public PromotionResponse validate(ValidationContext context) throws IOException { Map<String, String> queryParams = createQueryParamsForContext(context); return api.validatePromotion(queryParams).execute().body(); } Validation(VoucherifyApi api, Scheduler scheduler, String trackingId); PromotionResponse validate(ValidationContext context); VoucherResponse validate(String code); VoucherResponse validate(String code, ValidationContext context);  }