Skip to content

Commit 703ecec

Browse files
committed
test: fix date comparison
now == r.modified | | | | | | | Tue Apr 08 12:07:36 UTC 2025 (java.util.Date@58324c9f) | | org.grails.datastore.gorm.RecordCustom : 1 | false Tue Apr 08 12:07:36 UTC 2025 (java.util.Date@68ab6ab0)
1 parent 6d6c18b commit 703ecec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

grails-datamapping-core-test/src/test/groovy/org/grails/datastore/gorm/CustomAutoTimestampSpec.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CustomAutoTimestampSpec extends GormDatastoreSpec {
3030

3131
then:"the custom lastUpdated property is updated and dateCreated is not"
3232
r.modified != null && previousModified < r.modified
33-
previousCreated == r.created
33+
previousCreated.time == r.created.time
3434
}
3535

3636
void "Test when the auto timestamp properties are already set, they are overwritten"() {
@@ -57,7 +57,7 @@ class CustomAutoTimestampSpec extends GormDatastoreSpec {
5757

5858
then:"the custom lastUpdated property is updated and dateCreated is not"
5959
r.modified != null && previousModified < r.modified
60-
previousCreated == r.created
60+
previousCreated.time == r.created.time
6161
}
6262

6363
void "Test when the auto timestamp properties are already set, they are not overwritten if config is set"() {
@@ -75,8 +75,8 @@ class CustomAutoTimestampSpec extends GormDatastoreSpec {
7575
r = RecordCustom.get(r.id)
7676

7777
then:"the custom lastUpdated and dateCreated are not overwritten"
78-
now == r.modified
79-
now == r.created
78+
now.time == r.modified.time
79+
now.time == r.created.time
8080

8181
when:"An entity is modified"
8282
Date previousCreated = r.created
@@ -88,7 +88,7 @@ class CustomAutoTimestampSpec extends GormDatastoreSpec {
8888

8989
then:"the custom lastUpdated property is updated and dateCreated is not"
9090
r.modified != null && previousModified < r.modified
91-
previousCreated == r.created
91+
previousCreated.time == r.created.time
9292
}
9393

9494
@Override

0 commit comments

Comments
 (0)