Loading .eml files into javax.mail.Messages <p>I'm trying to unit test a method which processes <code>javax.mail.Message</code> instances.</p> <p>I am writing a converter to change emails which arrive in different formats and are then converted into a consistent internal format (<code>MyMessage</code>). This conversion will usually depend on the from-address or reply-address of the email, and the parts of the email, the subject, and the from- and reply-addresses will be required for creating the new <code>MyMessage</code>.</p> <p>I have a collection of raw emails which are saved locally as <code>.eml</code> files, and I'd like to make a unit test which loads the <code>.eml</code> files from the classpath and converts them to <code>javax.mail.Message</code> instances. Is this possible, and if so, how would it be done?</p>