[ 
https://issues.apache.org/jira/browse/JAMES-863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefano Bagnara reassigned JAMES-863:
-------------------------------------

    Assignee: Stefano Bagnara

> MockMimeMessage bugs
> --------------------
>
>                 Key: JAMES-863
>                 URL: https://issues.apache.org/jira/browse/JAMES-863
>             Project: JAMES Server
>          Issue Type: Bug
>          Components: Matchers/Mailets (bundled)
>    Affects Versions: 2.3.1
>            Reporter: Rafael Munoz
>            Assignee: Stefano Bagnara
>            Priority: Minor
>
> I have found a pair of bugs on the  MockMimeMessage implementation when using 
> it for my own tests. There very easy to fix and I'm including my proposal 
> code for review.
> - MockMimeMessage has a wrong cast on the getFrom method
> ORIGINAL
>     public Address[] getFrom() throws MessagingException {
>       return (Address[])m_fromAddresses.toArray();
>     }
> FIXED
>     public Address[] getFrom() throws MessagingException {
>       return (Address[])m_fromAddresses.toArray(new 
> Address[m_fromAddresses.size()]);
>     }
> - MockMimeMessage doesn't set the mimetype on the setContent method
> ORIGINAL
>     public void setContent(Object object, String mimeType) throws 
> MessagingException {
>         m_content = object;  // trivial implementation
>     }
> FIXED
>     public void setContent(Object object, String mimeType) throws 
> MessagingException {
>         m_content = object;  // trivial implementation
>         addHeader(RFC2822Headers.CONTENT_TYPE, mimeType);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to