Package rewards

Examples of rewards.Dining


    jdbcTemplate = new SimpleJdbcTemplate(dataSource);
  }

  @Test
  public void testCreateReward() throws SQLException {
    Dining dining = Dining.createDining("100.00", "1234123412341234", "0123456789");

    Account account = new Account("1", "Keith and Keri Donald");
    account.setEntityId(0L);
    account.addBeneficiary("Annabelle", Percentage.valueOf("50%"));
    account.addBeneficiary("Corgan", Percentage.valueOf("50%"));
View Full Code Here


  }

  @Test
  public void testRewardForDining() {
    // create a new dining of 100.00 charged to credit card '1234123412341234' by merchant '123457890' as test input
    Dining dining = Dining.createDining("100.00", "1234123412341234", "1234567890");

    // call the 'rewardNetwork' to test its rewardAccountFor(Dining) method
    RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);

    // assert the expected reward confirmation results
View Full Code Here

  }

  @Test
  public void testRewardForDining() {
    // create a new dining of 100.00 charged to credit card '1234123412341234' by merchant '123457890' as test input
    Dining dining = Dining.createDining("100.00", "1234123412341234", "1234567890");

    // call the 'rewardNetwork' to test its rewardAccountFor(Dining) method
    RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);

    // assert the expected reward confirmation results
View Full Code Here

  }

  public int processResource(Resource input) throws InvalidBatchException {

    InputSource<Dining> source = new DiningSource(input);
    Dining dining = source.read();
    int count = 0;

    while (dining != null) {
      try {
        rewardNetwork.rewardAccountFor(dining);
View Full Code Here

        date = new SimpleDate(new Integer(dates[0]), new Integer(dates[1]), new Integer(dates[2]));
      } catch (Exception e) {
        throw new InvalidBatchException("Cannot parse dining from fields: [" + fields + "]", e);
      }

      Dining dining = new Dining(amount, creditCardNumber, merchantNumber, date);
      return dining;
    }
View Full Code Here

  @Autowired
  private RewardConfirmationLogger confirmationLogger;
 
  @Test
  public void testBatch() throws Exception {
    Dining dining1 = Dining.createDining("80.93", "1234123412341234", "1234567890");
    Dining dining2 = Dining.createDining("56.12", "1234123412341234", "1234567890");
    Dining dining3 = Dining.createDining("32.64", "1234123412341234", "1234567890");
    Dining dining4 = Dining.createDining("77.05", "1234123412341234", "1234567890");
    Dining dining5 = Dining.createDining("94.50", "1234123412341234", "1234567890");

    List<Dining> batch = new ArrayList<Dining>();
    batch.add(dining1);
    batch.add(dining2);
    batch.add(dining3);
View Full Code Here

    repository = new JdbcRewardRepository(dataSource);
    repository.setDataSource(dataSource);
  }

  public void testCreateReward() throws SQLException {
    Dining dining = Dining.createDining("100.00", "1234123412341234", "0123456789");

    Account account = new Account("1", "Keith and Keri Donald");
    account.setEntityId(0L);
    account.addBeneficiary("Annabelle", Percentage.valueOf("50%"));
    account.addBeneficiary("Corgan", Percentage.valueOf("50%"));
View Full Code Here

    rewardNetwork = new RewardNetworkImpl(accountRepo, restaurantRepo, rewardRepo);
  }

  public void testRewardForDining() {
    // create a new dining of 100.00 charged to credit card '1234123412341234' by merchant '123457890' as test input
    Dining dining = Dining.createDining("100.00", "1234123412341234", "1234567890");

    // call the 'rewardNetwork' to test its rewardAccountFor(Dining) method
    RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);

    // assert the expected reward confirmation results
View Full Code Here

      // start of create reward processing - extract submitted user input from the request
      String creditCardNumber = request.getParameter("creditCardNumber");
      String amount = request.getParameter("amount");
      String merchantNumber = request.getParameter("merchantNumber");
      // prepare the input needed by the application service
      Dining dining = Dining.createDining(amount, creditCardNumber, merchantNumber);
      // invoke the application
      RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);
      // redirect to the lookup servlet for displaying the confirmed reward details
      response.sendRedirect("show/" + confirmation.getConfirmationNumber());
    }
View Full Code Here

  public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    RewardActionForm rewardForm = (RewardActionForm) actionForm;
    // prepare input into the application service
    Dining dining = rewardForm.createDining();
    // invoke the application
    RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);
    // redirect to reward show action to display the confirmed reward
    return new ActionForward("show/" + confirmation.getConfirmationNumber(), true);
  }
View Full Code Here

TOP

Related Classes of rewards.Dining

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.