@Test @Ignore public void getCustomerRewardsReport_shouldReturnEmptyRewardsReport() { Byte minMonthlyPurchases = Byte.MAX_VALUE; Double minDollarAmountPurchased = 1000000.0; List<Customer> rewardsReport = customerService.getCustomerRewardsReport( minMonthlyPurchases, minDollarAmountPurchased); assertTrue("get customer rewards report failed - rewards report size must be 0", rewardsReport.size() == 0); }
@Nonnull public List<Customer> getCustomerRewardsReport( @Nonnull Byte minMonthlyPurchases, @Nonnull Double minDollarAmountPurchased) { checkNotNull(minMonthlyPurchases, "Argument[minMonthlyPurchases] must not be null"); checkNotNull(minDollarAmountPurchased, "Argument[minDollarAmountPurchased] must not be null"); Map<String, Object> params = new HashMap<>(); params.put("min_monthly_purchases", minMonthlyPurchases); params.put("min_dollar_amount_purchased", minDollarAmountPurchased); List<Customer> rewardsReport = customerMapper.getRewardsReport(params); Integer rewardeesCount = (Integer) params.get("count_rewardees"); logger.info(String.format("Rewardees count[%d]", rewardeesCount)); return rewardsReport; }
CustomerService { @Nonnull public List<Customer> getCustomerRewardsReport( @Nonnull Byte minMonthlyPurchases, @Nonnull Double minDollarAmountPurchased) { checkNotNull(minMonthlyPurchases, "Argument[minMonthlyPurchases] must not be null"); checkNotNull(minDollarAmountPurchased, "Argument[minDollarAmountPurchased] must not be null"); Map<String, Object> params = new HashMap<>(); params.put("min_monthly_purchases", minMonthlyPurchases); params.put("min_dollar_amount_purchased", minDollarAmountPurchased); List<Customer> rewardsReport = customerMapper.getRewardsReport(params); Integer rewardeesCount = (Integer) params.get("count_rewardees"); logger.info(String.format("Rewardees count[%d]", rewardeesCount)); return rewardsReport; } }
CustomerService { @Nonnull public List<Customer> getCustomerRewardsReport( @Nonnull Byte minMonthlyPurchases, @Nonnull Double minDollarAmountPurchased) { checkNotNull(minMonthlyPurchases, "Argument[minMonthlyPurchases] must not be null"); checkNotNull(minDollarAmountPurchased, "Argument[minDollarAmountPurchased] must not be null"); Map<String, Object> params = new HashMap<>(); params.put("min_monthly_purchases", minMonthlyPurchases); params.put("min_dollar_amount_purchased", minDollarAmountPurchased); List<Customer> rewardsReport = customerMapper.getRewardsReport(params); Integer rewardeesCount = (Integer) params.get("count_rewardees"); logger.info(String.format("Rewardees count[%d]", rewardeesCount)); return rewardsReport; }  }
CustomerService { @Nonnull public List<Customer> getCustomerRewardsReport( @Nonnull Byte minMonthlyPurchases, @Nonnull Double minDollarAmountPurchased) { checkNotNull(minMonthlyPurchases, "Argument[minMonthlyPurchases] must not be null"); checkNotNull(minDollarAmountPurchased, "Argument[minDollarAmountPurchased] must not be null"); Map<String, Object> params = new HashMap<>(); params.put("min_monthly_purchases", minMonthlyPurchases); params.put("min_dollar_amount_purchased", minDollarAmountPurchased); List<Customer> rewardsReport = customerMapper.getRewardsReport(params); Integer rewardeesCount = (Integer) params.get("count_rewardees"); logger.info(String.format("Rewardees count[%d]", rewardeesCount)); return rewardsReport; }  @Autowired void setCustomerMapper(@Nonnull CustomerMapper customerMapper); @Autowired void setAddressMapper(@Nonnull AddressMapper addressMapper); @Nullable Customer getCustomer(@Nonnull Short customerId); @Nonnull @Transactional Short addCustomer(@Nonnull Customer customer, @Nonnull Address address); @Nonnull List<Customer> getCustomerRewardsReport(
      @Nonnull Byte minMonthlyPurchases, @Nonnull Double minDollarAmountPurchased); }
CustomerService { @Nonnull public List<Customer> getCustomerRewardsReport( @Nonnull Byte minMonthlyPurchases, @Nonnull Double minDollarAmountPurchased) { checkNotNull(minMonthlyPurchases, "Argument[minMonthlyPurchases] must not be null"); checkNotNull(minDollarAmountPurchased, "Argument[minDollarAmountPurchased] must not be null"); Map<String, Object> params = new HashMap<>(); params.put("min_monthly_purchases", minMonthlyPurchases); params.put("min_dollar_amount_purchased", minDollarAmountPurchased); List<Customer> rewardsReport = customerMapper.getRewardsReport(params); Integer rewardeesCount = (Integer) params.get("count_rewardees"); logger.info(String.format("Rewardees count[%d]", rewardeesCount)); return rewardsReport; }  @Autowired void setCustomerMapper(@Nonnull CustomerMapper customerMapper); @Autowired void setAddressMapper(@Nonnull AddressMapper addressMapper); @Nullable Customer getCustomer(@Nonnull Short customerId); @Nonnull @Transactional Short addCustomer(@Nonnull Customer customer, @Nonnull Address address); @Nonnull List<Customer> getCustomerRewardsReport(
      @Nonnull Byte minMonthlyPurchases, @Nonnull Double minDollarAmountPurchased);  }