IllegalStateException when running unit tests in rest module

@gcliff This might be of some use