BleutradeDigest extends BaseParamsDigest { @Override public String digestParams(RestInvocation restInvocation) { String invocationUrl = restInvocation.getInvocationUrl(); Mac mac = getMac(); mac.update(invocationUrl.getBytes()); return String.format("%0128x", new BigInteger(1, mac.doFinal())); } private  BleutradeDigest(String secretKeyBase64); static BleutradeDigest createInstance(String secretKeyBase64); @Override String digestParams(RestInvocation restInvocation);  }
@Test public void shouldEncodeRestInvocation() throws Exception { RestInvocation invocation = new RestInvocation(null, null, null, null, "rest body", null, null, null); String expected = "6372f349eea659b26f5e01bc76e1485de744a1894d5e036b98eca724a8104719ea8767518286863d1becd0a1313ad5e7e507749f7cdb98a4dee92fec055643c4"; String encoded = bleutradeDigest.digestParams(invocation); assertThat(encoded).isEqualTo(expected); }