Package com.cin.dto

Examples of com.cin.dto.InsurencePolicyDTO


   * @throws InvalidInsurencePolicyException
   */
  public GenericResponse calculateQuoteForPolicy(GenericRequest request)
      throws MissingInformationException, InvalidInputValueException{

    InsurencePolicyDTO policy = request.getPolicy().clone();
    int quote = cinService.calculateQuoteForPolicy(policy);
    policy.setQuote(quote);
   
    GenericResponse response = new GenericResponse();
    response.setPolicy(policy);
    return response;
  }
View Full Code Here


     * @see MessageListener#onMessage(Message)
     */
    public void onMessage(Message message) {
      log.entering("PurchaseProcessor", "onMessage");
     
      InsurencePolicyDTO policy;
        try {
          ObjectMessage objectMessage = (ObjectMessage) message;
      policy = (InsurencePolicyDTO) objectMessage.getObject();
      compensateAgentForInvite(policy);
    } catch (JMSException e) {
View Full Code Here

  public void testCompensateAgent() throws Exception{
    int agentSsn = 11;
    int customerSsn = 10;
   
    // create policy
    InsurencePolicyDTO samplePolicy = null;
    InvitationDTO invitation = new InvitationDTO();
    invitation.setAgent(new UserDTO(agentSsn));
    invitation.setCustomer(new UserDTO(customerSsn));
   
    // send invitation
    service.sendInvitation(invitation, samplePolicy);
   
    // make sure the agent was not compensate before
    // so the test can actually work
    List<Integer> pays;
    pays = payTable.getByUser(agentSsn);
    assertEquals(0, pays.size());
   
    // purchase policy
    InsurencePolicyDTO policy = new InsurencePolicyDTO();
    policy.setUserSSN(10);
    policy.setPropertyName("My Property");
    policy.setPropertyValue(1000);
    policy.setDeductibles(100);
   
    int quote = service.calculateQuoteForPolicy(policy);
    policy.setQuote(quote);
   
    service.purchasePolicy(policy);
   
    // wait a bit for asynchronous methods to execute.
    Thread.sleep(1000);
View Full Code Here


public class DtoTest {
  @Test
  public void testCloneInsurencePolicy(){
    InsurencePolicyDTO p = new InsurencePolicyDTO();
    p.setUserSSN(123);
    p.setPropertyName("My Property");
    p.setPropertyValue(1000);
    p.setDeductibles(100);
    p.setQuote(10);
   
    p.setStartDate(new Date(12304L));
    p.setEndDate(new Date(12305L));
   
    InsurencePolicyDTO p2 = p.clone();
   
    assertNotNull(p2);
    assertEquals(p.getUserSSN(), p2.getUserSSN());
    assertEquals(p.getPropertyName(), p2.getPropertyName());
    assertEquals(p.getPropertyValue(), p2.getPropertyValue());
    assertEquals(p.getDeductibles(), p2.getDeductibles());
    assertEquals(p.getQuote(), p2.getQuote());
    assertEquals(p.getStartDate(), p2.getStartDate());
    assertEquals(p.getEndDate(), p2.getEndDate());
  }
View Full Code Here

TOP

Related Classes of com.cin.dto.InsurencePolicyDTO

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.