@Test
public void testSaltedHash() {

    LOG.info("testSaltedHash");
    final String token = "123456";
    final SHA1Hash hash = SHA1Hash.saltedHash(token);
    Assert.assertNotNull(hash);
    // Check that hashed token is not empty, and it not the same as the plaintext token.
    final String hashedToken = hash.toString();
    Assert.assertNotNull(hashedToken);
    Assert.assertFalse(hashedToken.isEmpty());
    Assert.assertFalse(token.equals(hashedToken));
    // Check that actual salt was generated.
    final String salt = hash.getSalt();
    Assert.assertNotNull(salt);
    Assert.assertFalse(salt.isEmpty());
}