Package rewards

Examples of rewards.Dining


    repository.setDataSource(dataSource);
    jdbcTemplate = new SimpleJdbcTemplate(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


  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

    String creditCardNumber = request.getParameter("creditCardNumber");
    String amount = request.getParameter("amount");
    String merchantNumber = request.getParameter("merchantNumber");

    // prepare input into the application service
    Dining dining = Dining.createDining(amount, creditCardNumber, merchantNumber);

    // expose in "request scope" for other resources to access
    request.setAttribute("dining", dining);

    try {
View Full Code Here

  @Autowired
  private RewardNetwork rewardNetwork;

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

    // TODO 4: call the 'rewardAccountFor(..)' method
    RewardConfirmation confirmation = null;

    assertNotNull(confirmation);
View Full Code Here

  @Autowired
  private RewardNetwork rewardNetwork;

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

    // TODO 12: call the 'rewardAccountFor(..)' method
    RewardConfirmation confirmation = null;

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

  @Autowired
  private RewardNetwork rewardNetwork;
 
  @Test
  public void testHttpInvokerClient() {
    Dining dining = Dining.createDining("100.00", "1234123412341234", "1234567890");

    // TODO 8: call the 'rewardAccountFor(..)' method
    RewardConfirmation confirmation = null;

View Full Code Here

  }

  @Override
  protected Element invokeInternal(Element requestElement, Document document) throws Exception {
    Element diningElement = DomUtils.getChildElementByTagName(requestElement, "dining");
    Dining dining = mapDining(diningElement);
    RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);
    Element responseElement = document.createElementNS(NAMESPACE_URI, "rewardAccountForDiningResponse");
    responseElement.appendChild(mapRewardConfirmation(document, confirmation));
    return responseElement;
  }
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

  }

    @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

   * 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

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.