@@ -23,7 +23,9 @@ import static graphql.ExecutionInput.newExecutionInput
2323import static graphql.execution.EngineRunningObserver.ENGINE_RUNNING_OBSERVER_KEY
2424import static graphql.execution.EngineRunningObserver.RunningState
2525import static graphql.execution.EngineRunningObserver.RunningState.NOT_RUNNING
26+ import static graphql.execution.EngineRunningObserver.RunningState.NOT_RUNNING_FINISH
2627import static graphql.execution.EngineRunningObserver.RunningState.RUNNING
28+ import static graphql.execution.EngineRunningObserver.RunningState.RUNNING_START
2729
2830class EngineRunningTest extends Specification {
2931
@@ -70,13 +72,13 @@ class EngineRunningTest extends Specification {
7072 when :
7173 def er = graphQL. executeAsync(ei)
7274 then :
73- states == [RUNNING , NOT_RUNNING ]
75+ states == [RUNNING_START , NOT_RUNNING ]
7476
7577 when :
7678 states. clear()
7779 cf. complete(new PreparsedDocumentEntry (document))
7880 then :
79- states == [RUNNING , NOT_RUNNING ]
81+ states == [RUNNING , NOT_RUNNING_FINISH ]
8082 er. get(). data == [hello : " world" ]
8183
8284
@@ -114,13 +116,13 @@ class EngineRunningTest extends Specification {
114116 when :
115117 def er = graphQL. executeAsync(ei)
116118 then :
117- states == [RUNNING , NOT_RUNNING ]
119+ states == [RUNNING_START , NOT_RUNNING ]
118120
119121 when :
120122 states. clear()
121123 cf. complete(new InstrumentationState () {})
122124 then :
123- states == [RUNNING , NOT_RUNNING ]
125+ states == [RUNNING , NOT_RUNNING_FINISH ]
124126 er. get(). data == [hello : " world" ]
125127
126128
@@ -158,14 +160,14 @@ class EngineRunningTest extends Specification {
158160 when :
159161 def er = graphQL. executeAsync(ei)
160162 then :
161- states == [RUNNING , NOT_RUNNING ]
163+ states == [RUNNING_START , NOT_RUNNING ]
162164
163165 when :
164166 states. clear()
165167 cf. complete(ExecutionResultImpl . newExecutionResult(). data([hello : " world-modified" ]). build())
166168 then :
167169 er. get(). data == [hello : " world-modified" ]
168- states == [RUNNING , NOT_RUNNING ]
170+ states == [RUNNING , NOT_RUNNING_FINISH ]
169171
170172
171173 }
@@ -195,7 +197,7 @@ class EngineRunningTest extends Specification {
195197 def er = graphQL. execute(ei)
196198 then :
197199 er. data == [hello : " world" ]
198- states == [RUNNING , NOT_RUNNING ]
200+ states == [RUNNING_START , NOT_RUNNING_FINISH ]
199201 }
200202
201203 def " multiple async DF" () {
@@ -251,7 +253,7 @@ class EngineRunningTest extends Specification {
251253 when :
252254 def er = graphQL. executeAsync(ei)
253255 then :
254- states == [RUNNING , NOT_RUNNING ]
256+ states == [RUNNING_START , NOT_RUNNING ]
255257
256258 when :
257259 states. clear();
@@ -270,7 +272,7 @@ class EngineRunningTest extends Specification {
270272 states. clear()
271273 cf2. complete(" world2" )
272274 then :
273- states == [RUNNING , NOT_RUNNING ]
275+ states == [RUNNING , NOT_RUNNING_FINISH ]
274276 er. get(). data == [hello : " world" , hello2 : " world2" , foo : [name : " FooName" ], someStaticValue : [staticValue : " staticValue" ]]
275277 }
276278
@@ -299,14 +301,14 @@ class EngineRunningTest extends Specification {
299301 when :
300302 def er = graphQL. executeAsync(ei)
301303 then :
302- states == [RUNNING , NOT_RUNNING ]
304+ states == [RUNNING_START , NOT_RUNNING ]
303305
304306 when :
305307 states. clear();
306308 cf. complete(" world" )
307309
308310 then :
309- states == [RUNNING , NOT_RUNNING ]
311+ states == [RUNNING , NOT_RUNNING_FINISH ]
310312 er. get(). data == [hello : " world" ]
311313 }
312314
@@ -334,15 +336,15 @@ class EngineRunningTest extends Specification {
334336 when :
335337 def er = graphQL. executeAsync(ei)
336338 then :
337- states == [RUNNING , NOT_RUNNING ]
339+ states == [RUNNING_START , NOT_RUNNING ]
338340
339341 when :
340342 states. clear();
341343 cf. complete(" world" )
342344
343345 then :
344346 er. get(). data == [hello : " world" ]
345- states == [RUNNING , NOT_RUNNING ]
347+ states == [RUNNING , NOT_RUNNING_FINISH ]
346348 }
347349
348350
@@ -387,8 +389,7 @@ class EngineRunningTest extends Specification {
387389
388390 then :
389391 result. errors. collect { it. message } == [" recovered" ]
390- // we expect simply going from running to finshed
391- states == [RUNNING , NOT_RUNNING ]
392+ states == [RUNNING , NOT_RUNNING_FINISH ]
392393 }
393394
394395 def " async datafetcher failing with async exception handler" () {
@@ -429,7 +430,7 @@ class EngineRunningTest extends Specification {
429430 def er = graphQL. executeAsync(ei)
430431
431432 then :
432- states == [RUNNING , NOT_RUNNING ]
433+ states == [RUNNING_START , NOT_RUNNING ]
433434
434435 when :
435436 states. clear()
@@ -445,8 +446,7 @@ class EngineRunningTest extends Specification {
445446
446447 then :
447448 result. errors. collect { it. message } == [" recovered" ]
448- // we expect simply going from running to finshed
449- new ArrayList<> (states) == [RUNNING , NOT_RUNNING ]
449+ states == [RUNNING , NOT_RUNNING_FINISH ]
450450 }
451451
452452
@@ -480,7 +480,7 @@ class EngineRunningTest extends Specification {
480480 when :
481481 def er = graphQL. executeAsync(ei)
482482 then :
483- states == [RUNNING , NOT_RUNNING ]
483+ states == [RUNNING_START , NOT_RUNNING ]
484484
485485 when :
486486 states. clear();
@@ -494,7 +494,7 @@ class EngineRunningTest extends Specification {
494494 cf2. complete(" world2" )
495495
496496 then :
497- states == [RUNNING , NOT_RUNNING ]
497+ states == [RUNNING , NOT_RUNNING_FINISH ]
498498 er. get(). data == [hello : " world" , hello2 : " world2" ]
499499 }
500500}
0 commit comments