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 @@ -749,6 +749,37 @@ class SeriesServiceImplTest extends Specification {
749
749
result == expectedResult
750
750
}
751
751
752
+ //
753
+ // Tests for findSeriesIdByScottNumber()
754
+ //
755
+
756
+ @Unroll
757
+ def " findSeriesIdByScottNumber() should throw exception for invalid argument '#scottNumberCode'" (String scottNumberCode) {
758
+ when :
759
+ service. findSeriesIdByScottNumber(scottNumberCode)
760
+ then :
761
+ thrown IllegalArgumentException
762
+ where :
763
+ scottNumberCode | _
764
+ null | _
765
+ ' ' | _
766
+ ' ' | _
767
+ }
768
+
769
+ def " findSeriesIdByScottNumber() should pass argument to dao and return result" () {
770
+ given :
771
+ Optional<Integer > expectedResult = Optional . of(1 );
772
+ when :
773
+ Optional<Integer > result = service. findSeriesIdByScottNumber(' 5' );
774
+ then :
775
+ 1 * jdbcSeriesDao. findSeriesIdByScottNumberCode({ String code ->
776
+ assert code == ' 5'
777
+ return true
778
+ }) >> expectedResult
779
+ and :
780
+ result == expectedResult
781
+ }
782
+
752
783
//
753
784
// Tests for findByCategoryId()
754
785
//
You can’t perform that action at this time.
0 commit comments