@@ -700,7 +700,7 @@ class SeriesServiceImplTest extends Specification {
700
700
701
701
def " findFullInfoById() should return null when series not found" () {
702
702
when :
703
- SeriesDto result = service. findFullInfoById(Random . id(), ' de ' )
703
+ SeriesDto result = service. findFullInfoById(Random . id(), Random . lang() )
704
704
then :
705
705
1 * seriesDao. findByIdAsSeriesFullInfo(_ as Integer , _ as String )
706
706
and :
@@ -717,7 +717,7 @@ class SeriesServiceImplTest extends Specification {
717
717
def " findFullInfoById() should return info about series" () {
718
718
given :
719
719
Integer expectedSeriesId = Random . id()
720
- String expectedLang = ' kz '
720
+ String expectedLang = Random . lang()
721
721
SeriesFullInfoDto expectedInfo = TestObjects . createSeriesFullInfoDto()
722
722
List<String > expectedMichelNumbers = [ ' 1' , ' 2' ]
723
723
List<String > expectedScottNumbers = [ ' 3' , ' 4' ]
@@ -792,7 +792,7 @@ class SeriesServiceImplTest extends Specification {
792
792
given :
793
793
String expectedNumber = Random . catalogNumber()
794
794
when :
795
- service. findByMichelNumber(expectedNumber, ' en ' )
795
+ service. findByMichelNumber(expectedNumber, Random . lang() )
796
796
then :
797
797
1 * michelCatalogService. findSeriesIdsByNumber(expectedNumber) >> []
798
798
}
@@ -801,7 +801,7 @@ class SeriesServiceImplTest extends Specification {
801
801
given :
802
802
michelCatalogService. findSeriesIdsByNumber(_ as String ) >> []
803
803
when :
804
- List<SeriesInfoDto > result = service. findByMichelNumber(Random . catalogNumber(), ' en ' )
804
+ List<SeriesInfoDto > result = service. findByMichelNumber(Random . catalogNumber(), Random . lang() )
805
805
then :
806
806
0 * seriesDao. findByIdsAsSeriesInfo(_ as List , _ as String )
807
807
and :
@@ -810,7 +810,7 @@ class SeriesServiceImplTest extends Specification {
810
810
811
811
def " findByMichelNumber() should find and return series info" () {
812
812
given :
813
- String expectedLang = ' en '
813
+ String expectedLang = Random . lang()
814
814
and :
815
815
List<Integer > expectedSeriesIds = [ 1 ]
816
816
and :
@@ -833,7 +833,7 @@ class SeriesServiceImplTest extends Specification {
833
833
given :
834
834
String expectedNumber = Random . catalogNumber()
835
835
when :
836
- service. findByScottNumber(expectedNumber, ' en ' )
836
+ service. findByScottNumber(expectedNumber, Random . lang() )
837
837
then :
838
838
1 * scottCatalogService. findSeriesIdsByNumber(expectedNumber) >> []
839
839
}
@@ -842,7 +842,7 @@ class SeriesServiceImplTest extends Specification {
842
842
given :
843
843
scottCatalogService. findSeriesIdsByNumber(_ as String ) >> []
844
844
when :
845
- List<SeriesInfoDto > result = service. findByScottNumber(Random . catalogNumber(), ' en ' )
845
+ List<SeriesInfoDto > result = service. findByScottNumber(Random . catalogNumber(), Random . lang() )
846
846
then :
847
847
0 * seriesDao. findByIdsAsSeriesInfo(_ as List , _ as String )
848
848
and :
@@ -851,7 +851,7 @@ class SeriesServiceImplTest extends Specification {
851
851
852
852
def " findByScottNumber() should find and return series info" () {
853
853
given :
854
- String expectedLang = ' en '
854
+ String expectedLang = Random . lang()
855
855
and :
856
856
List<Integer > expectedSeriesIds = [ 1 ]
857
857
and :
@@ -874,7 +874,7 @@ class SeriesServiceImplTest extends Specification {
874
874
given :
875
875
String expectedNumber = Random . catalogNumber()
876
876
when :
877
- service. findByYvertNumber(expectedNumber, ' en ' )
877
+ service. findByYvertNumber(expectedNumber, Random . lang() )
878
878
then :
879
879
1 * yvertCatalogService. findSeriesIdsByNumber(expectedNumber) >> []
880
880
}
@@ -883,7 +883,7 @@ class SeriesServiceImplTest extends Specification {
883
883
given :
884
884
yvertCatalogService. findSeriesIdsByNumber(_ as String ) >> []
885
885
when :
886
- List<SeriesInfoDto > result = service. findByYvertNumber(Random . catalogNumber(), ' en ' )
886
+ List<SeriesInfoDto > result = service. findByYvertNumber(Random . catalogNumber(), Random . lang() )
887
887
then :
888
888
0 * seriesDao. findByIdsAsSeriesInfo(_ as List , _ as String )
889
889
and :
@@ -892,7 +892,7 @@ class SeriesServiceImplTest extends Specification {
892
892
893
893
def " findByYvertNumber() should find and return series info" () {
894
894
given :
895
- String expectedLang = ' en '
895
+ String expectedLang = Random . lang()
896
896
and :
897
897
List<Integer > expectedSeriesIds = [ 1 ]
898
898
and :
@@ -915,7 +915,7 @@ class SeriesServiceImplTest extends Specification {
915
915
given :
916
916
String expectedNumber = Random . catalogNumber()
917
917
when :
918
- service. findByGibbonsNumber(expectedNumber, ' en ' )
918
+ service. findByGibbonsNumber(expectedNumber, Random . lang() )
919
919
then :
920
920
1 * gibbonsCatalogService. findSeriesIdsByNumber(expectedNumber) >> []
921
921
}
@@ -924,7 +924,7 @@ class SeriesServiceImplTest extends Specification {
924
924
given :
925
925
gibbonsCatalogService. findSeriesIdsByNumber(_ as String ) >> []
926
926
when :
927
- List<SeriesInfoDto > result = service. findByGibbonsNumber(Random . catalogNumber(), ' en ' )
927
+ List<SeriesInfoDto > result = service. findByGibbonsNumber(Random . catalogNumber(), Random . lang() )
928
928
then :
929
929
0 * seriesDao. findByIdsAsSeriesInfo(_ as List , _ as String )
930
930
and :
@@ -933,7 +933,7 @@ class SeriesServiceImplTest extends Specification {
933
933
934
934
def " findByGibbonsNumber() should find and return series info" () {
935
935
given :
936
- String expectedLang = ' en '
936
+ String expectedLang = Random . lang()
937
937
and :
938
938
List<Integer > expectedSeriesIds = [ 1 ]
939
939
and :
@@ -1032,7 +1032,7 @@ class SeriesServiceImplTest extends Specification {
1032
1032
1033
1033
def " findByCategorySlug() should throw exception if category slug is null" () {
1034
1034
when :
1035
- service. findByCategorySlug(null , ' any ' )
1035
+ service. findByCategorySlug(null , Random . lang() )
1036
1036
then :
1037
1037
thrown IllegalArgumentException
1038
1038
}
@@ -1045,7 +1045,7 @@ class SeriesServiceImplTest extends Specification {
1045
1045
and :
1046
1046
seriesDao. findByCategorySlugAsSeriesInfo(_ as String , _ as String ) >> expectedResult
1047
1047
when :
1048
- List<SeriesInfoDto > result = service. findByCategorySlug(' iceland' , ' any ' )
1048
+ List<SeriesInfoDto > result = service. findByCategorySlug(' iceland' , Random . lang() )
1049
1049
then :
1050
1050
result == expectedResult
1051
1051
}
@@ -1056,7 +1056,7 @@ class SeriesServiceImplTest extends Specification {
1056
1056
1057
1057
def " findByCountrySlug() should throw exception if country slug is null" () {
1058
1058
when :
1059
- service. findByCountrySlug(null , ' any ' )
1059
+ service. findByCountrySlug(null , Random . lang() )
1060
1060
then :
1061
1061
thrown IllegalArgumentException
1062
1062
}
@@ -1069,7 +1069,7 @@ class SeriesServiceImplTest extends Specification {
1069
1069
and :
1070
1070
seriesDao. findByCountrySlugAsSeriesInfo(_ as String , _ as String ) >> expectedResult
1071
1071
when :
1072
- List<SeriesInfoDto > result = service. findByCountrySlug(' germany' , ' any ' )
1072
+ List<SeriesInfoDto > result = service. findByCountrySlug(' germany' , Random . lang() )
1073
1073
then :
1074
1074
result == expectedResult
1075
1075
}
@@ -1080,7 +1080,7 @@ class SeriesServiceImplTest extends Specification {
1080
1080
1081
1081
def " findByCollectionId() should throw exception when collection id is null" () {
1082
1082
when :
1083
- service. findByCollectionId(null , ' whatever ' )
1083
+ service. findByCollectionId(null , Random . lang() )
1084
1084
then :
1085
1085
thrown IllegalArgumentException
1086
1086
}
@@ -1089,7 +1089,7 @@ class SeriesServiceImplTest extends Specification {
1089
1089
given :
1090
1090
Integer expectedCollectionId = Random . id()
1091
1091
and :
1092
- String expectedLang = ' expected '
1092
+ String expectedLang = Random . lang()
1093
1093
when :
1094
1094
service. findByCollectionId(expectedCollectionId, expectedLang)
1095
1095
then :
@@ -1116,7 +1116,7 @@ class SeriesServiceImplTest extends Specification {
1116
1116
given :
1117
1117
int expectedQuantity = 3
1118
1118
and :
1119
- String expectedLang = ' expected '
1119
+ String expectedLang = Random . lang()
1120
1120
when :
1121
1121
service. findRecentlyAdded(expectedQuantity, expectedLang)
1122
1122
then :
0 commit comments