Articles in: October 2013 :
Mocking Java enums with jMock is both trivial and impossible
I recently ran into a situation where I needed to test some code that used an enum to select between various strategies. As a toy example of this, we’ll use Accounts which have a list of investments and a Strategy which defines what investments are acceptable. Strategy is a Java 5 enum that provides a… Read more