@@ -24,13 +24,13 @@ class AbsoluteGraphQLErrorTest extends Specification {
2424 def " constructor works as expected" () {
2525 given :
2626
27- def field = new Field ( " test" )
27+ def field = Field . newField() . name( " test" ) . build( )
2828 field. setSourceLocation(new SourceLocation (4 , 5 ))
2929
3030 def parameters = newParameters()
3131 .typeInfo(ExecutionTypeInfo . newTypeInfo(). type(objectType))
3232 .source(new Object ())
33- .fields([" fld" : [new Field ()]])
33+ .fields([" fld" : [Field . newField() . build ()]])
3434 .field([field])
3535 .path(ExecutionPath . fromList([" foo" , " bar" ]))
3636 .build()
@@ -60,13 +60,13 @@ class AbsoluteGraphQLErrorTest extends Specification {
6060 def " constructor handles missing path as null" () {
6161 given :
6262
63- def field = new Field ( " test" )
63+ def field = Field . newField() . name( " test" ) . build( )
6464 field. setSourceLocation(new SourceLocation (4 , 5 ))
6565
6666 def parameters = newParameters()
6767 .typeInfo(ExecutionTypeInfo . newTypeInfo(). type(objectType))
6868 .source(new Object ())
69- .fields([" fld" : [new Field ()]])
69+ .fields([" fld" : [Field . newField() . build ()]])
7070 .field([field])
7171 .path(ExecutionPath . fromList([" foo" , " bar" ]))
7272 .build()
@@ -85,13 +85,13 @@ class AbsoluteGraphQLErrorTest extends Specification {
8585 def " when constructor receives empty path it should return the base field path" () {
8686 given :
8787
88- def field = new Field ( " test" )
88+ def field = Field . newField() . name( " test" ) . build( )
8989 field. setSourceLocation(new SourceLocation (4 , 5 ))
9090
9191 def parameters = newParameters()
9292 .typeInfo(ExecutionTypeInfo . newTypeInfo(). type(objectType))
9393 .source(new Object ())
94- .fields([" fld" : [new Field ()]])
94+ .fields([" fld" : [Field . newField() . build ()]])
9595 .field([field])
9696 .path(ExecutionPath . fromList([" foo" , " bar" ]))
9797 .build()
@@ -111,12 +111,12 @@ class AbsoluteGraphQLErrorTest extends Specification {
111111 def " constructor handles missing locations as null" () {
112112 given :
113113
114- def field = new Field ( " test" )
114+ def field = Field . newField() . name( " test" ) . build( )
115115
116116 def parameters = newParameters()
117117 .typeInfo(ExecutionTypeInfo . newTypeInfo(). type(objectType))
118118 .source(new Object ())
119- .fields([" fld" : [new Field ()]])
119+ .fields([" fld" : [Field . newField() . build ()]])
120120 .field([field])
121121 .path(ExecutionPath . fromList([" foo" , " bar" ]))
122122 .build()
@@ -135,14 +135,14 @@ class AbsoluteGraphQLErrorTest extends Specification {
135135 def " when constructor receives empty locations it should return the base field locations" () {
136136 given :
137137
138- def field = new Field ( " test" )
138+ def field = Field . newField() . name( " test" ) . build( )
139139 def expectedSourceLocation = new SourceLocation (1 , 2 )
140140 field. setSourceLocation(expectedSourceLocation)
141141
142142 def parameters = newParameters()
143143 .typeInfo(ExecutionTypeInfo . newTypeInfo(). type(objectType))
144144 .source(new Object ())
145- .fields([" fld" : [new Field ()]])
145+ .fields([" fld" : [Field . newField() . build ()]])
146146 .field([field])
147147 .path(ExecutionPath . fromList([" foo" , " bar" ]))
148148 .build()
@@ -161,13 +161,13 @@ class AbsoluteGraphQLErrorTest extends Specification {
161161 def " constructor transforms multiple source locations" () {
162162 given :
163163
164- def field = new Field ( " test" )
164+ def field = Field . newField() . name( " test" ) . build( )
165165 field. setSourceLocation(new SourceLocation (4 , 5 ))
166166
167167 def parameters = newParameters()
168168 .typeInfo(ExecutionTypeInfo . newTypeInfo(). type(objectType))
169169 .source(new Object ())
170- .fields([" fld" : [new Field ()]])
170+ .fields([" fld" : [Field . newField() . build ()]])
171171 .field([field])
172172 .path(ExecutionPath . fromList([" foo" , " bar" ]))
173173 .build()
0 commit comments