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
68aec8b6
Commit
68aec8b6
authored
May 30, 2019
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
23a923d1
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
76 additions
and
47 deletions
+76
-47
ConditionalOnEnabledEndpoint.java
...gure/endpoint/condition/ConditionalOnEnabledEndpoint.java
+2
-1
SpringApplicationHierarchyTests.java
...ctuate/autoconfigure/SpringApplicationHierarchyTests.java
+2
-5
ConditionalOnEnabledEndpointTests.java
...endpoint/condition/ConditionalOnEnabledEndpointTests.java
+1
-0
Autotime.java
...va/org/springframework/boot/actuate/metrics/Autotime.java
+8
-8
RSocketStrategiesAutoConfiguration.java
...configure/rsocket/RSocketStrategiesAutoConfiguration.java
+9
-8
ResourcePropertiesTests.java
...ework/boot/autoconfigure/web/ResourcePropertiesTests.java
+1
-1
JettyWebServerFactoryCustomizerTests.java
...re/web/embedded/JettyWebServerFactoryCustomizerTests.java
+0
-2
ClientHttpConnectorConfigurationTests.java
...unction/client/ClientHttpConnectorConfigurationTests.java
+10
-4
BasicErrorControllerMockMvcTests.java
...e/web/servlet/error/BasicErrorControllerMockMvcTests.java
+2
-1
WebSocketMessagingAutoConfigurationTests.java
...ket/servlet/WebSocketMessagingAutoConfigurationTests.java
+4
-2
spring-boot-features.adoc
...ing-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+16
-2
UserDocumentationTests.java
...onfigure/restdocs/restassured/UserDocumentationTests.java
+1
-1
RestAssuredRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java
...toConfigurationAdvancedConfigurationIntegrationTests.java
+1
-1
RestAssuredRestDocsAutoConfigurationIntegrationTests.java
...RestAssuredRestDocsAutoConfigurationIntegrationTests.java
+1
-1
OutputCaptureExtendWithTests.java
...ork/boot/test/extension/OutputCaptureExtendWithTests.java
+1
-1
OutputCaptureRegisterExtensionTests.java
...t/test/extension/OutputCaptureRegisterExtensionTests.java
+2
-1
SkippableContainer.java
...k/boot/testsupport/testcontainers/SkippableContainer.java
+1
-1
ModifiedClassPathRunnerExclusionsTests.java
...ner/classpath/ModifiedClassPathRunnerExclusionsTests.java
+1
-1
SslServerCustomizer.java
...ramework/boot/web/embedded/jetty/SslServerCustomizer.java
+1
-1
NettyWebServer.java
...ringframework/boot/web/embedded/netty/NettyWebServer.java
+11
-4
AbstractServletWebServerFactoryTests.java
.../servlet/server/AbstractServletWebServerFactoryTests.java
+1
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnEnabledEndpoint.java
View file @
68aec8b6
...
...
@@ -90,7 +90,8 @@ import org.springframework.core.env.Environment;
* @author Stephane Nicoll
* @since 2.0.0
* @see Endpoint
* @deprecated as of 2.2.0 in favor of {@link ConditionalOnAvailableEndpoint}
* @deprecated as of 2.2.0 in favor of
* {@link ConditionalOnAvailableEndpoint @ConditionalOnAvailableEndpoint}
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
({
ElementType
.
METHOD
,
ElementType
.
TYPE
})
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/SpringApplicationHierarchyTests.java
View file @
68aec8b6
...
...
@@ -31,7 +31,6 @@ import org.springframework.boot.autoconfigure.data.neo4j.Neo4jDataAutoConfigurat
import
org.springframework.boot.autoconfigure.data.neo4j.Neo4jRepositoriesAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration
;
import
org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration
;
import
org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.test.util.ApplicationContextTestUtils
;
...
...
@@ -73,8 +72,7 @@ public class SpringApplicationHierarchyTests {
MongoDataAutoConfiguration
.
class
,
MongoReactiveDataAutoConfiguration
.
class
,
Neo4jDataAutoConfiguration
.
class
,
Neo4jRepositoriesAutoConfiguration
.
class
,
RedisAutoConfiguration
.
class
,
RedisRepositoriesAutoConfiguration
.
class
,
FlywayAutoConfiguration
.
class
,
JestAutoConfiguration
.
class
,
MetricsAutoConfiguration
.
class
},
FlywayAutoConfiguration
.
class
,
MetricsAutoConfiguration
.
class
},
excludeName
=
{
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration"
})
public
static
class
Child
{
...
...
@@ -87,8 +85,7 @@ public class SpringApplicationHierarchyTests {
MongoDataAutoConfiguration
.
class
,
MongoReactiveDataAutoConfiguration
.
class
,
Neo4jDataAutoConfiguration
.
class
,
Neo4jRepositoriesAutoConfiguration
.
class
,
RedisAutoConfiguration
.
class
,
RedisRepositoriesAutoConfiguration
.
class
,
FlywayAutoConfiguration
.
class
,
JestAutoConfiguration
.
class
,
MetricsAutoConfiguration
.
class
},
FlywayAutoConfiguration
.
class
,
MetricsAutoConfiguration
.
class
},
excludeName
=
{
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration"
})
public
static
class
Parent
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnEnabledEndpointTests.java
View file @
68aec8b6
...
...
@@ -35,6 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Andy Wilkinson
*/
@Deprecated
@SuppressWarnings
(
"deprecation"
)
public
class
ConditionalOnEnabledEndpointTests
{
private
final
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
();
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/Autotime.java
View file @
68aec8b6
...
...
@@ -54,14 +54,6 @@ public final class Autotime {
?
percentiles
.
stream
().
mapToDouble
(
Double:
:
doubleValue
).
toArray
()
:
null
;
}
/**
* Create an instance that disable auto-timed requests.
* @return an instance that disable auto-timed requests
*/
public
static
Autotime
disabled
()
{
return
new
Autotime
(
false
,
false
,
null
);
}
public
boolean
isEnabled
()
{
return
this
.
enabled
;
}
...
...
@@ -86,4 +78,12 @@ public final class Autotime {
this
.
percentiles
=
percentiles
;
}
/**
* Create an instance that disable auto-timed requests.
* @return an instance that disable auto-timed requests
*/
public
static
Autotime
disabled
()
{
return
new
Autotime
(
false
,
false
,
null
);
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketStrategiesAutoConfiguration.java
View file @
68aec8b6
...
...
@@ -75,6 +75,8 @@ public class RSocketStrategiesAutoConfiguration {
@ConditionalOnClass
({
ObjectMapper
.
class
,
CBORFactory
.
class
})
protected
static
class
JacksonCborStrategyConfiguration
{
private
static
final
MediaType
[]
SUPPORTED_TYPES
=
{
MediaType
.
APPLICATION_CBOR
};
@Bean
@Order
(
0
)
@ConditionalOnBean
(
Jackson2ObjectMapperBuilder
.
class
)
...
...
@@ -82,10 +84,8 @@ public class RSocketStrategiesAutoConfiguration {
Jackson2ObjectMapperBuilder
builder
)
{
return
(
strategy
)
->
{
ObjectMapper
objectMapper
=
builder
.
factory
(
new
CBORFactory
()).
build
();
MediaType
[]
supportedTypes
=
new
MediaType
[]
{
MediaType
.
APPLICATION_CBOR
};
strategy
.
decoder
(
new
Jackson2CborDecoder
(
objectMapper
,
supportedTypes
));
strategy
.
encoder
(
new
Jackson2CborEncoder
(
objectMapper
,
supportedTypes
));
strategy
.
decoder
(
new
Jackson2CborDecoder
(
objectMapper
,
SUPPORTED_TYPES
));
strategy
.
encoder
(
new
Jackson2CborEncoder
(
objectMapper
,
SUPPORTED_TYPES
));
};
}
...
...
@@ -95,16 +95,17 @@ public class RSocketStrategiesAutoConfiguration {
@ConditionalOnClass
(
ObjectMapper
.
class
)
protected
static
class
JacksonJsonStrategyConfiguration
{
private
static
final
MediaType
[]
SUPPORTED_TYPES
=
{
MediaType
.
APPLICATION_JSON
,
new
MediaType
(
"application"
,
"*+json"
)
};
@Bean
@Order
(
1
)
@ConditionalOnBean
(
ObjectMapper
.
class
)
public
RSocketStrategiesCustomizer
jacksonJsonStrategyCustomizer
(
ObjectMapper
objectMapper
)
{
return
(
strategy
)
->
{
MediaType
[]
supportedTypes
=
new
MediaType
[]
{
MediaType
.
APPLICATION_JSON
,
new
MediaType
(
"application"
,
"*+json"
)
};
strategy
.
decoder
(
new
Jackson2JsonDecoder
(
objectMapper
,
supportedTypes
));
strategy
.
encoder
(
new
Jackson2JsonEncoder
(
objectMapper
,
supportedTypes
));
strategy
.
decoder
(
new
Jackson2JsonDecoder
(
objectMapper
,
SUPPORTED_TYPES
));
strategy
.
encoder
(
new
Jackson2JsonEncoder
(
objectMapper
,
SUPPORTED_TYPES
));
};
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ResourcePropertiesTests.java
View file @
68aec8b6
...
...
@@ -25,7 +25,7 @@ import org.springframework.boot.testsupport.assertj.Matched;
import
org.springframework.http.CacheControl
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
hamcrest
.
Core
Matchers
.
endsWith
;
import
static
org
.
hamcrest
.
Matchers
.
endsWith
;
/**
* Tests for {@link ResourceProperties}.
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizerTests.java
View file @
68aec8b6
...
...
@@ -20,7 +20,6 @@ import java.io.File;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.TimeZone
;
import
org.eclipse.jetty.server.Connector
;
import
org.eclipse.jetty.server.CustomRequestLog
;
...
...
@@ -88,7 +87,6 @@ public class JettyWebServerFactoryCustomizerTests {
@Test
public
void
accessLogCanBeCustomized
()
throws
IOException
{
File
logFile
=
File
.
createTempFile
(
"jetty_log"
,
".log"
);
String
timezone
=
TimeZone
.
getDefault
().
getID
();
bind
(
"server.jetty.accesslog.enabled=true"
,
"server.jetty.accesslog.format=extended_ncsa"
,
"server.jetty.accesslog.filename="
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorConfigurationTests.java
View file @
68aec8b6
...
...
@@ -46,8 +46,7 @@ public class ClientHttpConnectorConfigurationTests {
jettyResourceFactory
.
setExecutor
(
executor
);
jettyResourceFactory
.
setByteBufferPool
(
byteBufferPool
);
jettyResourceFactory
.
setScheduler
(
scheduler
);
JettyClientHttpConnector
connector
=
new
ClientHttpConnectorConfiguration
.
JettyClient
()
.
jettyClientHttpConnector
(
jettyResourceFactory
);
JettyClientHttpConnector
connector
=
getClientHttpConnector
(
jettyResourceFactory
);
HttpClient
httpClient
=
(
HttpClient
)
ReflectionTestUtils
.
getField
(
connector
,
"httpClient"
);
assertThat
(
httpClient
.
getExecutor
()).
isSameAs
(
executor
);
...
...
@@ -59,11 +58,18 @@ public class ClientHttpConnectorConfigurationTests {
public
void
JettyResourceFactoryHasSslContextFactory
()
{
// gh-16810
JettyResourceFactory
jettyResourceFactory
=
new
JettyResourceFactory
();
JettyClientHttpConnector
connector
=
new
ClientHttpConnectorConfiguration
.
JettyClient
()
.
jettyClientHttpConnector
(
jettyResourceFactory
);
JettyClientHttpConnector
connector
=
getClientHttpConnector
(
jettyResourceFactory
);
HttpClient
httpClient
=
(
HttpClient
)
ReflectionTestUtils
.
getField
(
connector
,
"httpClient"
);
assertThat
(
httpClient
.
getSslContextFactory
()).
isNotNull
();
}
private
JettyClientHttpConnector
getClientHttpConnector
(
JettyResourceFactory
jettyResourceFactory
)
{
ClientHttpConnectorConfiguration
.
JettyClient
jettyClient
=
new
ClientHttpConnectorConfiguration
.
JettyClient
();
// We shouldn't usually call this method directly since it's on a non-proxy config
return
ReflectionTestUtils
.
invokeMethod
(
jettyClient
,
"jettyClientHttpConnector"
,
jettyResourceFactory
);
}
}
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java
View file @
68aec8b6
...
...
@@ -63,7 +63,8 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
/**
* Tests for {@link BasicErrorController} using {@link MockMvc} and {@link SpringRunner}.
* Tests for {@link BasicErrorController} using {@link MockMvc} and
* {@link SpringBootTest @SpringBootTest}.
*
* @author Dave Syer
*/
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfigurationTests.java
View file @
68aec8b6
...
...
@@ -133,8 +133,10 @@ public class WebSocketMessagingAutoConfigurationTests {
@SuppressWarnings
(
"unchecked"
)
private
List
<
MessageConverter
>
getDefaultConverters
()
{
CompositeMessageConverter
compositeDefaultConverter
=
new
DelegatingWebSocketMessageBrokerConfiguration
()
.
brokerMessageConverter
();
DelegatingWebSocketMessageBrokerConfiguration
configuration
=
new
DelegatingWebSocketMessageBrokerConfiguration
();
// We shouldn't usually call this method directly since it's on a non-proxy config
CompositeMessageConverter
compositeDefaultConverter
=
ReflectionTestUtils
.
invokeMethod
(
configuration
,
"brokerMessageConverter"
);
return
(
List
<
MessageConverter
>)
ReflectionTestUtils
.
getField
(
compositeDefaultConverter
,
"converters"
);
}
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
68aec8b6
...
...
@@ -3379,6 +3379,8 @@ NOTE: `TomcatServletWebServerFactory`, `JettyServletWebServerFactory` and `Under
are dedicated variants of `ConfigurableServletWebServerFactory` that have additional customization setter methods
for Tomcat, Jetty and Undertow respectively.
[[boot-features-customizing-configurableservletwebserverfactory-directly]]
===== Customizing ConfigurableServletWebServerFactory Directly
If the preceding customization techniques are too limited, you can register the
...
...
@@ -3403,6 +3405,7 @@ are also provided should you need to do something more exotic. See the
code documentation] for details.
[[boot-features-jsp-limitations]]
==== JSP Limitations
When running a Spring Boot application that uses an embedded servlet container (and is
...
...
@@ -3422,17 +3425,19 @@ instead.
There is a {github-code}/spring-boot-samples/spring-boot-sample-web-jsp[JSP sample] so
that you can see how to set things up.
[[boot-features-reactive-server]]
=== Embedded Reactive Server Support
Spring Boot includes support for the following embedded reactive web servers:
Reactor Netty, Tomcat, Jetty, and Undertow. Most developers use the appropriate “Starter”
to obtain a fully configured instance. By default, the embedded server listens for HTTP
requests on port 8080.
[[boot-features-reactive-server-resources]]
=== Reactive Server Resources Configuration
When auto-configuring a Reactor Netty or Jetty server, Spring Boot will create specific
beans that will provide HTTP resources to the server instance: `ReactorResourceFactory`
or `JettyResourceFactory`.
...
...
@@ -3451,6 +3456,8 @@ both clients and servers.
You can learn more about the resource configuration on the client side in the
<<boot-features-webclient-runtime, WebClient Runtime section>>.
[[boot-features-rsocket]]
== RSocket
...
...
@@ -3483,6 +3490,8 @@ The following code shows a typical `@Controller`:
}
----
[[boot-features-rsocket-strategies-auto-configuration]]
=== RSocket Strategies Auto-configuration
Spring Boot auto-configures an `RSocketStrategies` bean that provides all the required
...
...
@@ -3499,6 +3508,7 @@ implement the `RSocketStrategiesCustomizer` interface. Note that their `@Order`
important, as it determines the order of codecs.
[[boot-features-rsocket-server-auto-configuration]]
=== RSocket server Auto-configuration
Spring Boot provides auto-configuration for RSocket servers. The required dependencies
...
...
@@ -3544,6 +3554,8 @@ about customization possibilities.
Developers can create `RSocketStrategiesCustomizer` beans to add other strategies,
assuming there are `Encoder` and `Decoder` implementations available.
[[boot-features-rsocket-requester]]
=== Calling RSocket Services with `RSocketRequester`
...
...
@@ -3582,6 +3594,7 @@ The following code shows a typical example:
----
[[boot-features-security]]
== Security
If {spring-security}[Spring Security] is on the classpath, then web applications are
...
...
@@ -3620,6 +3633,7 @@ the entire application (including actuator endpoints if actuator is on the class
You can provide a different `AuthenticationEventPublisher` by adding a bean for it.
[[boot-features-security-mvc]]
=== MVC Security
The default security configuration is implemented in `SecurityAutoConfiguration` and
...
...
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/restassured/UserDocumentationTests.java
View file @
68aec8b6
...
...
@@ -29,7 +29,7 @@ import org.springframework.boot.web.server.LocalServerPort;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
io
.
restassured
.
RestAssured
.
given
;
import
static
org
.
hamcrest
.
Core
Matchers
.
is
;
import
static
org
.
hamcrest
.
Matchers
.
is
;
import
static
org
.
springframework
.
restdocs
.
restassured3
.
RestAssuredRestDocumentation
.
document
;
@RunWith
(
SpringRunner
.
class
)
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestAssuredRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java
View file @
68aec8b6
...
...
@@ -39,7 +39,7 @@ import org.springframework.util.FileSystemUtils;
import
static
io
.
restassured
.
RestAssured
.
given
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
contentOf
;
import
static
org
.
hamcrest
.
Core
Matchers
.
is
;
import
static
org
.
hamcrest
.
Matchers
.
is
;
import
static
org
.
springframework
.
restdocs
.
operation
.
preprocess
.
Preprocessors
.
modifyUris
;
import
static
org
.
springframework
.
restdocs
.
operation
.
preprocess
.
Preprocessors
.
preprocessRequest
;
import
static
org
.
springframework
.
restdocs
.
payload
.
PayloadDocumentation
.
fieldWithPath
;
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestAssuredRestDocsAutoConfigurationIntegrationTests.java
View file @
68aec8b6
...
...
@@ -34,7 +34,7 @@ import org.springframework.util.FileSystemUtils;
import
static
io
.
restassured
.
RestAssured
.
given
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
contentOf
;
import
static
org
.
hamcrest
.
Core
Matchers
.
is
;
import
static
org
.
hamcrest
.
Matchers
.
is
;
import
static
org
.
springframework
.
restdocs
.
operation
.
preprocess
.
Preprocessors
.
modifyUris
;
import
static
org
.
springframework
.
restdocs
.
operation
.
preprocess
.
Preprocessors
.
preprocessRequest
;
import
static
org
.
springframework
.
restdocs
.
restassured3
.
RestAssuredRestDocumentation
.
document
;
...
...
spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/extension/OutputCaptureExtendWithTests.java
View file @
68aec8b6
...
...
@@ -23,7 +23,7 @@ import org.junit.jupiter.api.extension.ExtensionContext;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Tests for {@link OutputCapture} when used via {@link ExtendWith}.
* Tests for {@link OutputCapture} when used via {@link ExtendWith
@ExtendWith
}.
*
* @author Madhura Bhave
*/
...
...
spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/extension/OutputCaptureRegisterExtensionTests.java
View file @
68aec8b6
...
...
@@ -21,7 +21,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Tests for {@link OutputCapture} when used via {@link RegisterExtension}.
* Tests for {@link OutputCapture} when used via
* {@link RegisterExtension @RegisterExtension}.
*
* @author Madhura Bhave
*/
...
...
spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/SkippableContainer.java
View file @
68aec8b6
...
...
@@ -31,7 +31,7 @@ import org.testcontainers.lifecycle.Startable;
* @author Andy Wilkinson
* @author Madhura Bhave
*/
public
class
SkippableContainer
<
T
extends
GenericContainer
>
implements
Startable
{
public
class
SkippableContainer
<
T
extends
GenericContainer
<?>
>
implements
Startable
{
private
final
Supplier
<
T
>
containerFactory
;
...
...
spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/runner/classpath/ModifiedClassPathRunnerExclusionsTests.java
View file @
68aec8b6
...
...
@@ -21,7 +21,7 @@ import org.junit.Test;
import
org.junit.runner.RunWith
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
hamcrest
.
Core
Matchers
.
isA
;
import
static
org
.
hamcrest
.
Matchers
.
isA
;
/**
* Tests for {@link ModifiedClassPathRunner} excluding entries from the class path.
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizer.java
View file @
68aec8b6
...
...
@@ -134,7 +134,7 @@ class SslServerCustomizer implements JettyServerCustomizer {
/**
* Configure the SSL connection.
* @param factory the Jetty {@link SslContextFactory.Server}.
* @param factory the Jetty {@link S
erver S
slContextFactory.Server}.
* @param ssl the ssl details.
* @param sslStoreProvider the ssl store provider
*/
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyWebServer.java
View file @
68aec8b6
...
...
@@ -19,12 +19,15 @@ package org.springframework.boot.web.embedded.netty;
import
java.time.Duration
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.function.Predicate
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
reactor.netty.ChannelBindException
;
import
reactor.netty.DisposableServer
;
import
reactor.netty.http.server.HttpServer
;
import
reactor.netty.http.server.HttpServerRequest
;
import
reactor.netty.http.server.HttpServerRoutes
;
import
org.springframework.boot.web.server.PortInUseException
;
import
org.springframework.boot.web.server.WebServer
;
...
...
@@ -44,6 +47,8 @@ import org.springframework.util.Assert;
*/
public
class
NettyWebServer
implements
WebServer
{
private
static
final
Predicate
<
HttpServerRequest
>
ALWAYS
=
(
r
)
->
true
;
private
static
final
Log
logger
=
LogFactory
.
getLog
(
NettyWebServer
.
class
);
private
final
HttpServer
httpServer
;
...
...
@@ -93,10 +98,7 @@ public class NettyWebServer implements WebServer {
server
=
server
.
handle
(
this
.
handlerAdapter
);
}
else
{
server
=
server
.
route
((
routes
)
->
{
this
.
routeProviders
.
forEach
((
provider
)
->
provider
.
apply
(
routes
));
routes
.
route
((
r
)
->
true
,
this
.
handlerAdapter
);
});
server
=
server
.
route
(
this
::
applyRouteProviders
);
}
if
(
this
.
lifecycleTimeout
!=
null
)
{
return
server
.
bindNow
(
this
.
lifecycleTimeout
);
...
...
@@ -104,6 +106,11 @@ public class NettyWebServer implements WebServer {
return
server
.
bindNow
();
}
private
void
applyRouteProviders
(
HttpServerRoutes
routes
)
{
this
.
routeProviders
.
forEach
((
provider
)
->
provider
.
apply
(
routes
));
routes
.
route
(
ALWAYS
,
this
.
handlerAdapter
);
}
private
ChannelBindException
findBindException
(
Exception
ex
)
{
Throwable
candidate
=
ex
;
while
(
candidate
!=
null
)
{
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java
View file @
68aec8b6
...
...
@@ -122,7 +122,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatIOException
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatIllegalArgumentException
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatIllegalStateException
;
import
static
org
.
hamcrest
.
Core
Matchers
.
notNullValue
;
import
static
org
.
hamcrest
.
Matchers
.
notNullValue
;
import
static
org
.
junit
.
Assert
.
fail
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
...
...
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