Clover Coverage Report - kew-test 2.0.0-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
../img/srcFileCovDistChart0.png 0% of files have more coverage
7   45   4   7
6   21   0.57   1
1     4  
1    
 
  MockMailer       Line # 24 7 0% 4 14 0% 0.0
 
No Tests
 
1    /*
2    * Copyright 2010 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16    package mocks;
17   
18    import javax.mail.Address;
19    import javax.mail.MessagingException;
20    import javax.mail.internet.AddressException;
21   
22    import org.kuali.rice.core.mail.Mailer;
23   
 
24    public class MockMailer extends Mailer{
25   
26    /* (non-Javadoc)
27    * @see org.kuali.rice.kew.mail.Mailer#sendMessage(java.lang.String, javax.mail.Address[], java.lang.String, java.lang.String, javax.mail.Address[], javax.mail.Address[], boolean)
28    */
 
29  0 toggle @Override
30    public void sendMessage(String sender, Address[] recipients,
31    String subject, String messageBody, Address[] ccRecipients,
32    Address[] bccRecipients, boolean htmlMessage)
33    throws AddressException, MessagingException {
34   
35  0 String toValue = "";
36  0 for(Address a: recipients){
37  0 toValue += a.toString();
38    }
39    //String toValue = (recipients == null) ? "" : recipients.toString();
40  0 String fromValue = (sender == null) ? "" : sender;
41  0 String subjectValue = (subject == null) ? "" : subject;
42  0 String bodyValue = (messageBody == null) ? "" : messageBody;
43  0 LOG.info("\nWILL NOT send e-mail message with to '" + toValue + "'... \nfrom '" + fromValue + "'... \nsubject '" + subjectValue + "'... and \nbody '" + bodyValue);
44    }
45    }