@@ -28,8 +28,6 @@ import ru.mystamps.web.feature.series.SeriesValidation
28
28
import spock.lang.Specification
29
29
import spock.lang.Unroll
30
30
31
- import java.time.Year
32
-
33
31
import static io.qala.datagen.RandomElements.from
34
32
import static io.qala.datagen.RandomShortApi.nullOrBlank
35
33
import static io.qala.datagen.RandomValue.between
@@ -301,10 +299,9 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
301
299
@SuppressWarnings (' UnnecessaryGetter' )
302
300
def ' extractIssueDate() should return the first year if there are many' () {
303
301
given :
304
- Integer currentYear = Year . now(). getValue()
305
- Integer expectedYear = between(SeriesValidation . MIN_RELEASE_YEAR , currentYear). integer()
302
+ Integer expectedYear = Random . issueYear()
306
303
and :
307
- Integer anotherYear = between( SeriesValidation . MIN_RELEASE_YEAR , currentYear) . integer ()
304
+ Integer anotherYear = Random . issueYear ()
308
305
and :
309
306
String fragment = String . format(' %d %d' , expectedYear, anotherYear)
310
307
when :
@@ -320,8 +317,7 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
320
317
Integer unsupportedYearInFuture = between(MAX_SUPPORTED_RELEASE_YEAR + 1 , Integer . MAX_VALUE ). integer()
321
318
Integer unsupportedYear = from(unsupportedYearInPast, unsupportedYearInFuture). sample()
322
319
and :
323
- Integer currentYear = Year . now(). getValue()
324
- Integer expectedYear = between(SeriesValidation . MIN_RELEASE_YEAR , currentYear). integer()
320
+ Integer expectedYear = Random . issueYear()
325
321
and :
326
322
String fragment = String . format(' %d %d' , unsupportedYear, expectedYear)
327
323
when :
0 commit comments