I want to run unit tests (Junit) on some model classes that typically will send emails confirming that things happened. Is there a mock email server that you can use with u
I assume you're using Javamail and the problem is that javax.mail.Session is final and therefore can't be mocked.
Seems like others have suggested you simply define your own 'mail session' interface and create an implementation that uses Javamail. In your tests you then simply inject a mock while in 'real-world-mode' you inject the Javamail implementation.
Both JMock and EasyMock will support all the assertions you might want to make on the message you are sending and you testing is complete.
As an aside, I generally try to avoid any out-of-process calls from within unit tests - it kills you when you're running the test suite frequently, which normally translates into it being run less and that's code base issues start to occur.