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 61f14d5 commit e763ab2Copy full SHA for e763ab2
src/java/grails/test/MockUtils.groovy
@@ -735,7 +735,13 @@ class MockUtils {
735
def properties = Introspector.getBeanInfo(clazz).propertyDescriptors
736
def mapping = evaluateMapping(clazz)
737
738
- boolean isInsert = !delegate.id
+ boolean isInsert
739
+ if (mapping?.id?.generator == "assigned") {
740
+ isInsert = !testInstances.contains(delegate)
741
+ } else {
742
+ isInsert = !delegate.id
743
+ }
744
+
745
if(isInsert) {
746
triggerEvent delegate, 'beforeInsert'
747
if (!testInstances.contains(delegate)) {
0 commit comments