Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
ba5c57c1
Commit
ba5c57c1
authored
Mar 09, 2021
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.3.x' into 2.4.x
Closes gh-25555
parents
fab45e4d
84637acb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
RSocketServerAutoConfiguration.java
...autoconfigure/rsocket/RSocketServerAutoConfiguration.java
+2
-1
RSocketServerAutoConfigurationTests.java
...onfigure/rsocket/RSocketServerAutoConfigurationTests.java
+13
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketServerAutoConfiguration.java
View file @
ba5c57c1
/*
* Copyright 2012-202
0
the original author or authors.
* Copyright 2012-202
1
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -78,6 +78,7 @@ public class RSocketServerAutoConfiguration {
}
@ConditionalOnProperty
(
prefix
=
"spring.rsocket.server"
,
name
=
"port"
)
@ConditionalOnClass
(
ReactorResourceFactory
.
class
)
@Configuration
(
proxyBeanMethods
=
false
)
static
class
EmbeddedServerAutoConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketServerAutoConfigurationTests.java
View file @
ba5c57c1
/*
* Copyright 2012-202
0
the original author or authors.
* Copyright 2012-202
1
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -19,10 +19,13 @@ package org.springframework.boot.autoconfigure.rsocket;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener
;
import
org.springframework.boot.logging.LogLevel
;
import
org.springframework.boot.rsocket.context.RSocketPortInfoApplicationContextInitializer
;
import
org.springframework.boot.rsocket.context.RSocketServerBootstrap
;
import
org.springframework.boot.rsocket.server.RSocketServerCustomizer
;
import
org.springframework.boot.rsocket.server.RSocketServerFactory
;
import
org.springframework.boot.test.context.FilteredClassLoader
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner
;
import
org.springframework.boot.web.server.WebServerFactoryCustomizer
;
...
...
@@ -30,6 +33,7 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.codec.CharSequenceEncoder
;
import
org.springframework.core.codec.StringDecoder
;
import
org.springframework.http.client.reactive.ReactorResourceFactory
;
import
org.springframework.messaging.rsocket.RSocketStrategies
;
import
org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler
;
import
org.springframework.util.unit.DataSize
;
...
...
@@ -141,6 +145,14 @@ class RSocketServerAutoConfigurationTests {
.
containsExactly
(
"customNettyRouteProvider"
));
}
@Test
void
whenSpringWebIsNotPresentThenEmbeddedServerConfigurationBacksOff
()
{
contextRunner
().
withClassLoader
(
new
FilteredClassLoader
(
ReactorResourceFactory
.
class
))
.
withInitializer
(
new
ConditionEvaluationReportLoggingListener
(
LogLevel
.
INFO
))
.
withPropertyValues
(
"spring.rsocket.server.port=0"
)
.
run
((
context
)
->
assertThat
(
context
).
doesNotHaveBean
(
RSocketServerFactory
.
class
));
}
private
ApplicationContextRunner
contextRunner
()
{
return
new
ApplicationContextRunner
().
withUserConfiguration
(
BaseConfiguration
.
class
)
.
withConfiguration
(
AutoConfigurations
.
of
(
RSocketServerAutoConfiguration
.
class
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment