@@ -78,7 +78,7 @@ class CollectionServiceImplTest extends Specification {
78
78
1 * collectionDao. add({ AddCollectionDbDto collection ->
79
79
assert collection?. ownerId == expectedOwnerId
80
80
return true
81
- }) >> 100
81
+ }) >> Random . id()
82
82
}
83
83
84
84
@SuppressWarnings ([' ClosureAsLastMethodParameter' , ' FactoryMethodName' , ' UnnecessaryReturnKeyword' ])
@@ -93,7 +93,7 @@ class CollectionServiceImplTest extends Specification {
93
93
1 * collectionDao. add({ AddCollectionDbDto collection ->
94
94
assert collection?. slug == expectedSlug
95
95
return true
96
- }) >> 200
96
+ }) >> Random . id()
97
97
}
98
98
99
99
@SuppressWarnings ([' ClosureAsLastMethodParameter' , ' FactoryMethodName' , ' UnnecessaryReturnKeyword' ])
@@ -104,7 +104,7 @@ class CollectionServiceImplTest extends Specification {
104
104
1 * collectionDao. add({ AddCollectionDbDto collection ->
105
105
assert DateUtils . roughlyEqual(collection?. updatedAt, new Date ())
106
106
return true
107
- }) >> 300
107
+ }) >> Random . id()
108
108
}
109
109
110
110
//
@@ -113,7 +113,7 @@ class CollectionServiceImplTest extends Specification {
113
113
114
114
def ' addToCollection() should throw exception when user id is null' () {
115
115
when :
116
- service. addToCollection(null , 456 )
116
+ service. addToCollection(null , Random . id() )
117
117
then :
118
118
thrown IllegalArgumentException
119
119
}
@@ -129,7 +129,7 @@ class CollectionServiceImplTest extends Specification {
129
129
def ' addToCollection() should add series to collection and mark it as modified' () {
130
130
given :
131
131
Integer expectedUserId = Random . userId()
132
- Integer expectedSeriesId = 456
132
+ Integer expectedSeriesId = Random . id()
133
133
when :
134
134
service. addToCollection(expectedUserId, expectedSeriesId)
135
135
then :
@@ -156,7 +156,7 @@ class CollectionServiceImplTest extends Specification {
156
156
157
157
def ' removeFromCollection() should throw exception when user id is null' () {
158
158
when :
159
- service. removeFromCollection(null , 123 )
159
+ service. removeFromCollection(null , Random . id() )
160
160
then :
161
161
thrown IllegalArgumentException
162
162
}
@@ -172,7 +172,7 @@ class CollectionServiceImplTest extends Specification {
172
172
def ' removeFromCollection() should remove series from collection and mark it as modified' () {
173
173
given :
174
174
Integer expectedUserId = Random . userId()
175
- Integer expectedSeriesId = 456
175
+ Integer expectedSeriesId = Random . id()
176
176
when :
177
177
service. removeFromCollection(expectedUserId, expectedSeriesId)
178
178
then :
@@ -208,7 +208,7 @@ class CollectionServiceImplTest extends Specification {
208
208
given :
209
209
Integer anonymousUserId = null
210
210
when :
211
- boolean serviceResult = service. isSeriesInCollection(anonymousUserId, 456 )
211
+ boolean serviceResult = service. isSeriesInCollection(anonymousUserId, Random . id() )
212
212
then :
213
213
serviceResult == false
214
214
and :
@@ -220,7 +220,7 @@ class CollectionServiceImplTest extends Specification {
220
220
given :
221
221
Integer expectedUserId = Random . userId()
222
222
and :
223
- Integer expectedSeriesId = 456
223
+ Integer expectedSeriesId = Random . id()
224
224
and :
225
225
boolean expectedResult = true
226
226
when :
0 commit comments