borinquenkid commented on code in PR #15568:
URL: https://github.com/apache/grails-core/pull/15568#discussion_r3454166196


##########
grails-data-hibernate5/core/src/test/groovy/grails/gorm/tests/CompositeIdWithJoinTableSpec.groovy:
##########
@@ -19,45 +19,40 @@
 
 package grails.gorm.tests
 
-import static grails.gorm.hibernate.mapping.MappingBuilder.define
-
 import grails.gorm.annotation.Entity
-import grails.gorm.transactions.Rollback
-import org.grails.orm.hibernate.HibernateDatastore
-import org.springframework.transaction.PlatformTransactionManager
-import spock.lang.AutoCleanup
-import spock.lang.Shared
-import spock.lang.Specification
+
+import static grails.gorm.hibernate.mapping.MappingBuilder.define
 
 /**
  * Created by graemerocher on 26/01/2017.
  */
-class CompositeIdWithJoinTableSpec extends Specification {
-
-    @AutoCleanup @Shared HibernateDatastore datastore = new 
HibernateDatastore(CompositeIdParent, CompositeIdChild)
-    @Shared PlatformTransactionManager transactionManager = 
datastore.transactionManager
+class CompositeIdWithJoinTableSpec extends HibernateGormDatastoreSpec {
+    def setupSpec() {
+        manager.registerDomainClasses(CompositeIdParent, CompositeIdChild)
+    }
 
-    @Rollback
+    //    @Rollback
     void "test composite id with join table"() {
-        when:"A parent with a composite id and a join table is saved"
-        new CompositeIdParent(name: "Test" , last:"Test 2")
-                .addToChildren(new CompositeIdChild())
-                .save(flush:true)
+        when: "A parent with a composite id and a join table is saved"
+        new CompositeIdParent(name: "Test", last: "Test 2")
+                .addToChildren(new CompositeIdChild(foo: "bar"))
+                .save(flush: true)
 
 
-        then:"The entity was saved"
+        then: "The entity was saved"
         CompositeIdParent.count() == 1
         CompositeIdParent.list().first().children.size() == 1
     }
 }
 
 @Entity
-class CompositeIdParent implements Serializable {
+class CompositeIdParent implements Serializable, Comparable<CompositeIdParent> 
{

Review Comment:
   Introduced during a merge commit — not in 8.0.x and no test depended on 
ordering (the assertion is just `.size() == 1`). Reverted both the `SortedSet` 
field and `Comparable` on `CompositeIdChild`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to