@Test
public void testRequestOnly() throws Exception
{
ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/signed/request-only"), executor);
DKIMSignature contentSignature = new DKIMSignature();
contentSignature.setDomain("samplezone.org");
contentSignature.setSelector("test");
contentSignature.setPrivateKey(keys.getPrivate());
contentSignature.setBodyHashRequired(false);
contentSignature.setAttribute("method", "GET");
contentSignature.setAttribute("uri", "/signed/request-only");
contentSignature.setAttribute("token", "1122");
request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
ClientResponse response = request.delete();
Assert.assertEquals(200, response.getStatus());
String signatureHeader = (String)response.getResponseHeaders().getFirst(DKIMSignature.DKIM_SIGNATURE);
contentSignature = new DKIMSignature(signatureHeader);
Verification verification = new Verification(keys.getPublic());
verification.setBodyHashRequired(false);
verification.getRequiredAttributes().put("token", "1122");
verification.verify(contentSignature, response.getResponseHeaders(), null, keys.getPublic());
response.releaseConnection();