Skip to content

Commit aa4013e

Browse files
committed
Fixed warnings
1 parent 2801d8a commit aa4013e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

spring-context/src/test/java/org/springframework/cache/CacheRxJavaTests.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
import rx.Single;
3131
import rx.observers.TestSubscriber;
3232

33-
import java.util.List;
34-
3533
import static org.junit.Assert.*;
3634

3735
/**
@@ -148,9 +146,7 @@ public Single<Object> nullValue() {
148146
@Cacheable("throwable")
149147
@Override
150148
public Single<Object> throwable() {
151-
return Single.fromCallable(() -> {
152-
throw new RuntimeException();
153-
});
149+
return Single.error(new RuntimeException());
154150
}
155151

156152
@Cacheable("neverFinish")

spring-context/src/test/java/org/springframework/cache/ReactorTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public void nullValue() {
8686

8787
// Mono values cannot be null
8888
testSubscriber.assertError();
89+
assertNull("Shouldn't be cached", cache.get(SimpleKey.EMPTY));
8990
}
9091

9192
@Test
@@ -167,9 +168,7 @@ public Mono<Object> nullValue() {
167168
@Cacheable("throwable")
168169
@Override
169170
public Mono<Object> throwable() {
170-
return Mono.fromCallable(() -> {
171-
throw new RuntimeException();
172-
});
171+
return Mono.error(new RuntimeException());
173172
}
174173

175174
@Cacheable("neverFinish")

0 commit comments

Comments
 (0)