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