Test sending of HTTP DELETE requests. @throws Exception exception
()
| 143 | * @throws Exception exception |
| 144 | */ |
| 145 | @Test public final void putDelete() throws Exception { |
| 146 | // add document to be deleted |
| 147 | try(QueryProcessor qp = new QueryProcessor(_HTTP_SEND_REQUEST.args( |
| 148 | " <http:request method='put'>" |
| 149 | + "<http:body media-type='text/xml'><ToBeDeleted/></http:body>" |
| 150 | + "</http:request>", REST_URL), ctx)) { |
| 151 | qp.value(); |
| 152 | } |
| 153 | |
| 154 | // DELETE |
| 155 | try(QueryProcessor qp = new QueryProcessor(_HTTP_SEND_REQUEST.args( |
| 156 | " <http:request method='delete' status-only='true'/>", REST_URL), ctx)) { |
| 157 | checkResponse(qp.value(), 1, 200); |
| 158 | } |
| 159 | |
| 160 | // DELETE (same resource, empty sequence as body, 404 expected) |
| 161 | try(QueryProcessor qp = new QueryProcessor(_HTTP_SEND_REQUEST.args( |
| 162 | " <http:request method='delete'/>", REST_URL, " ()") + "[1]/@status/data()", ctx)) { |
| 163 | assertEquals("404", qp.value().serialize().toString()); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * Test sending of HTTP request without any attributes - error shall be thrown |
nothing calls this directly
no test coverage detected