File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/test/groovy/ru/mystamps/web/service Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -780,6 +780,37 @@ class SeriesServiceImplTest extends Specification {
780
780
result == expectedResult
781
781
}
782
782
783
+ //
784
+ // Tests for findSeriesIdByYvertNumber()
785
+ //
786
+
787
+ @Unroll
788
+ def " findSeriesIdByYvertNumber() should throw exception for invalid argument '#yvertNumberCode'" (String yvertNumberCode) {
789
+ when :
790
+ service. findSeriesIdByYvertNumber(yvertNumberCode)
791
+ then :
792
+ thrown IllegalArgumentException
793
+ where :
794
+ yvertNumberCode | _
795
+ null | _
796
+ ' ' | _
797
+ ' ' | _
798
+ }
799
+
800
+ def " findSeriesIdByYvertNumber() should pass argument to dao and return result" () {
801
+ given :
802
+ Optional<Integer > expectedResult = Optional . of(1 );
803
+ when :
804
+ Optional<Integer > result = service. findSeriesIdByYvertNumber(' 5' );
805
+ then :
806
+ 1 * jdbcSeriesDao. findSeriesIdByYvertNumberCode({ String code ->
807
+ assert code == ' 5'
808
+ return true
809
+ }) >> expectedResult
810
+ and :
811
+ result == expectedResult
812
+ }
813
+
783
814
//
784
815
// Tests for findByCategoryId()
785
816
//
You can’t perform that action at this time.
0 commit comments