Menu

Mocking Java enums with jMock is both trivial and impossible

October 02, 2013

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. View the code on Gist. Strategy is a Java… Read more