Package rewards

Examples of rewards.RewardConfirmation


    account.setEntityId(0L);
    account.addBeneficiary("Annabelle", Percentage.valueOf("50%"));
    account.addBeneficiary("Corgan", Percentage.valueOf("50%"));

    AccountContribution contribution = account.makeContribution(MonetaryAmount.valueOf("8.00"));
    RewardConfirmation confirmation = repository.confirmReward(contribution, dining);
    assertNotNull("confirmation should not be null", confirmation);
    assertNotNull("confirmation number should not be null", confirmation.getConfirmationNumber());
    assertEquals("wrong contribution object", contribution, confirmation.getAccountContribution());
    verifyRewardInserted(confirmation, dining);
  }
View Full Code Here


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

    // Hessian client proxy
    RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);

    // assert the expected reward confirmation results
    assertNotNull(confirmation);
    assertNotNull(confirmation.getConfirmationNumber());

    // assert an account contribution was made
    AccountContribution contribution = confirmation.getAccountContribution();
    assertNotNull(contribution);

    // the contribution account number should be '123456789'
    assertEquals("123456789", contribution.getAccountNumber());
View Full Code Here

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

    // HttpInvoker client proxy
    RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);

    // assert the expected reward confirmation results
    assertNotNull(confirmation);
    assertNotNull(confirmation.getConfirmationNumber());

    // assert an account contribution was made
    AccountContribution contribution = confirmation.getAccountContribution();
    assertNotNull(contribution);

    // the contribution account number should be '123456789'
    assertEquals("123456789", contribution.getAccountNumber());
View Full Code Here

    Dining dining = Dining.createDining("100.00", "1234123412341234",
        "1234567890");

    // TODO: replace 'null' below with a call to the 'rewardNetwork' to test
    // its rewardAccountFor(Dining) method
    RewardConfirmation confirmation = null;

    // assert the expected reward confirmation results
    assertNotNull(confirmation);
    assertNotNull(confirmation.getConfirmationNumber());

    // assert an account contribution was made
    AccountContribution contribution = confirmation
        .getAccountContribution();
    assertNotNull(contribution);

    // the account number should be '123456789'
    assertEquals("123456789", contribution.getAccountNumber());
View Full Code Here

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

    // assert an account contribution was made
    AccountContribution contribution = confirmation.getAccountContribution();
    assertNotNull(contribution);

    // the account number should be '123456789'
    assertEquals("123456789", contribution.getAccountNumber());
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

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

    // assert an account contribution was made
    AccountContribution contribution = confirmation.getAccountContribution();
    assertNotNull(contribution);

    // the account number should be '123456789'
    assertEquals("123456789", contribution.getAccountNumber());
View Full Code Here

    account.setEntityId(0L);
    account.addBeneficiary("Annabelle", Percentage.valueOf("50%"));
    account.addBeneficiary("Corgan", Percentage.valueOf("50%"));

    AccountContribution contribution = account.makeContribution(MonetaryAmount.valueOf("8.00"));
    RewardConfirmation confirmation = repository.confirmReward(contribution, dining);
    assertNotNull("confirmation should not be null", confirmation);
    assertNotNull("confirmation number should not be null", confirmation.getConfirmationNumber());
    assertEquals("wrong contribution object", contribution, confirmation.getAccountContribution());
    verifyRewardInserted(confirmation, dining);
  }
View Full Code Here

    String accountNumber = confirmationElement.getAttribute("accountNumber");
    String amount = confirmationElement.getAttribute("amount");
    List<Element> distributionElements = DomUtils.getChildElementsByTagName(confirmationElement, "distribution");
    AccountContribution contribution = new AccountContribution(accountNumber, MonetaryAmount.valueOf(amount),
        mapDistributions(distributionElements));
    return new RewardConfirmation(confirmationNumber, contribution);
  }
View Full Code Here

    account.setEntityId(0L);
    account.addBeneficiary("Annabelle", Percentage.valueOf("50%"));
    account.addBeneficiary("Corgan", Percentage.valueOf("50%"));

    AccountContribution contribution = account.makeContribution(MonetaryAmount.valueOf("8.00"));
    RewardConfirmation confirmation = repository.confirmReward(contribution, dining);
    assertNotNull("confirmation should not be null", confirmation);
    assertNotNull("confirmation number should not be null", confirmation.getConfirmationNumber());
    assertEquals("wrong contribution object", contribution, confirmation.getAccountContribution());
    verifyRewardInserted(confirmation, dining);
  }
View Full Code Here

TOP

Related Classes of rewards.RewardConfirmation

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.