Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement `getRAnk()` in `CapacityDaoRedisImplTest.java`.
  • Loading branch information
J-A-I-L committed Jul 6, 2022
1 parent 7cf37c7 commit 28c2a1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ public CapacityReport getReport(Integer limit) {
@Override
public Long getRank(Long siteId) {
// START Challenge #4
return -2L;
String key = RedisSchema.getCapacityRankingKey();

try (Jedis jedis = jedisPool.getResource()) {
final Long rank = jedis.zrevrank(key, siteId.toString());
return rank;
}
// END Challenge #4
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public void getReport() {
}

// Challenge #4
@Ignore
@Test
public void getRank() {
CapacityDao dao = new CapacityDaoRedisImpl(jedisPool);
Expand Down

0 comments on commit 28c2a1a

Please sign in to comment.