Coverage Report - org.mule.example.loanbroker.creditagency.DefaultCreditAgency
 
Classes in this File Line Coverage Branch Coverage Complexity
DefaultCreditAgency
0%
0/9
N/A
1
 
 1  
 /*
 2  
  * $Id: DefaultCreditAgency.java 19496 2010-09-09 16:16:02Z aperepel $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.example.loanbroker.creditagency;
 12  
 
 13  
 import org.mule.example.loanbroker.model.CreditProfile;
 14  
 import org.mule.example.loanbroker.model.Customer;
 15  
 
 16  
 /**
 17  
  * Provides the credit profile for a customer.
 18  
  */
 19  0
 public class DefaultCreditAgency implements CreditAgencyService
 20  
 {
 21  
      public CreditProfile getCreditProfile(Customer customer)
 22  
      {
 23  0
          CreditProfile cp = new CreditProfile();
 24  0
          cp.setCreditHistory(getCreditHistoryLength(customer.getSsn()));
 25  0
          cp.setCreditScore(getCreditScore(customer.getSsn()));
 26  0
          return cp;
 27  
      }
 28  
 
 29  
      protected int getCreditScore(int ssn)
 30  
      {
 31  
          int credit_score;
 32  
 
 33  0
          credit_score = (int)(Math.random() * 600 + 300);
 34  
 
 35  0
          return credit_score;
 36  
      }
 37  
 
 38  
      protected int getCreditHistoryLength(int ssn)
 39  
      {
 40  
          int credit_history_length;
 41  
 
 42  0
          credit_history_length = (int)(Math.random() * 19 + 1);
 43  
 
 44  0
          return credit_history_length;
 45  
      }
 46  
 }