Class groovyx.net.http.JavaHttpBuilderSpec

6

tests

0

failures

0

ignored

1.432s

duration

100%

successful

Tests

Test Duration Result
FromServer hasBody should return false when there is no content 0.157s passed
FromServer hasBody should return true when there is content 0.130s passed
Sending/Receiving JSON Data (POST) 0.318s passed
access to client implementation unsupported 0.115s passed
client customization unsupported 0.135s passed
client-specific configuration 0.577s passed

Standard output

19:16:20.518 [Test worker] DEBUG ersatz.undertow - starting undertow server ersatz.undertow.Undertow@3eae24d5
19:16:20.521 [XNIO-3 I/O-1] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-3 I/O-1', selector sun.nio.ch.EPollSelectorImpl@5ee05afb
19:16:20.543 [XNIO-3 I/O-3] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-3 I/O-3', selector sun.nio.ch.EPollSelectorImpl@6fe509ad
19:16:20.543 [XNIO-3 I/O-2] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-3 I/O-2', selector sun.nio.ch.EPollSelectorImpl@34277a17
19:16:20.559 [XNIO-3 I/O-4] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-3 I/O-4', selector sun.nio.ch.EPollSelectorImpl@cf32b2f
19:16:20.574 [XNIO-3 I/O-5] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-3 I/O-5', selector sun.nio.ch.EPollSelectorImpl@72b016f
19:16:20.586 [XNIO-3 I/O-6] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-3 I/O-6', selector sun.nio.ch.EPollSelectorImpl@6c546d02
19:16:20.599 [XNIO-3 I/O-7] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-3 I/O-7', selector sun.nio.ch.EPollSelectorImpl@7d8bf475
19:16:20.604 [XNIO-3 I/O-8] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-3 I/O-8', selector sun.nio.ch.EPollSelectorImpl@1f670847
19:16:20.605 [Test worker] DEBUG ersatz.undertow - Configuring listener with protocol HTTP for interface localhost and port 0
19:16:20.611 [Test worker] DEBUG groovyx.net.http.JavaHttpBuilder - Request-URI(GET): http://localhost:45735/foo
19:16:20.612 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Request-Header: Accept-Encoding -> [gzip, deflate]
19:16:20.613 [XNIO-3 Accept] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-3 Accept', selector sun.nio.ch.EPollSelectorImpl@492ce32f
19:16:20.626 [XNIO-3 task-1] DEBUG com.stehno.ersatz.ErsatzServer - Request: { GET /foo (query=[:], headers={Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2], Connection=[keep-alive], Accept-Encoding=[gzip, deflate], User-Agent=[Java/1.8.0_222], Host=[localhost:45735]}, cookies=[:]): <empty> }
19:16:20.634 [XNIO-3 task-1] DEBUG com.stehno.ersatz.ErsatzServer - Response({Content-Type=[text/plain]}): ok
19:16:20.635 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.content - Response-Body: ok
19:16:20.636 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Content-Encoding -> gzip
19:16:20.636 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Connection -> keep-alive
19:16:20.636 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Content-Type -> text/plain
19:16:20.636 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Content-Length -> 22
19:16:20.636 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Date -> Sun, 11 Aug 2019 00:16:17 GMT
19:16:21.079 [Test worker] DEBUG ersatz.undertow - stopping undertow server ersatz.undertow.Undertow@3eae24d5
19:16:21.083 [Test worker] DEBUG ersatz.undertow - starting undertow server ersatz.undertow.Undertow@1ba970c4
19:16:21.097 [XNIO-4 I/O-1] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-4 I/O-1', selector sun.nio.ch.EPollSelectorImpl@36ae86ea
19:16:21.114 [XNIO-4 I/O-2] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-4 I/O-2', selector sun.nio.ch.EPollSelectorImpl@3d0220c3
19:16:21.122 [XNIO-4 I/O-3] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-4 I/O-3', selector sun.nio.ch.EPollSelectorImpl@646fcd9c
19:16:21.130 [XNIO-4 I/O-4] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-4 I/O-4', selector sun.nio.ch.EPollSelectorImpl@60aa203a
19:16:21.153 [XNIO-4 I/O-5] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-4 I/O-5', selector sun.nio.ch.EPollSelectorImpl@96ff822
19:16:21.157 [XNIO-4 I/O-6] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-4 I/O-6', selector sun.nio.ch.EPollSelectorImpl@39eab7c9
19:16:21.167 [XNIO-4 I/O-7] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-4 I/O-7', selector sun.nio.ch.EPollSelectorImpl@539a8406
19:16:21.182 [XNIO-4 I/O-8] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-4 I/O-8', selector sun.nio.ch.EPollSelectorImpl@b18efbb
19:16:21.185 [Test worker] DEBUG ersatz.undertow - Configuring listener with protocol HTTP for interface localhost and port 0
19:16:21.185 [XNIO-4 Accept] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-4 Accept', selector sun.nio.ch.EPollSelectorImpl@601e565a
19:16:21.191 [Test worker] DEBUG ersatz.undertow - stopping undertow server ersatz.undertow.Undertow@1ba970c4
19:16:21.201 [Test worker] DEBUG ersatz.undertow - starting undertow server ersatz.undertow.Undertow@1236def1
19:16:21.238 [XNIO-5 I/O-1] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-5 I/O-1', selector sun.nio.ch.EPollSelectorImpl@5deb559
19:16:21.242 [XNIO-5 I/O-2] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-5 I/O-2', selector sun.nio.ch.EPollSelectorImpl@25d85c66
19:16:21.252 [XNIO-5 I/O-3] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-5 I/O-3', selector sun.nio.ch.EPollSelectorImpl@63fb3a8d
19:16:21.263 [XNIO-5 I/O-5] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-5 I/O-5', selector sun.nio.ch.EPollSelectorImpl@6f703aa3
19:16:21.266 [XNIO-5 I/O-4] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-5 I/O-4', selector sun.nio.ch.EPollSelectorImpl@6a187aea
19:16:21.272 [XNIO-5 I/O-6] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-5 I/O-6', selector sun.nio.ch.EPollSelectorImpl@1ac47d9a
19:16:21.273 [XNIO-5 I/O-7] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-5 I/O-7', selector sun.nio.ch.EPollSelectorImpl@7b9279a3
19:16:21.281 [XNIO-5 I/O-8] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-5 I/O-8', selector sun.nio.ch.EPollSelectorImpl@6f6b3599
19:16:21.290 [Test worker] DEBUG ersatz.undertow - Configuring listener with protocol HTTP for interface localhost and port 0
19:16:21.298 [XNIO-5 Accept] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-5 Accept', selector sun.nio.ch.EPollSelectorImpl@1f31b6bc
19:16:21.316 [Test worker] DEBUG ersatz.undertow - stopping undertow server ersatz.undertow.Undertow@1236def1
19:16:21.339 [Test worker] DEBUG ersatz.undertow - starting undertow server ersatz.undertow.Undertow@7c0d8f66
19:16:21.346 [XNIO-6 I/O-1] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-6 I/O-1', selector sun.nio.ch.EPollSelectorImpl@6b94b339
19:16:21.363 [XNIO-6 I/O-3] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-6 I/O-3', selector sun.nio.ch.EPollSelectorImpl@29724126
19:16:21.367 [XNIO-6 I/O-4] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-6 I/O-4', selector sun.nio.ch.EPollSelectorImpl@25ba2946
19:16:21.370 [XNIO-6 I/O-2] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-6 I/O-2', selector sun.nio.ch.EPollSelectorImpl@1f6df024
19:16:21.371 [XNIO-6 I/O-5] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-6 I/O-5', selector sun.nio.ch.EPollSelectorImpl@2a96f9bb
19:16:21.389 [XNIO-6 I/O-6] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-6 I/O-6', selector sun.nio.ch.EPollSelectorImpl@63b92e13
19:16:21.399 [XNIO-6 I/O-8] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-6 I/O-8', selector sun.nio.ch.EPollSelectorImpl@61fa4870
19:16:21.405 [Test worker] DEBUG ersatz.undertow - Configuring listener with protocol HTTP for interface localhost and port 0
19:16:21.404 [XNIO-6 I/O-7] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-6 I/O-7', selector sun.nio.ch.EPollSelectorImpl@387ea257
19:16:21.405 [XNIO-6 Accept] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-6 Accept', selector sun.nio.ch.EPollSelectorImpl@147703f9
19:16:21.461 [Test worker] DEBUG groovyx.net.http.JavaHttpBuilder - Request-URI(POST): http://localhost:44705/foo
19:16:21.466 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Request-Header: Accept-Encoding -> [gzip, deflate]
19:16:21.485 [XNIO-6 task-1] DEBUG com.stehno.ersatz.ErsatzServer - Request: { POST /foo (query=[:], headers={Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2], Connection=[keep-alive], Accept-Encoding=[gzip, deflate], User-Agent=[Java/1.8.0_222], Host=[localhost:44705]}, cookies=[:]): <empty> }
19:16:21.486 [XNIO-6 task-1] DEBUG com.stehno.ersatz.ErsatzServer - Response({}): <empty>
19:16:21.487 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.content - Response-Body: null
19:16:21.487 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Connection -> keep-alive
19:16:21.487 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Content-Length -> 0
19:16:21.487 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Date -> Sun, 11 Aug 2019 00:16:17 GMT
19:16:21.488 [Test worker] DEBUG ersatz.undertow - stopping undertow server ersatz.undertow.Undertow@7c0d8f66
19:16:21.493 [Test worker] DEBUG ersatz.undertow - starting undertow server ersatz.undertow.Undertow@4532960d
19:16:21.504 [XNIO-7 I/O-1] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-7 I/O-1', selector sun.nio.ch.EPollSelectorImpl@1021e672
19:16:21.507 [XNIO-7 I/O-2] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-7 I/O-2', selector sun.nio.ch.EPollSelectorImpl@39c8ba65
19:16:21.509 [XNIO-7 I/O-3] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-7 I/O-3', selector sun.nio.ch.EPollSelectorImpl@46d1b03a
19:16:21.514 [XNIO-7 I/O-4] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-7 I/O-4', selector sun.nio.ch.EPollSelectorImpl@3d80e9ce
19:16:21.515 [XNIO-7 I/O-5] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-7 I/O-5', selector sun.nio.ch.EPollSelectorImpl@754a13c6
19:16:21.528 [XNIO-7 I/O-7] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-7 I/O-7', selector sun.nio.ch.EPollSelectorImpl@59627688
19:16:21.531 [XNIO-7 I/O-8] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-7 I/O-8', selector sun.nio.ch.EPollSelectorImpl@4fb25524
19:16:21.538 [Test worker] DEBUG ersatz.undertow - Configuring listener with protocol HTTP for interface localhost and port 0
19:16:21.538 [XNIO-7 I/O-6] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-7 I/O-6', selector sun.nio.ch.EPollSelectorImpl@3b5d134a
19:16:21.541 [XNIO-7 Accept] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-7 Accept', selector sun.nio.ch.EPollSelectorImpl@757e6bf8
19:16:21.588 [Test worker] INFO TESTING - Configuration: POST->http://localhost:34983/foo
19:16:21.589 [Test worker] DEBUG groovyx.net.http.JavaHttpBuilder - Request-URI(POST): http://localhost:34983/foo
19:16:21.591 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Request-Header: Accept-Encoding -> [gzip, deflate]
19:16:21.604 [XNIO-7 task-1] DEBUG com.stehno.ersatz.ErsatzServer - Request: { POST /foo (query=[:], headers={Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2], Connection=[keep-alive], Accept-Encoding=[gzip, deflate], User-Agent=[Java/1.8.0_222], Host=[localhost:34983]}, cookies=[:]): <empty> }
19:16:21.617 [XNIO-7 task-1] DEBUG com.stehno.ersatz.ErsatzServer - Response({Content-Type=[text/plain]}): OK
19:16:21.618 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.content - Response-Body: OK
19:16:21.619 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Content-Encoding -> gzip
19:16:21.619 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Connection -> keep-alive
19:16:21.619 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Content-Type -> text/plain
19:16:21.619 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Content-Length -> 22
19:16:21.619 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Date -> Sun, 11 Aug 2019 00:16:17 GMT
19:16:21.620 [Test worker] DEBUG ersatz.undertow - stopping undertow server ersatz.undertow.Undertow@4532960d
19:16:21.623 [Test worker] DEBUG ersatz.undertow - starting undertow server ersatz.undertow.Undertow@15b51202
19:16:21.631 [XNIO-8 I/O-1] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-8 I/O-1', selector sun.nio.ch.EPollSelectorImpl@154206d3
19:16:21.658 [XNIO-8 I/O-2] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-8 I/O-2', selector sun.nio.ch.EPollSelectorImpl@77cc039f
19:16:21.666 [XNIO-8 I/O-3] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-8 I/O-3', selector sun.nio.ch.EPollSelectorImpl@2e575203
19:16:21.666 [XNIO-8 I/O-4] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-8 I/O-4', selector sun.nio.ch.EPollSelectorImpl@6082e4ba
19:16:21.686 [XNIO-8 I/O-5] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-8 I/O-5', selector sun.nio.ch.EPollSelectorImpl@13811689
19:16:21.695 [XNIO-8 I/O-6] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-8 I/O-6', selector sun.nio.ch.EPollSelectorImpl@3183f299
19:16:21.699 [XNIO-8 I/O-7] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-8 I/O-7', selector sun.nio.ch.EPollSelectorImpl@603d7748
19:16:21.704 [XNIO-8 I/O-8] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-8 I/O-8', selector sun.nio.ch.EPollSelectorImpl@2bd08623
19:16:21.705 [Test worker] DEBUG ersatz.undertow - Configuring listener with protocol HTTP for interface localhost and port 0
19:16:21.719 [XNIO-8 Accept] DEBUG ersatz.xnio.nio - Started channel thread 'XNIO-8 Accept', selector sun.nio.ch.EPollSelectorImpl@6970252d
19:16:21.756 [Test worker] DEBUG groovyx.net.http.JavaHttpBuilder - Request-URI(POST): http://httpbin.org/post
19:16:21.757 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Request-Header: Accept-Encoding -> [gzip, deflate]
19:16:21.757 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Request-Header: Content-Type -> [application/json; charset=utf-8]
19:16:21.840 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.content - Request-Body(application/json): {"item":"ASDFASEACV235","score":90786}
19:16:21.897 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.content - Response-Body: {
  "args": {}, 
  "data": "{\"item\":\"ASDFASEACV235\",\"score\":90786}", 
  "files": {}, 
  "form": {}, 
  "headers": {
    "Accept": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2", 
    "Accept-Encoding": "gzip, deflate", 
    "Content-Length": "38", 
    "Content-Type": "application/json; charset=utf-8", 
    "Host": "httpbin.org", 
    "User-Agent": "Java/1.8.0_222"
  }, 
  "json": {
    "item": "ASDFASEACV235", 
    "score": 90786
  }, 
  "origin": "70.121.13.147, 70.121.13.147", 
  "url": "https://httpbin.org/post"
}

19:16:21.898 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Access-Control-Allow-Credentials -> true
19:16:21.898 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Access-Control-Allow-Origin -> *
19:16:21.898 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Content-Encoding -> gzip
19:16:21.899 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Content-Type -> application/json
19:16:21.899 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Date -> Sun, 11 Aug 2019 00:16:21 GMT
19:16:21.899 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Referrer-Policy -> no-referrer-when-downgrade
19:16:21.899 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Server -> nginx
19:16:21.899 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: X-Content-Type-Options -> nosniff
19:16:21.899 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: X-Frame-Options -> DENY
19:16:21.899 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: X-XSS-Protection -> 1; mode=block
19:16:21.899 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Content-Length -> 329
19:16:21.899 [Test worker] DEBUG groovy.net.http.JavaHttpBuilder.headers - Response-Header: Connection -> keep-alive
19:16:21.932 [Test worker] DEBUG ersatz.undertow - stopping undertow server ersatz.undertow.Undertow@15b51202