@Test public void deleteHashEntryFailTest() { when(this.redisConnection.hdel((String) Matchers.anyObject(), (String) Matchers.anyObject())) .thenReturn(new Long(0)); assertFalse("Hash entry delete Fail", this.lettuceManagement.deleteHashEntries(this.hashName, this.key)); }
@Override public Boolean deleteHashEntries(String hashName, String... fields) { LOG.debug("Delete hash map {}", hashName); Long deletedEntries = this.redisConnection.hdel(hashName, fields); LOG.debug("{} fields from hash map {} has been deleted", deletedEntries, hashName); return Long.valueOf(fields.length).equals(deletedEntries); }
LettuceManagementImpl implements LettuceManagement { @Override public Boolean deleteHashEntries(String hashName, String... fields) { LOG.debug("Delete hash map {}", hashName); Long deletedEntries = this.redisConnection.hdel(hashName, fields); LOG.debug("{} fields from hash map {} has been deleted", deletedEntries, hashName); return Long.valueOf(fields.length).equals(deletedEntries); } }
LettuceManagementImpl implements LettuceManagement { @Override public Boolean deleteHashEntries(String hashName, String... fields) { LOG.debug("Delete hash map {}", hashName); Long deletedEntries = this.redisConnection.hdel(hashName, fields); LOG.debug("{} fields from hash map {} has been deleted", deletedEntries, hashName); return Long.valueOf(fields.length).equals(deletedEntries); }  }
LettuceManagementImpl implements LettuceManagement { @Override public Boolean deleteHashEntries(String hashName, String... fields) { LOG.debug("Delete hash map {}", hashName); Long deletedEntries = this.redisConnection.hdel(hashName, fields); LOG.debug("{} fields from hash map {} has been deleted", deletedEntries, hashName); return Long.valueOf(fields.length).equals(deletedEntries); }  @Override boolean setHashEntry(String hashName, String key, String value); @Override String getHashEntry(String hashName, String key); @Override Map<String, String> getHash(String hashName); @Override Boolean hashEntryExists(String hashName, String key); @Override String setHash(String hashName, Map<String, String> map); @Override Boolean deleteHashEntries(String hashName, String... fields); }
LettuceManagementImpl implements LettuceManagement { @Override public Boolean deleteHashEntries(String hashName, String... fields) { LOG.debug("Delete hash map {}", hashName); Long deletedEntries = this.redisConnection.hdel(hashName, fields); LOG.debug("{} fields from hash map {} has been deleted", deletedEntries, hashName); return Long.valueOf(fields.length).equals(deletedEntries); }  @Override boolean setHashEntry(String hashName, String key, String value); @Override String getHashEntry(String hashName, String key); @Override Map<String, String> getHash(String hashName); @Override Boolean hashEntryExists(String hashName, String key); @Override String setHash(String hashName, Map<String, String> map); @Override Boolean deleteHashEntries(String hashName, String... fields);  }