Test sending of HTTP GET requests. @throws Exception exception
()
| 113 | * @throws Exception exception |
| 114 | */ |
| 115 | @Test public final void get() throws Exception { |
| 116 | // GET1 - just send a GET request |
| 117 | try(QueryProcessor qp = new QueryProcessor(_HTTP_SEND_REQUEST.args( |
| 118 | " <http:request method='get' href='" + REST_ROOT + "'/>"), ctx)) { |
| 119 | final Value value = qp.value(); |
| 120 | checkResponse(value, 2, 200); |
| 121 | |
| 122 | assertEquals(NodeType.DOCUMENT, value.itemAt(1).type); |
| 123 | } |
| 124 | |
| 125 | // GET2 - with override-media-type='text/plain' |
| 126 | try(QueryProcessor qp = new QueryProcessor(_HTTP_SEND_REQUEST.args( |
| 127 | " <http:request method='get' override-media-type='text/plain'/>", REST_ROOT), ctx)) { |
| 128 | final Value value = qp.value(); |
| 129 | checkResponse(value, 2, 200); |
| 130 | |
| 131 | assertEquals(BasicType.STRING, value.itemAt(1).type); |
| 132 | } |
| 133 | |
| 134 | // Get3 - with status-only='true' |
| 135 | try(QueryProcessor qp = new QueryProcessor(_HTTP_SEND_REQUEST.args( |
| 136 | " <http:request method='get' status-only='true'/>", REST_ROOT), ctx)) { |
| 137 | checkResponse(qp.value(), 1, 200); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * Test sending of HTTP DELETE requests. |
nothing calls this directly
no test coverage detected