From 22a426fe396169b4f39c498fc84b19d8f910da14 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 28 Nov 2017 10:50:05 +0000 Subject: [PATCH] Polish --- .../cloudfoundry/reactive/ReactiveTokenValidator.java | 11 +++++------ .../CassandraReactiveDataAutoConfiguration.java | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveTokenValidator.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveTokenValidator.java index b3eaca60ef..cbafdbccc2 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveTokenValidator.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveTokenValidator.java @@ -74,14 +74,13 @@ class ReactiveTokenValidator { return Mono.just(this.cachedTokenKeys) .filter((tokenKeys) -> tokenKeys.containsKey(keyId)) .switchIfEmpty(this.securityService.fetchTokenKeys() - .doOnSuccess(fetchedTokenKeys -> { + .doOnSuccess((fetchedTokenKeys) -> { this.cachedTokenKeys.clear(); this.cachedTokenKeys.putAll(fetchedTokenKeys); - }) - .filter((tokenKeys) -> tokenKeys.containsKey(keyId)) - .switchIfEmpty((Mono.error( - new CloudFoundryAuthorizationException(Reason.INVALID_KEY_ID, - "Key Id present in token header does not match"))))) + }).filter((tokenKeys) -> tokenKeys.containsKey(keyId)) + .switchIfEmpty((Mono.error(new CloudFoundryAuthorizationException( + Reason.INVALID_KEY_ID, + "Key Id present in token header does not match"))))) .filter((tokenKeys) -> hasValidSignature(token, tokenKeys.get(keyId))) .switchIfEmpty(Mono.error(new CloudFoundryAuthorizationException( Reason.INVALID_SIGNATURE, "RSA Signature did not match content"))) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveDataAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveDataAutoConfiguration.java index 26e7944a68..1df76b81f7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveDataAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveDataAutoConfiguration.java @@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.data.cassandra; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Session; import reactor.core.publisher.Flux; -import reactor.core.scheduler.Schedulers; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -52,7 +51,7 @@ public class CassandraReactiveDataAutoConfiguration { @Bean @ConditionalOnMissingBean(ReactiveSession.class) public ReactiveSession reactiveCassandraSession(Session session) { - return new DefaultBridgedReactiveSession(session, Schedulers.elastic()); + return new DefaultBridgedReactiveSession(session); } @Bean