Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 591b0b1

Browse files
author
kimyonghwa
committed
reactive redis test
1 parent 9af76a9 commit 591b0b1

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

‎src/test/java/com/redis/cluster/ReactiveRedisClusterTest.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.redis.cluster;
22

3+
import lombok.extern.slf4j.Slf4j;
34
import org.junit.Test;
45
import org.junit.runner.RunWith;
56
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +14,7 @@
1314

1415
import java.util.*;
1516

17+
@Slf4j
1618
@RunWith(SpringRunner.class)
1719
@SpringBootTest
1820
public class ReactiveRedisClusterTest {
@@ -30,22 +32,19 @@ public class ReactiveRedisClusterTest {
3032
public void opsValue() {
3133
ReactiveValueOperations<String, String> valueOps = reactiveRedisTemplate.opsForValue();
3234
Set<String> cacheKeys = new HashSet<>();
33-
Map<String, String> setDatas = new HashMap<>();
34-
for (int i = 0; i < 10; i++) {
35+
// async process
36+
log.info("Step-1");
37+
for (int i = 0; i < 5000; i++) {
3538
String key = "value_" + i;
3639
cacheKeys.add(key);
37-
setDatas.put(key, String.valueOf(i));
40+
valueOps.set(key, String.valueOf(i));
3841
}
39-
// previous key delete - sync process
40-
redisTemplate.delete(cacheKeys);
41-
42-
// async process
43-
Mono<Boolean> results = valueOps.multiSet(setDatas);
44-
StepVerifier.create(results).expectNext(true).verifyComplete();
45-
42+
log.info("Step-2");
4643
Mono<List<String>> values = valueOps.multiGet(cacheKeys);
44+
log.info("Step-3");
4745
StepVerifier.create(values)
48-
.expectNextMatches(x -> x.size() == 10).verifyComplete();
46+
.expectNextMatches(x -> x.size() == 5000).verifyComplete();
47+
log.info("Step-4");
4948
}
5049

5150
/**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /