org.springframework.data.redis.connection.RedisZSetCommands Java Examples

The following examples show how to use org.springframework.data.redis.connection.RedisZSetCommands. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 6 votes vote down vote up
@Test
public void invokingZRangeByScoreWithScoresCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE_WITHSCORES,
      () -> getConnection()
          .zRangeByScoreWithScores("key".getBytes(), RedisZSetCommands.Range.range()));
  verify(mockRedisConnection())
      .zRangeByScoreWithScores(eq("key".getBytes()), any(RedisZSetCommands.Range.class));

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE_WITHSCORES,
      () -> getConnection().zRangeByScoreWithScores("key".getBytes(), 0D, 0D));
  verify(mockRedisConnection()).zRangeByScoreWithScores("key".getBytes(), 0D, 0D);

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE_WITHSCORES,
      () -> getConnection().zRangeByScoreWithScores("key".getBytes(), 0D, 0D, 0L, 0L));
  verify(mockRedisConnection()).zRangeByScoreWithScores("key".getBytes(), 0D, 0D, 0L, 0L);

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE_WITHSCORES,
      () -> getConnection()
          .zRangeByScoreWithScores("key".getBytes(), RedisZSetCommands.Range.range(),
              RedisZSetCommands.Limit.limit()));
  verify(mockRedisConnection())
      .zRangeByScoreWithScores(eq("key".getBytes()), any(RedisZSetCommands.Range.class),
          any(RedisZSetCommands.Limit.class));
}
 
Example #2
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 6 votes vote down vote up
@Test
public void invokingZRangeByLexCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZRANGEBYLEX,
      () -> getConnection().zRangeByLex("key".getBytes()));
  verify(mockRedisConnection()).zRangeByLex("key".getBytes());

  commandCreatesNewSpan(RedisCommand.ZRANGEBYLEX,
      () -> getConnection().zRangeByLex("key".getBytes(),
          RedisZSetCommands.Range.range()));
  verify(mockRedisConnection())
      .zRangeByLex(eq("key".getBytes()), any(RedisZSetCommands.Range.class));

  commandCreatesNewSpan(RedisCommand.ZRANGEBYLEX,
      () -> getConnection().zRangeByLex("key".getBytes(),
          RedisZSetCommands.Range.range(), RedisZSetCommands.Limit.limit()));
  verify(mockRedisConnection())
      .zRangeByLex(eq("key".getBytes()), any(RedisZSetCommands.Range.class),
          any(RedisZSetCommands.Limit.class));
}
 
Example #3
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 6 votes vote down vote up
@Test
public void invokingZRevRangeByScoreWithScoresCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE_WITHSCORES,
      () -> getConnection().zRevRangeByScoreWithScores("key".getBytes(), 0D, 0D));
  verify(mockRedisConnection()).zRevRangeByScoreWithScores("key".getBytes(), 0D, 0D);

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE_WITHSCORES,
      () -> getConnection().zRevRangeByScoreWithScores("key".getBytes(), 0D, 0D, 0L, 0L));
  verify(mockRedisConnection()).zRevRangeByScoreWithScores("key".getBytes(), 0D, 0D, 0L, 0L);

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE_WITHSCORES,
      () -> getConnection().zRevRangeByScoreWithScores("key".getBytes(),
          RedisZSetCommands.Range.range()));
  verify(mockRedisConnection()).zRevRangeByScoreWithScores(eq("key".getBytes()),
      any(RedisZSetCommands.Range.class));

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE_WITHSCORES,
      () -> getConnection()
          .zRevRangeByScoreWithScores("key".getBytes(), RedisZSetCommands.Range.range(),
              RedisZSetCommands.Limit.limit()));
  verify(mockRedisConnection())
      .zRevRangeByScoreWithScores(eq("key".getBytes()), any(RedisZSetCommands.Range.class),
          any(RedisZSetCommands.Limit.class));
}
 
