Package rewards

Examples of rewards.Dining


   * Factory method that creates a Dining object from this RewardForm. A Dining is needed as input into the
   * {@link RewardNetwork} application to create new rewards.
   * @return the dining populated from this form
   */
  public Dining createDining() {
    return new Dining(amount, creditCardNumber, merchantNumber, SimpleDate.today());
  }
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

    // copies parameters in the request to the reward form
    binder.bind(request);
    if (binder.getBindingResult().hasErrors()) {
      return new ModelAndView("reward/new", binder.getBindingResult().getModel());
    } else {
      Dining dining = rewardForm.createDining();
      RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);
      return new ModelAndView("redirect:show/" + confirmation.getConfirmationNumber());
    }
  }
View Full Code Here

  private SoapRewardNetwork rewardNetwork;

  @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

    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

    }

    @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

  @RequestMapping(value="/reward/new", method = RequestMethod.POST)
  public String create(@ModelAttribute("rewardForm") RewardForm rewardForm, BindingResult result) {
    if (result.hasErrors()) {
      return FORM_VIEW;
    } else {
      Dining dining = rewardForm.createDining();
      RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);
      return REDIRECT_SHOW_VIEW + "/" + confirmation.getConfirmationNumber();
    }
  }
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

    repository = new JdbcRewardRepository(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

  @Autowired
  private RewardNetwork rewardNetwork;

  @Test
  public void testRmiClient() {
    Dining dining = Dining.createDining("100.00", "1234123412341234", "1234567890");

    // Remote Invocation
    RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);

    assertNotNull(confirmation);
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.