Remove deprecation warnings with Context.putAll

Closes gh-11476
This commit is contained in:
Steve Riesenberg 2022-07-08 14:36:20 -05:00
parent 7da34cfa2c
commit 206c6ffb54
No known key found for this signature in database
GPG Key ID: 5F311AB48A55D521
3 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ javaPlatform {
dependencies {
api platform("org.springframework:spring-framework-bom:$springFrameworkVersion")
api platform("io.projectreactor:reactor-bom:2020.0.19")
api platform("io.projectreactor:reactor-bom:2022.0.0-M2")
api platform("io.rsocket:rsocket-bom:1.1.2")
api platform("org.junit:junit-bom:5.9.0-M1")
api platform("org.springframework.data:spring-data-bom:2022.0.0-M4")

View File

@ -107,7 +107,7 @@ public class ReactorContextTestExecutionListener extends DelegatingTestExecution
return context;
}
Context toMerge = ReactiveSecurityContextHolder.withSecurityContext(Mono.just(this.securityContext));
return toMerge.putAll(context);
return toMerge.putAll(context.readOnly());
}
@Override

View File

@ -49,8 +49,8 @@ public class ReactorContextWebFilter implements WebFilter {
}
private Context withSecurityContext(Context mainContext, ServerWebExchange exchange) {
return mainContext
.putAll(this.repository.load(exchange).as(ReactiveSecurityContextHolder::withSecurityContext));
return mainContext.putAll(
this.repository.load(exchange).as(ReactiveSecurityContextHolder::withSecurityContext).readOnly());
}
}