Example #4
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 6 votes vote down vote up
@Test
public void invokingZRevRangeByScoreCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE,
      () -> getConnection().zRevRangeByScore("key".getBytes(), 0D, 0D));
  verify(mockRedisConnection()).zRevRangeByScore("key".getBytes(), 0D, 0D);

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE,
      () -> getConnection().zRevRangeByScore("key".getBytes(),
          RedisZSetCommands.Range.range()));
  verify(mockRedisConnection())
      .zRevRangeByScore(eq("key".getBytes()), any(RedisZSetCommands.Range.class));

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE,
      () -> getConnection().zRevRangeByScore("key".getBytes(), 0D, 0D, 0L, 0L));
  verify(mockRedisConnection()).zRevRangeByScore("key".getBytes(), 0D, 0D, 0L, 0L);

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE,
      () -> getConnection().zRevRangeByScore("key".getBytes(), RedisZSetCommands.Range.range(),
          RedisZSetCommands.Limit.limit()));
  verify(mockRedisConnection())
      .zRevRangeByScore(eq("key".getBytes()), any(RedisZSetCommands.Range.class),
          any(RedisZSetCommands.Limit.class));
}
 
Example #5
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 6 votes vote down vote up
@Test
public void invokingZRangeByScoreWithScoresCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE_WITHSCORES,
      () -> getConnection()
          .zRangeByScoreWithScores("key".getBytes(), RedisZSetCommands.Range.range()));
  verify(mockRedisConnection())
      .zRangeByScoreWithScores(eq("key".getBytes()), any(RedisZSetCommands.Range.class));

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE_WITHSCORES,
      () -> getConnection().zRangeByScoreWithScores("key".getBytes(), 0D, 0D));
  verify(mockRedisConnection()).zRangeByScoreWithScores("key".getBytes(), 0D, 0D);

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE_WITHSCORES,
      () -> getConnection().zRangeByScoreWithScores("key".getBytes(), 0D, 0D, 0L, 0L));
  verify(mockRedisConnection()).zRangeByScoreWithScores("key".getBytes(), 0D, 0D, 0L, 0L);

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE_WITHSCORES,
      () -> getConnection()
          .zRangeByScoreWithScores("key".getBytes(), RedisZSetCommands.Range.range(),
              RedisZSetCommands.Limit.limit()));
  verify(mockRedisConnection())
      .zRangeByScoreWithScores(eq("key".getBytes()), any(RedisZSetCommands.Range.class),
          any(RedisZSetCommands.Limit.class));
}
 
Example #6
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 6 votes vote down vote up
@Test
public void invokingZRangeByLexCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZRANGEBYLEX,
      () -> getConnection().zRangeByLex("key".getBytes()));
  verify(mockRedisConnection()).zRangeByLex("key".getBytes());

  commandCreatesNewSpan(RedisCommand.ZRANGEBYLEX,
      () -> getConnection().zRangeByLex("key".getBytes(),
          RedisZSetCommands.Range.range()));
  verify(mockRedisConnection())
      .zRangeByLex(eq("key".getBytes()), any(RedisZSetCommands.Range.class));

  commandCreatesNewSpan(RedisCommand.ZRANGEBYLEX,
      () -> getConnection().zRangeByLex("key".getBytes(),
          RedisZSetCommands.Range.range(), RedisZSetCommands.Limit.limit()));
  verify(mockRedisConnection())
      .zRangeByLex(eq("key".getBytes()), any(RedisZSetCommands.Range.class),
          any(RedisZSetCommands.Limit.class));
}
 
Example #7
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 6 votes vote down vote up
@Test
public void invokingZRevRangeByScoreWithScoresCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE_WITHSCORES,
      () -> getConnection().zRevRangeByScoreWithScores("key".getBytes(), 0D, 0D));
  verify(mockRedisConnection()).zRevRangeByScoreWithScores("key".getBytes(), 0D, 0D);

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE_WITHSCORES,
      () -> getConnection().zRevRangeByScoreWithScores("key".getBytes(), 0D, 0D, 0L, 0L));
  verify(mockRedisConnection()).zRevRangeByScoreWithScores("key".getBytes(), 0D, 0D, 0L, 0L);

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE_WITHSCORES,
      () -> getConnection().zRevRangeByScoreWithScores("key".getBytes(),
          RedisZSetCommands.Range.range()));
  verify(mockRedisConnection()).zRevRangeByScoreWithScores(eq("key".getBytes()),
      any(RedisZSetCommands.Range.class));

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE_WITHSCORES,
      () -> getConnection()
          .zRevRangeByScoreWithScores("key".getBytes(), RedisZSetCommands.Range.range(),
              RedisZSetCommands.Limit.limit()));
  verify(mockRedisConnection())
      .zRevRangeByScoreWithScores(eq("key".getBytes()), any(RedisZSetCommands.Range.class),
          any(RedisZSetCommands.Limit.class));
}
 
