Coverage Report - org.mule.example.loanbroker.transformers.LoanQuoteRequestToCreditProfileArgs
 
Classes in this File Line Coverage Branch Coverage Complexity
LoanQuoteRequestToCreditProfileArgs
0%
0/9
N/A
0
 
 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.transformers;
 8  
 
 9  
 import org.mule.api.transformer.TransformerException;
 10  
 import org.mule.example.loanbroker.messages.LoanBrokerQuoteRequest;
 11  
 import org.mule.transformer.AbstractTransformer;
 12  
 import org.mule.transformer.types.DataTypeFactory;
 13  
 
 14  
 /**
 15  
  * Extracts the customer information from the request into an array of arguments used
 16  
  * to invoke the Credit Agency MuleSession bean
 17  
  */
 18  
 public class LoanQuoteRequestToCreditProfileArgs extends AbstractTransformer
 19  
 {
 20  
 
 21  
     public LoanQuoteRequestToCreditProfileArgs()
 22  0
     {
 23  0
         registerSourceType(DataTypeFactory.create(LoanBrokerQuoteRequest.class));
 24  0
         setReturnDataType(DataTypeFactory.create(Object[].class));
 25  0
     }
 26  
 
 27  
     @Override
 28  
     public Object doTransform(Object src, String encoding) throws TransformerException
 29  
     {
 30  0
         LoanBrokerQuoteRequest request = (LoanBrokerQuoteRequest)src;
 31  0
         Object[] args = new Object[2];
 32  0
         args[0] = request.getCustomerRequest().getCustomer().getName();
 33  0
         args[1] = new Integer(request.getCustomerRequest().getCustomer().getSsn());
 34  0
         return args;
 35  
     }
 36  
 
 37  
 }