If I try to run my project, via Intellij
or terminal
, my application works fine. However, when I tried to run only my tests
, they break with the following exception:
com.google.inject.CreationException: Unable to create injector, see the following errors:
1) Error injecting constructor, java.lang.IllegalStateException: Bean class models.Project is not enhanced?
...
2) Error injecting constructor, java.lang.IllegalStateException: Bean class models.Project is not enhanced?
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
I think it might be something with how my project setup. However, I don't have any idea of what might be.
This is my build.sbt, plugins.sbt, and application.conf.
The strange think is that, if I start my application normally, and run my tests, they work, but I need to stop/start my application every time that I need to run my tests,and this is annoying :)
Any idea, or suggestion would be very much appreciate!
Well, for those who might have the same problem as I had. If you're using IntelliJ, go to Settings
, Plugins
and type Ebean
, several options will show it to you. I chose the Ebean 4x Enhancement
option, install it and restart Intellij. Now, go to Build
and make sure that 'Ebean 4x Enhancement' is enabled. Now you can run your tests with Intellij!