Example #8
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 6 votes vote down vote up
@Test
public void invokingZRevRangeByScoreCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE,
      () -> getConnection().zRevRangeByScore("key".getBytes(), 0D, 0D));
  verify(mockRedisConnection()).zRevRangeByScore("key".getBytes(), 0D, 0D);

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE,
      () -> getConnection().zRevRangeByScore("key".getBytes(),
          RedisZSetCommands.Range.range()));
  verify(mockRedisConnection())
      .zRevRangeByScore(eq("key".getBytes()), any(RedisZSetCommands.Range.class));

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE,
      () -> getConnection().zRevRangeByScore("key".getBytes(), 0D, 0D, 0L, 0L));
  verify(mockRedisConnection()).zRevRangeByScore("key".getBytes(), 0D, 0D, 0L, 0L);

  commandCreatesNewSpan(RedisCommand.ZREVRANGEBYSCORE,
      () -> getConnection().zRevRangeByScore("key".getBytes(), RedisZSetCommands.Range.range(),
          RedisZSetCommands.Limit.limit()));
  verify(mockRedisConnection())
      .zRevRangeByScore(eq("key".getBytes()), any(RedisZSetCommands.Range.class),
          any(RedisZSetCommands.Limit.class));
}
 
Example #9
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingZUnionStoreCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZUNIONSTORE,
      () -> getConnection().zUnionStore("dst".getBytes(),
          "set".getBytes()));
  verify(mockRedisConnection()).zUnionStore("dst".getBytes(), "set".getBytes());

  commandCreatesNewSpan(RedisCommand.ZUNIONSTORE,
      () -> getConnection().zUnionStore("dst".getBytes(),
          RedisZSetCommands.Aggregate.SUM, new int[]{0}, "set".getBytes()));
  verify(mockRedisConnection())
      .zUnionStore("dst".getBytes(), RedisZSetCommands.Aggregate.SUM, new int[]{0},
          "set".getBytes());
}
 
Example #10
Source File: RedissonConnectionTest.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Test
public void testZScan() {
    connection.zAdd("key".getBytes(), 1, "value1".getBytes());
    connection.zAdd("key".getBytes(), 2, "value2".getBytes());

    Cursor<RedisZSetCommands.Tuple> t = connection.zScan("key".getBytes(), ScanOptions.scanOptions().build());
    assertThat(t.hasNext()).isTrue();
    assertThat(t.next().getValue()).isEqualTo("value1".getBytes());
    assertThat(t.hasNext()).isTrue();
    assertThat(t.next().getValue()).isEqualTo("value2".getBytes());
}
 
Example #11
Source File: RedissonStreamCommands.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public List<ByteRecord> xRevRange(byte[] key, Range<String> range, RedisZSetCommands.Limit limit) {
    return range(new RedisCommand<>("XREVRANGE",
        new ListMultiDecoder2(
                new ByteRecordReplayDecoder(key),
                new ObjectDecoder(new StreamIdDecoder()),
                new StreamObjectMapReplayDecoder()), RedisCommand.ValueType.MAP),
            key, range, limit);
}
 
Example #12
Source File: RedissonStreamCommands.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public List<ByteRecord> xRange(byte[] key, Range<String> range, RedisZSetCommands.Limit limit) {
    return range(new RedisCommand<>("XRANGE",
        new ListMultiDecoder2(
                new ByteRecordReplayDecoder(key),
                new ObjectDecoder(new StreamIdDecoder()),
                new StreamObjectMapReplayDecoder()), RedisCommand.ValueType.MAP),
            key, range, limit);
}
 
Example #13
Source File: RedissonConnectionTest.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Test
public void testZScan() {
    connection.zAdd("key".getBytes(), 1, "value1".getBytes());
    connection.zAdd("key".getBytes(), 2, "value2".getBytes());

    Cursor<RedisZSetCommands.Tuple> t = connection.zScan("key".getBytes(), ScanOptions.scanOptions().build());
    assertThat(t.hasNext()).isTrue();
    assertThat(t.next().getValue()).isEqualTo("value1".getBytes());
    assertThat(t.hasNext()).isTrue();
    assertThat(t.next().getValue()).isEqualTo("value2".getBytes());
}
 
