If I compile the source in intellij, hibernate not plug itself as part of compilation process of intellij to instrument the domain classes. I have attached a project where the test fails (the test should fail due to bug in hibernate) if I run it from terminal, where as if I run it from intellij, it does not because intellij overrides compilation output with (or does not generate the hibernate instrumented code) with its own default compilation output. You can run the test from the commandline using `./gradlew check` IntelliJ version: 2016.2.2.EAP Hibernate version: 5.1.1.Final |