File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
spring-context/src/test/java/org/springframework/cache Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 30
30
import rx .Single ;
31
31
import rx .observers .TestSubscriber ;
32
32
33
- import java .util .List ;
34
-
35
33
import static org .junit .Assert .*;
36
34
37
35
/**
@@ -148,9 +146,7 @@ public Single<Object> nullValue() {
148
146
@ Cacheable ("throwable" )
149
147
@ Override
150
148
public Single <Object > throwable () {
151
- return Single .fromCallable (() -> {
152
- throw new RuntimeException ();
153
- });
149
+ return Single .error (new RuntimeException ());
154
150
}
155
151
156
152
@ Cacheable ("neverFinish" )
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ public void nullValue() {
86
86
87
87
// Mono values cannot be null
88
88
testSubscriber .assertError ();
89
+ assertNull ("Shouldn't be cached" , cache .get (SimpleKey .EMPTY ));
89
90
}
90
91
91
92
@ Test
@@ -167,9 +168,7 @@ public Mono<Object> nullValue() {
167
168
@ Cacheable ("throwable" )
168
169
@ Override
169
170
public Mono <Object > throwable () {
170
- return Mono .fromCallable (() -> {
171
- throw new RuntimeException ();
172
- });
171
+ return Mono .error (new RuntimeException ());
173
172
}
174
173
175
174
@ Cacheable ("neverFinish" )
You can’t perform that action at this time.
0 commit comments