Example #14
Source File: RedissonConnectionTest.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Test
public void testZScan() {
    connection.zAdd("key".getBytes(), 1, "value1".getBytes());
    connection.zAdd("key".getBytes(), 2, "value2".getBytes());

    Cursor<RedisZSetCommands.Tuple> t = connection.zScan("key".getBytes(), ScanOptions.scanOptions().build());
    assertThat(t.hasNext()).isTrue();
    assertThat(t.next().getValue()).isEqualTo("value1".getBytes());
    assertThat(t.hasNext()).isTrue();
    assertThat(t.next().getValue()).isEqualTo("value2".getBytes());
}
 
Example #15
Source File: RedissonStreamCommands.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public List<ByteRecord> xRevRange(byte[] key, Range<String> range, RedisZSetCommands.Limit limit) {
    return range(new RedisCommand<>("XREVRANGE",
        new ListMultiDecoder2(
                new ByteRecordReplayDecoder(key),
                new ObjectDecoder(new StreamIdDecoder()),
                new StreamObjectMapReplayDecoder()), RedisCommand.ValueType.MAP),
            key, range, limit);
}
 
Example #16
Source File: RedissonStreamCommands.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public List<ByteRecord> xRange(byte[] key, Range<String> range, RedisZSetCommands.Limit limit) {
    return range(new RedisCommand<>("XRANGE",
        new ListMultiDecoder2(
                new ByteRecordReplayDecoder(key),
                new ObjectDecoder(new StreamIdDecoder()),
                new StreamObjectMapReplayDecoder()), RedisCommand.ValueType.MAP),
            key, range, limit);
}
 
Example #17
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingZRangeByScoreCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE,
      () -> getConnection().zRangeByScore("key".getBytes(), 0D, 0D, 0L,
          0L));
  verify(mockRedisConnection()).zRangeByScore("key".getBytes(), 0D, 0D, 0L, 0L);

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE,
      () -> getConnection().zRangeByScore("key".getBytes(),
          "min", "max"));
  verify(mockRedisConnection()).zRangeByScore("key".getBytes(), "min", "max");

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE,
      () -> getConnection().zRangeByScore("key".getBytes(),
          RedisZSetCommands.Range.range()));
  verify(mockRedisConnection())
      .zRangeByScore(eq("key".getBytes()), any(RedisZSetCommands.Range.class));

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE,
      () -> getConnection().zRangeByScore("key".getBytes(),
          "min", "max", 0L, 0L));
  verify(mockRedisConnection()).zRangeByScore("key".getBytes(), "min", "max", 0L, 0L);

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE,
      () -> getConnection().zRangeByScore("key".getBytes(),
          RedisZSetCommands.Range.range(), RedisZSetCommands.Limit.limit()));
  verify(mockRedisConnection())
      .zRangeByScore(eq("key".getBytes()), any(RedisZSetCommands.Range.class),
          any(RedisZSetCommands.Limit.class));
}
 
Example #18
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingZInterStoreCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZINTERSTORE,
      () -> getConnection().zInterStore("dst".getBytes(), "set".getBytes()));
  verify(mockRedisConnection()).zInterStore("dst".getBytes(), "set".getBytes());

  commandCreatesNewSpan(RedisCommand.ZINTERSTORE,
      () -> getConnection().zInterStore("dst".getBytes(),
          RedisZSetCommands.Aggregate.SUM, new int[]{0}, "set".getBytes()));
  verify(mockRedisConnection())
      .zInterStore("dst".getBytes(), RedisZSetCommands.Aggregate.SUM, new int[]{0},
          "set".getBytes());
}
 
Example #19
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingZUnionStoreCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZUNIONSTORE,
      () -> getConnection().zUnionStore("dst".getBytes(),
          "set".getBytes()));
  verify(mockRedisConnection()).zUnionStore("dst".getBytes(), "set".getBytes());

  commandCreatesNewSpan(RedisCommand.ZUNIONSTORE,
      () -> getConnection().zUnionStore("dst".getBytes(),
          RedisZSetCommands.Aggregate.SUM, new int[]{0}, "set".getBytes()));
  verify(mockRedisConnection())
      .zUnionStore("dst".getBytes(), RedisZSetCommands.Aggregate.SUM, new int[]{0},
          "set".getBytes());
}
 
