lundi 2 février 2015

Mockito issues when running a Play app in development mode

I am writing unit tests for a Play 1.x app, and using Mockito to easily create mock instances on the fly. I am running in development mode, so that I don't have to restart the app frequently.


The problem comes when I change the code, and the re-run my unit tests without restarting the Play app. I get the following exception:



A java.lang.ClassCastException has been caught, Cannot cast services.MyService$$EnhancerByMockitoWithCGLIB$$12cee5a2 to services.MyService


When I restart te app, and re-run the tests, all of them execute fine, but it takes me up to a couple of minutes to restart every time. Is there something that could be done?


Aucun commentaire:

Enregistrer un commentaire