Skip to content

Commit a3f3704

Browse files
committed
CollectionService.createCollection(): add unit test for setting updatedAt field.
No functional changes.
1 parent 2b0bf0a commit a3f3704

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/test/groovy/ru/mystamps/web/service/CollectionServiceImplTest.groovy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ class CollectionServiceImplTest extends Specification {
9393
}) >> 200
9494
}
9595

96+
@SuppressWarnings(['ClosureAsLastMethodParameter', 'FactoryMethodName', 'UnnecessaryReturnKeyword'])
97+
def "createCollection() should assign updated at to current date"() {
98+
when:
99+
service.createCollection(123, "any-login")
100+
then:
101+
1 * collectionDao.add({ AddCollectionDbDto collection ->
102+
assert DateUtils.roughlyEqual(collection?.updatedAt, new Date())
103+
return true
104+
}) >> 300
105+
}
106+
96107
//
97108
// Tests for addToCollection()
98109
//

0 commit comments

Comments
 (0)