Example #20
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingZRemRangeByScoreCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZREMRANGEBYSCORE,
      () -> getConnection().zRemRangeByScore("key".getBytes(), 0D, 0D));
  verify(mockRedisConnection()).zRemRangeByScore("key".getBytes(), 0D, 0D);

  commandCreatesNewSpan(RedisCommand.ZREMRANGEBYSCORE,
      () -> getConnection().zRemRangeByScore("key".getBytes(),
          RedisZSetCommands.Range.range()));
  verify(mockRedisConnection())
      .zRemRangeByScore(eq("key".getBytes()), any(RedisZSetCommands.Range.class));
}
 
Example #21
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingZCountCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZCOUNT,
      () -> getConnection().zCount("key".getBytes(), 0D, 0D));
  verify(mockRedisConnection()).zCount("key".getBytes(), 0D, 0D);

  commandCreatesNewSpan(RedisCommand.ZCOUNT, () -> getConnection().zCount("key".getBytes(),
      RedisZSetCommands.Range.range()));
  verify(mockRedisConnection()).zCount(eq("key".getBytes()), any(RedisZSetCommands.Range.class));
}
 
Example #22
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingZCountCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZCOUNT,
      () -> getConnection().zCount("key".getBytes(), 0D, 0D));
  verify(mockRedisConnection()).zCount("key".getBytes(), 0D, 0D);

  commandCreatesNewSpan(RedisCommand.ZCOUNT, () -> getConnection().zCount("key".getBytes(),
      RedisZSetCommands.Range.range()));
  verify(mockRedisConnection()).zCount(eq("key".getBytes()), any(RedisZSetCommands.Range.class));
}
 
Example #23
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingZRangeByScoreCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE,
      () -> getConnection().zRangeByScore("key".getBytes(), 0D, 0D, 0L,
          0L));
  verify(mockRedisConnection()).zRangeByScore("key".getBytes(), 0D, 0D, 0L, 0L);

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE,
      () -> getConnection().zRangeByScore("key".getBytes(),
          "min", "max"));
  verify(mockRedisConnection()).zRangeByScore("key".getBytes(), "min", "max");

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE,
      () -> getConnection().zRangeByScore("key".getBytes(),
          RedisZSetCommands.Range.range()));
  verify(mockRedisConnection())
      .zRangeByScore(eq("key".getBytes()), any(RedisZSetCommands.Range.class));

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE,
      () -> getConnection().zRangeByScore("key".getBytes(),
          "min", "max", 0L, 0L));
  verify(mockRedisConnection()).zRangeByScore("key".getBytes(), "min", "max", 0L, 0L);

  commandCreatesNewSpan(RedisCommand.ZRANGEBYSCORE,
      () -> getConnection().zRangeByScore("key".getBytes(),
          RedisZSetCommands.Range.range(), RedisZSetCommands.Limit.limit()));
  verify(mockRedisConnection())
      .zRangeByScore(eq("key".getBytes()), any(RedisZSetCommands.Range.class),
          any(RedisZSetCommands.Limit.class));
}
 
Example #24
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingZRemRangeByScoreCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZREMRANGEBYSCORE,
      () -> getConnection().zRemRangeByScore("key".getBytes(), 0D, 0D));
  verify(mockRedisConnection()).zRemRangeByScore("key".getBytes(), 0D, 0D);

  commandCreatesNewSpan(RedisCommand.ZREMRANGEBYSCORE,
      () -> getConnection().zRemRangeByScore("key".getBytes(),
          RedisZSetCommands.Range.range()));
  verify(mockRedisConnection())
      .zRemRangeByScore(eq("key".getBytes()), any(RedisZSetCommands.Range.class));
}
 
Example #25
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingZInterStoreCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.ZINTERSTORE,
      () -> getConnection().zInterStore("dst".getBytes(), "set".getBytes()));
  verify(mockRedisConnection()).zInterStore("dst".getBytes(), "set".getBytes());

  commandCreatesNewSpan(RedisCommand.ZINTERSTORE,
      () -> getConnection().zInterStore("dst".getBytes(),
          RedisZSetCommands.Aggregate.SUM, new int[]{0}, "set".getBytes()));
  verify(mockRedisConnection())
      .zInterStore("dst".getBytes(), RedisZSetCommands.Aggregate.SUM, new int[]{0},
          "set".getBytes());
}
 
Example #26
Source File: TracingRedisConnection.java    From java-redis-client with Apache License 2.0 4 votes vote down vote up
@Override
public RedisZSetCommands zSetCommands() {
  return connection.zSetCommands();
}