@Test
public void testRequestOnly() throws Exception
{
//ResteasyClient client = new ResteasyClient();
WebTarget target = client.target(TestPortProvider.generateURL("/signed/request-only"));
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");
Response response = target.request().header(DKIMSignature.DKIM_SIGNATURE, contentSignature).delete();
Assert.assertEquals(200, response.getStatus());
String signatureHeader = (String)response.getHeaderString(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.getStringHeaders(), null, keys.getPublic());
response.close();