@@ -30,10 +30,12 @@ class DDApiTest extends Specification {
3030 def agent = ratpack {
3131 handlers {
3232 put(" v0.4/traces" ) {
33- response. status(200 ). send()
33+ def status = request. contentLength > 0 ? 200 : 500
34+ response. status(status). send()
3435 }
3536 put(" v0.4/services" ) {
36- response. status(200 ). send()
37+ def status = request. contentLength > 0 ? 200 : 500
38+ response. status(status). send()
3739 }
3840 }
3941 }
@@ -56,7 +58,8 @@ class DDApiTest extends Specification {
5658 response. status(404 ). send()
5759 }
5860 put(" v0.4/services" ) {
59- response. status(200 ). send()
61+ def status = request. contentLength > 0 ? 200 : 500
62+ response. status(status). send()
6063 }
6164 }
6265 }
@@ -87,7 +90,8 @@ class DDApiTest extends Specification {
8790 }
8891 }
8992 put(" v0.4/services" ) {
90- response. status(200 ). send()
93+ def status = request. contentLength > 0 ? 200 : 500
94+ response. status(status). send()
9195 }
9296 }
9397 }
@@ -144,10 +148,12 @@ class DDApiTest extends Specification {
144148 def agent = ratpack {
145149 handlers {
146150 put(" v0.4/traces" ) {
147- response. status(200 ). send()
151+ def status = request. contentLength > 0 ? 200 : 500
152+ response. status(status). send()
148153 }
149154 put(" v0.4/services" ) {
150- response. status(200 ). send()
155+ def status = request. contentLength > 0 ? 200 : 500
156+ response. status(status). send()
151157 }
152158 }
153159 }
@@ -167,7 +173,8 @@ class DDApiTest extends Specification {
167173 def agent = ratpack {
168174 handlers {
169175 put(" v0.4/traces" ) {
170- response. status(200 ). send()
176+ def status = request. contentLength > 0 ? 200 : 500
177+ response. status(status). send()
171178 }
172179 put(" v0.4/services" ) {
173180 response. status(404 ). send()
@@ -193,7 +200,8 @@ class DDApiTest extends Specification {
193200 def agent = ratpack {
194201 handlers {
195202 put(" v0.4/traces" ) {
196- response. status(200 ). send()
203+ def status = request. contentLength > 0 ? 200 : 500
204+ response. status(status). send()
197205 }
198206 put(" v0.4/services" ) {
199207 requestContentType. set(request. contentType)
@@ -243,11 +251,13 @@ class DDApiTest extends Specification {
243251 def agent = ratpack {
244252 handlers {
245253 put(" v0.4/traces" ) {
246- response. status(200 ). send(' {"hello":"test"}' )
254+ def status = request. contentLength > 0 ? 200 : 500
255+ response. status(status). send(' {"hello":"test"}' )
247256 }
248257 put(" v0.4/services" ) {
249258 if (servicesAvailable) {
250- response. status(200 ). send(' {"service-response":"from-test"}' )
259+ def status = request. contentLength > 0 ? 200 : 500
260+ response. status(status). send(' {"service-response":"from-test"}' )
251261 } else {
252262 response. status(404 ). send(' {"service-response":"from-test"}' )
253263 }
@@ -280,10 +290,12 @@ class DDApiTest extends Specification {
280290 def v3Agent = ratpack {
281291 handlers {
282292 put(" v0.3/traces" ) {
283- response. status(200 ). send()
293+ def status = request. contentLength > 0 ? 200 : 500
294+ response. status(status). send()
284295 }
285296 put(" v0.3/services" ) {
286- response. status(200 ). send()
297+ def status = request. contentLength > 0 ? 200 : 500
298+ response. status(status). send()
287299 }
288300 }
289301 }
@@ -307,21 +319,25 @@ class DDApiTest extends Specification {
307319 def agent = ratpack {
308320 handlers {
309321 put(" v0.3 / traces" ) {
310- response.status(200).send()
322+ def status = request.contentLength > 0 ? 200 : 500
323+ response.status(status).send()
311324 }
312325 put(" v0.3 / services" ) {
313- response.status(200).send()
326+ def status = request.contentLength > 0 ? 200 : 500
327+ response.status(status).send()
314328 }
315329 put(" v0.4 / traces" ) {
316330 Blocking.exec {
317331 Thread.sleep(delayTrace)
318- response.status(200).send()
332+ def status = request.contentLength > 0 ? 200 : 500
333+ response.status(status).send()
319334 }
320335 }
321336 put(" v0.4 / services" ) {
322337 Blocking.exec {
323338 Thread.sleep(delayServices)
324- response.status(200).send()
339+ def status = request.contentLength > 0 ? 200 : 500
340+ response.status(status).send()
325341 }
326342 }
327343 }
0 commit comments