NotificationUtils implements Serializable { public boolean isHashValid(Map<String, String> parameterMap, String secret) { Map<String, String> map = new HashMap<String, String>(parameterMap); map.put("notification_secret", secret); checkAllParametersNotNull(map); String realHash = calculateHash(map); String sha1HashParam = map.get("sha1_hash"); boolean equals = realHash.equalsIgnoreCase(sha1HashParam); if (!equals) { LOG.debug("the hashes are not equals. expected: " + realHash + ", but received: " + sha1HashParam); } return equals; }  boolean isHashValid(Map<String, String> parameterMap, String secret); String calculateHash(Map<String, String> parameterMap, String secret); static final String[] EXPECTED_PARAMS_ARRAY; }
@Test public void testCheckHash() throws Exception { assertTrue(NOTIFICATION_UTILS.isHashValid(createParamsMap(), SECRET)); }