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 @@ -718,6 +718,37 @@ class SeriesServiceImplTest extends Specification {
718
718
result == expectedResult
719
719
}
720
720
721
+ //
722
+ // Tests for findSeriesIdByMichelNumber()
723
+ //
724
+
725
+ @Unroll
726
+ def " findSeriesIdByMichelNumber() should throw exception for invalid argument '#michelNumberCode'" (String michelNumberCode) {
727
+ when :
728
+ service. findSeriesIdByMichelNumber(michelNumberCode)
729
+ then :
730
+ thrown IllegalArgumentException
731
+ where :
732
+ michelNumberCode | _
733
+ null | _
734
+ ' ' | _
735
+ ' ' | _
736
+ }
737
+
738
+ def " findSeriesIdByMichelNumber() should pass argument to dao and return result" () {
739
+ given :
740
+ Optional<Integer > expectedResult = Optional . of(1 );
741
+ when :
742
+ Optional<Integer > result = service. findSeriesIdByMichelNumber(' 5' );
743
+ then :
744
+ 1 * jdbcSeriesDao. findSeriesIdByMichelNumberCode({ String code ->
745
+ assert code == ' 5'
746
+ return true
747
+ }) >> expectedResult
748
+ and :
749
+ result == expectedResult
750
+ }
751
+
721
752
//
722
753
// Tests for findByCategoryId()
723
754
//
You can’t perform that action at this time.
0 commit comments