@@ -53,7 +53,6 @@ class ScalarsBooleanTest extends Specification {
5353 def " Boolean serialize #value into #result (#result.class)" () {
5454 expect :
5555 Scalars.GraphQLBoolean . getCoercing(). serialize(value, GraphQLContext . default, Locale . default) == result
56- Scalars.GraphQLBoolean . getCoercing(). parseValue(value, GraphQLContext . default, Locale . default) == result
5756
5857 where :
5958 value | result
@@ -75,7 +74,6 @@ class ScalarsBooleanTest extends Specification {
7574 def " Boolean serialize #value into #result (#result.class) with deprecated methods" () {
7675 expect :
7776 Scalars.GraphQLBoolean . getCoercing(). serialize(value) == result // Retain deprecated method for test coverage
78- Scalars.GraphQLBoolean . getCoercing(). parseValue(value) == result // Retain deprecated method for test coverage
7977
8078 where :
8179 value | result
@@ -111,6 +109,28 @@ class ScalarsBooleanTest extends Specification {
111109 " f" | _
112110 }
113111
112+ @Unroll
113+ def " Boolean parseValue #value into #result (#result.class)" () {
114+ expect :
115+ Scalars.GraphQLBoolean . getCoercing(). parseValue(value, GraphQLContext . default, Locale . default) == result
116+
117+ where :
118+ value | result
119+ true | true
120+ false | false
121+ }
122+
123+ @Unroll
124+ def " Boolean parseValue #value into #result (#result.class) with deprecated methods" () {
125+ expect :
126+ Scalars.GraphQLBoolean . getCoercing(). parseValue(value) == result // Retain deprecated method for test coverage
127+
128+ where :
129+ value | result
130+ true | true
131+ false | false
132+ }
133+
114134 @Unroll
115135 def " parseValue throws exception for invalid input #value" () {
116136 when :
@@ -119,8 +139,19 @@ class ScalarsBooleanTest extends Specification {
119139 thrown(CoercingParseValueException )
120140
121141 where :
122- value | _
123- new Object () | _
142+ value | _
143+ new Object () | _
144+ " false" | _
145+ " true" | _
146+ " True" | _
147+ 0 | _
148+ 1 | _
149+ -1 | _
150+ new Long (42345784398534785l ) | _
151+ new Double (42.3 ) | _
152+ new Float (42.3 ) | _
153+ Integer . MAX_VALUE + 1l | _
154+ Integer . MIN_VALUE - 1l | _
124155 }
125156
126157}
0 commit comments