We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c15d2b commit 1d385aaCopy full SHA for 1d385aa
src/java/grails/test/MockUtils.groovy
@@ -738,7 +738,13 @@ class MockUtils {
738
def properties = Introspector.getBeanInfo(clazz).propertyDescriptors
739
def mapping = evaluateMapping(clazz)
740
741
- boolean isInsert = !delegate.id
+ boolean isInsert
742
+ if (mapping?.id?.generator == "assigned") {
743
+ isInsert = !testInstances.contains(delegate)
744
+ } else {
745
+ isInsert = !delegate.id
746
+ }
747
+
748
if(isInsert) {
749
triggerEvent delegate, 'beforeInsert'
750
if (!testInstances.contains(delegate)) {
0 commit comments