I just found out that classes annotated with @OnApplicationStart run when I run jUnit tests (via IntelliJ).
Can I disable this? I have some logic that is only relevant on real application startup, but not in tests.
Yes you can check test mode in your doJob method for that
@Override
public void doJob() throws Exception {
if (!Play.runingInTestMode()) {
// Do your stuff
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With