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
b234501a
Commit
b234501a
authored
Jan 26, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
62d9d0fd
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
142 additions
and
134 deletions
+142
-134
CloudFoundryWebEndpointDiscoverer.java
...igure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java
+1
-2
MappingWebEndpointPathMapper.java
...oconfigure/endpoint/web/MappingWebEndpointPathMapper.java
+2
-2
CacheMetricsRegistrarConfiguration.java
...ure/metrics/cache/CacheMetricsRegistrarConfiguration.java
+2
-2
CloudFoundryWebEndpointDiscovererTests.java
.../cloudfoundry/CloudFoundryWebEndpointDiscovererTests.java
+2
-2
ReactiveCloudFoundrySecurityInterceptorTests.java
...eactive/ReactiveCloudFoundrySecurityInterceptorTests.java
+6
-6
CacheMetricsConfigurationTests.java
...nfigure/metrics/cache/CacheMetricsConfigurationTests.java
+1
-2
MissingParametersException.java
...t/actuate/endpoint/invoke/MissingParametersException.java
+3
-3
ControllerEndpoint.java
...t/actuate/endpoint/web/annotation/ControllerEndpoint.java
+2
-2
ControllerEndpointDiscoverer.java
...endpoint/web/annotation/ControllerEndpointDiscoverer.java
+2
-1
AbstractWebFluxEndpointHandlerMapping.java
...t/web/reactive/AbstractWebFluxEndpointHandlerMapping.java
+2
-2
ControllerEndpointHandlerMapping.java
...dpoint/web/reactive/ControllerEndpointHandlerMapping.java
+1
-2
ControllerEndpointHandlerMapping.java
...ndpoint/web/servlet/ControllerEndpointHandlerMapping.java
+1
-2
RouterFunctionMetrics.java
...te/metrics/web/reactive/server/RouterFunctionMetrics.java
+3
-3
BeansEndpointTests.java
...pringframework/boot/actuate/beans/BeansEndpointTests.java
+1
-1
ConfigurationPropertiesReportEndpointParentTests.java
...ies/ConfigurationPropertiesReportEndpointParentTests.java
+2
-2
AbstractWebEndpointIntegrationTests.java
...t/web/annotation/AbstractWebEndpointIntegrationTests.java
+6
-9
BaseConfiguration.java
...ot/actuate/endpoint/web/annotation/BaseConfiguration.java
+2
-2
WebEndpointDiscovererTests.java
...e/endpoint/web/annotation/WebEndpointDiscovererTests.java
+2
-2
SpringIntegrationMetricsIntegrationTests.java
...integration/SpringIntegrationMetricsIntegrationTests.java
+2
-2
FlywayAutoConfiguration.java
...rk/boot/autoconfigure/flyway/FlywayAutoConfiguration.java
+1
-1
JettyCustomizer.java
...oot/autoconfigure/web/embedded/jetty/JettyCustomizer.java
+8
-5
TomcatCustomizer.java
...t/autoconfigure/web/embedded/tomcat/TomcatCustomizer.java
+17
-10
UndertowCustomizer.java
...toconfigure/web/embedded/undertow/UndertowCustomizer.java
+10
-10
DefaultReactiveWebServerFactoryCustomizer.java
...b/reactive/DefaultReactiveWebServerFactoryCustomizer.java
+6
-6
DefaultServletWebServerFactoryCustomizer.java
...web/servlet/DefaultServletWebServerFactoryCustomizer.java
+4
-4
CassandraRepositoriesAutoConfigurationTests.java
...assandra/CassandraRepositoriesAutoConfigurationTests.java
+6
-5
MongoReactiveRepositoriesAutoConfigurationTests.java
...ongo/MongoReactiveRepositoriesAutoConfigurationTests.java
+11
-10
MongoRepositoriesAutoConfigurationTests.java
...e/data/mongo/MongoRepositoriesAutoConfigurationTests.java
+14
-12
AuthenticationManagerConfigurationTests.java
...rity/servlet/AuthenticationManagerConfigurationTests.java
+2
-1
PropertiesMigrationReporter.java
...text/properties/migrator/PropertiesMigrationReporter.java
+5
-5
ConfigurationMetadataAnnotationProcessorTests.java
...cessor/ConfigurationMetadataAnnotationProcessorTests.java
+2
-2
BootArchiveSupport.java
...mework/boot/gradle/tasks/bundling/BootArchiveSupport.java
+1
-1
InvalidConfigurationPropertyValueFailureAnalyzer.java
...zer/InvalidConfigurationPropertyValueFailureAnalyzer.java
+2
-2
InvalidConfigurationPropertyValueFailureAnalyzerTests.java
...nvalidConfigurationPropertyValueFailureAnalyzerTests.java
+1
-2
AbstractDataSourcePoolMetadataTests.java
...ot/jdbc/metadata/AbstractDataSourcePoolMetadataTests.java
+2
-2
AbstractReactiveWebServerFactoryTests.java
...eactive/server/AbstractReactiveWebServerFactoryTests.java
+2
-2
ManagementPortAndPathSampleActuatorApplicationTests.java
.../ManagementPortAndPathSampleActuatorApplicationTests.java
+3
-2
ApplicationBuilder.java
...ngframework/boot/context/embedded/ApplicationBuilder.java
+2
-3
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java
View file @
b234501a
...
@@ -51,8 +51,7 @@ public class CloudFoundryWebEndpointDiscoverer extends WebEndpointDiscoverer {
...
@@ -51,8 +51,7 @@ public class CloudFoundryWebEndpointDiscoverer extends WebEndpointDiscoverer {
*/
*/
public
CloudFoundryWebEndpointDiscoverer
(
ApplicationContext
applicationContext
,
public
CloudFoundryWebEndpointDiscoverer
(
ApplicationContext
applicationContext
,
ParameterValueMapper
parameterValueMapper
,
ParameterValueMapper
parameterValueMapper
,
EndpointMediaTypes
endpointMediaTypes
,
EndpointMediaTypes
endpointMediaTypes
,
PathMapper
endpointPathMapper
,
PathMapper
endpointPathMapper
,
Collection
<
OperationInvokerAdvisor
>
invokerAdvisors
,
Collection
<
OperationInvokerAdvisor
>
invokerAdvisors
,
Collection
<
EndpointFilter
<
ExposableWebEndpoint
>>
filters
)
{
Collection
<
EndpointFilter
<
ExposableWebEndpoint
>>
filters
)
{
super
(
applicationContext
,
parameterValueMapper
,
endpointMediaTypes
,
super
(
applicationContext
,
parameterValueMapper
,
endpointMediaTypes
,
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/MappingWebEndpointPathMapper.java
View file @
b234501a
...
@@ -21,8 +21,8 @@ import java.util.Map;
...
@@ -21,8 +21,8 @@ import java.util.Map;
import
org.springframework.boot.actuate.endpoint.web.PathMapper
;
import
org.springframework.boot.actuate.endpoint.web.PathMapper
;
/**
/**
* A {@link PathMapper} implementation that uses a simple {@link Map} to
* A {@link PathMapper} implementation that uses a simple {@link Map} to
determine the
*
determine the
endpoint path.
* endpoint path.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java
View file @
b234501a
...
@@ -65,8 +65,8 @@ class CacheMetricsRegistrarConfiguration {
...
@@ -65,8 +65,8 @@ class CacheMetricsRegistrarConfiguration {
@Bean
@Bean
public
CacheMetricsRegistrar
cacheMetricsRegistrar
()
{
public
CacheMetricsRegistrar
cacheMetricsRegistrar
()
{
return
new
CacheMetricsRegistrar
(
this
.
registry
,
return
new
CacheMetricsRegistrar
(
this
.
registry
,
this
.
properties
.
getMetricName
(),
this
.
properties
.
getMetricName
(),
this
.
binderProviders
);
this
.
binderProviders
);
}
}
@PostConstruct
@PostConstruct
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscovererTests.java
View file @
b234501a
...
@@ -68,8 +68,8 @@ public class CloudFoundryWebEndpointDiscovererTests {
...
@@ -68,8 +68,8 @@ public class CloudFoundryWebEndpointDiscovererTests {
this
.
load
((
id
)
->
null
,
(
id
)
->
id
,
configuration
,
consumer
);
this
.
load
((
id
)
->
null
,
(
id
)
->
id
,
configuration
,
consumer
);
}
}
private
void
load
(
Function
<
String
,
Long
>
timeToLive
,
private
void
load
(
Function
<
String
,
Long
>
timeToLive
,
PathMapper
endpointPathMapper
,
PathMapper
endpointPathMapper
,
Class
<?>
configuration
,
Class
<?>
configuration
,
Consumer
<
CloudFoundryWebEndpointDiscoverer
>
consumer
)
{
Consumer
<
CloudFoundryWebEndpointDiscoverer
>
consumer
)
{
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
(
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
(
configuration
);
configuration
);
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityInterceptorTests.java
View file @
b234501a
...
@@ -54,8 +54,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests {
...
@@ -54,8 +54,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests {
@Before
@Before
public
void
setup
()
{
public
void
setup
()
{
MockitoAnnotations
.
initMocks
(
this
);
MockitoAnnotations
.
initMocks
(
this
);
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
tokenValidator
,
this
.
tokenValidator
,
this
.
securityService
,
"my-app-id"
);
this
.
securityService
,
"my-app-id"
);
}
}
@Test
@Test
...
@@ -90,8 +90,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests {
...
@@ -90,8 +90,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests {
@Test
@Test
public
void
preHandleWhenApplicationIdIsNullShouldReturnError
()
{
public
void
preHandleWhenApplicationIdIsNullShouldReturnError
()
{
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
tokenValidator
,
this
.
tokenValidator
,
this
.
securityService
,
null
);
this
.
securityService
,
null
);
MockServerWebExchange
request
=
MockServerWebExchange
MockServerWebExchange
request
=
MockServerWebExchange
.
from
(
MockServerHttpRequest
.
get
(
"/a"
)
.
from
(
MockServerHttpRequest
.
get
(
"/a"
)
.
header
(
HttpHeaders
.
AUTHORIZATION
,
"bearer "
+
mockAccessToken
())
.
header
(
HttpHeaders
.
AUTHORIZATION
,
"bearer "
+
mockAccessToken
())
...
@@ -105,8 +105,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests {
...
@@ -105,8 +105,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests {
@Test
@Test
public
void
preHandleWhenCloudFoundrySecurityServiceIsNullShouldReturnError
()
{
public
void
preHandleWhenCloudFoundrySecurityServiceIsNullShouldReturnError
()
{
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
tokenValidator
,
null
,
this
.
tokenValidator
,
null
,
"my-app-id"
);
"my-app-id"
);
MockServerWebExchange
request
=
MockServerWebExchange
.
from
(
MockServerHttpRequest
MockServerWebExchange
request
=
MockServerWebExchange
.
from
(
MockServerHttpRequest
.
get
(
"/a"
).
header
(
HttpHeaders
.
AUTHORIZATION
,
mockAccessToken
()).
build
());
.
get
(
"/a"
).
header
(
HttpHeaders
.
AUTHORIZATION
,
mockAccessToken
()).
build
());
StepVerifier
.
create
(
this
.
interceptor
.
preHandle
(
request
,
"/a"
))
StepVerifier
.
create
(
this
.
interceptor
.
preHandle
(
request
,
"/a"
))
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java
View file @
b234501a
...
@@ -58,8 +58,7 @@ public class CacheMetricsConfigurationTests {
...
@@ -58,8 +58,7 @@ public class CacheMetricsConfigurationTests {
@Test
@Test
public
void
autoConfiguredCacheManagerWithCustomMetricName
()
{
public
void
autoConfiguredCacheManagerWithCustomMetricName
()
{
this
.
contextRunner
this
.
contextRunner
.
withPropertyValues
(
.
withPropertyValues
(
"management.metrics.cache.metric-name=custom.name"
,
"management.metrics.cache.metric-name=custom.name"
,
"spring.cache.type=caffeine"
,
"spring.cache.cache-names=cache1"
)
"spring.cache.type=caffeine"
,
"spring.cache.cache-names=cache1"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
MeterRegistry
registry
=
context
.
getBean
(
MeterRegistry
.
class
);
MeterRegistry
registry
=
context
.
getBean
(
MeterRegistry
.
class
);
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/MissingParametersException.java
View file @
b234501a
...
@@ -38,9 +38,9 @@ public final class MissingParametersException extends InvalidEndpointRequestExce
...
@@ -38,9 +38,9 @@ public final class MissingParametersException extends InvalidEndpointRequestExce
super
(
"Failed to invoke operation because the following required "
super
(
"Failed to invoke operation because the following required "
+
"parameters were missing: "
+
"parameters were missing: "
+
StringUtils
.
collectionToCommaDelimitedString
(
missingParameters
),
+
StringUtils
.
collectionToCommaDelimitedString
(
missingParameters
),
"Missing parameters: "
+
missingParameters
.
stream
()
"Missing parameters: "
.
map
(
OperationParameter:
:
getName
)
+
missingParameters
.
stream
()
.
map
(
OperationParameter:
:
getName
)
.
collect
(
Collectors
.
joining
(
","
)));
.
collect
(
Collectors
.
joining
(
","
)));
this
.
missingParameters
=
missingParameters
;
this
.
missingParameters
=
missingParameters
;
}
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java
View file @
b234501a
...
@@ -33,8 +33,8 @@ import org.springframework.web.bind.annotation.GetMapping;
...
@@ -33,8 +33,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
/**
/**
* Identifies a type as being an endpoint that is only exposed over Spring MVC or
* Identifies a type as being an endpoint that is only exposed over Spring MVC or
Spring
*
Spring
WebFlux. Mapped methods must be annotated with {@link GetMapping @GetMapping},
* WebFlux. Mapped methods must be annotated with {@link GetMapping @GetMapping},
* {@link PostMapping @PostMapping}, {@link DeleteMapping @DeleteMapping}, etc annotations
* {@link PostMapping @PostMapping}, {@link DeleteMapping @DeleteMapping}, etc annotations
* rather than {@link ReadOperation @ReadOperation},
* rather than {@link ReadOperation @ReadOperation},
* {@link WriteOperation @WriteOperation}, {@link DeleteOperation @DeleteOperation}.
* {@link WriteOperation @WriteOperation}, {@link DeleteOperation @DeleteOperation}.
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscoverer.java
View file @
b234501a
...
@@ -31,7 +31,8 @@ import org.springframework.core.annotation.AnnotatedElementUtils;
...
@@ -31,7 +31,8 @@ import org.springframework.core.annotation.AnnotatedElementUtils;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
/**
/**
* {@link EndpointDiscoverer} for {@link ExposableControllerEndpoint controller endpoints}.
* {@link EndpointDiscoverer} for {@link ExposableControllerEndpoint controller
* endpoints}.
*
*
* @author Phillip Webb
* @author Phillip Webb
* @since 2.0.0
* @since 2.0.0
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java
View file @
b234501a
...
@@ -288,8 +288,8 @@ public abstract class AbstractWebFluxEndpointHandlerMapping
...
@@ -288,8 +288,8 @@ public abstract class AbstractWebFluxEndpointHandlerMapping
private
Mono
<
ResponseEntity
<
Object
>>
handleResult
(
Publisher
<?>
result
,
private
Mono
<
ResponseEntity
<
Object
>>
handleResult
(
Publisher
<?>
result
,
HttpMethod
httpMethod
)
{
HttpMethod
httpMethod
)
{
return
Mono
.
from
(
result
).
map
(
this
::
toResponseEntity
)
return
Mono
.
from
(
result
).
map
(
this
::
toResponseEntity
)
.
onErrorMap
(
InvalidEndpointRequestException
.
class
,
(
ex
)
->
.
onErrorMap
(
InvalidEndpointRequestException
.
class
,
new
ResponseStatusException
(
HttpStatus
.
BAD_REQUEST
,
(
ex
)
->
new
ResponseStatusException
(
HttpStatus
.
BAD_REQUEST
,
ex
.
getReason
()))
ex
.
getReason
()))
.
defaultIfEmpty
(
new
ResponseEntity
<>(
httpMethod
==
HttpMethod
.
GET
.
defaultIfEmpty
(
new
ResponseEntity
<>(
httpMethod
==
HttpMethod
.
GET
?
HttpStatus
.
NOT_FOUND
:
HttpStatus
.
NO_CONTENT
));
?
HttpStatus
.
NOT_FOUND
:
HttpStatus
.
NO_CONTENT
));
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMapping.java
View file @
b234501a
...
@@ -72,8 +72,7 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi
...
@@ -72,8 +72,7 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi
private
Map
<
Object
,
ExposableControllerEndpoint
>
getHandlers
(
private
Map
<
Object
,
ExposableControllerEndpoint
>
getHandlers
(
Collection
<
ExposableControllerEndpoint
>
endpoints
)
{
Collection
<
ExposableControllerEndpoint
>
endpoints
)
{
Map
<
Object
,
ExposableControllerEndpoint
>
handlers
=
new
LinkedHashMap
<>();
Map
<
Object
,
ExposableControllerEndpoint
>
handlers
=
new
LinkedHashMap
<>();
endpoints
endpoints
.
forEach
((
endpoint
)
->
handlers
.
put
(
endpoint
.
getController
(),
endpoint
));
.
forEach
((
endpoint
)
->
handlers
.
put
(
endpoint
.
getController
(),
endpoint
));
return
Collections
.
unmodifiableMap
(
handlers
);
return
Collections
.
unmodifiableMap
(
handlers
);
}
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMapping.java
View file @
b234501a
...
@@ -73,8 +73,7 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi
...
@@ -73,8 +73,7 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi
private
Map
<
Object
,
ExposableControllerEndpoint
>
getHandlers
(
private
Map
<
Object
,
ExposableControllerEndpoint
>
getHandlers
(
Collection
<
ExposableControllerEndpoint
>
endpoints
)
{
Collection
<
ExposableControllerEndpoint
>
endpoints
)
{
Map
<
Object
,
ExposableControllerEndpoint
>
handlers
=
new
LinkedHashMap
<>();
Map
<
Object
,
ExposableControllerEndpoint
>
handlers
=
new
LinkedHashMap
<>();
endpoints
endpoints
.
forEach
((
endpoint
)
->
handlers
.
put
(
endpoint
.
getController
(),
endpoint
));
.
forEach
((
endpoint
)
->
handlers
.
put
(
endpoint
.
getController
(),
endpoint
));
return
Collections
.
unmodifiableMap
(
handlers
);
return
Collections
.
unmodifiableMap
(
handlers
);
}
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/RouterFunctionMetrics.java
View file @
b234501a
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -75,12 +75,12 @@ public class RouterFunctionMetrics {
...
@@ -75,12 +75,12 @@ public class RouterFunctionMetrics {
Iterable
<
Tag
>
tags
)
{
Iterable
<
Tag
>
tags
)
{
return
(
request
,
next
)
->
{
return
(
request
,
next
)
->
{
final
long
start
=
System
.
nanoTime
();
final
long
start
=
System
.
nanoTime
();
return
next
.
handle
(
request
).
doOnSuccess
(
response
->
{
return
next
.
handle
(
request
).
doOnSuccess
(
(
response
)
->
{
Iterable
<
Tag
>
allTags
=
Tags
.
concat
(
tags
,
Iterable
<
Tag
>
allTags
=
Tags
.
concat
(
tags
,
this
.
defaultTags
.
apply
(
request
,
response
));
this
.
defaultTags
.
apply
(
request
,
response
));
this
.
registry
.
timer
(
name
,
allTags
).
record
(
System
.
nanoTime
()
-
start
,
this
.
registry
.
timer
(
name
,
allTags
).
record
(
System
.
nanoTime
()
-
start
,
TimeUnit
.
NANOSECONDS
);
TimeUnit
.
NANOSECONDS
);
}).
doOnError
(
error
->
{
}).
doOnError
(
(
error
)
->
{
// FIXME how do we get the response under an error condition?
// FIXME how do we get the response under an error condition?
Iterable
<
Tag
>
allTags
=
Tags
.
concat
(
tags
,
Iterable
<
Tag
>
allTags
=
Tags
.
concat
(
tags
,
this
.
defaultTags
.
apply
(
request
,
null
));
this
.
defaultTags
.
apply
(
request
,
null
));
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/beans/BeansEndpointTests.java
View file @
b234501a
...
@@ -99,7 +99,7 @@ public class BeansEndpointTests {
...
@@ -99,7 +99,7 @@ public class BeansEndpointTests {
parentRunner
.
run
((
parent
)
->
{
parentRunner
.
run
((
parent
)
->
{
new
ApplicationContextRunner
()
new
ApplicationContextRunner
()
.
withUserConfiguration
(
EndpointConfiguration
.
class
).
withParent
(
parent
)
.
withUserConfiguration
(
EndpointConfiguration
.
class
).
withParent
(
parent
)
.
run
(
child
->
{
.
run
(
(
child
)
->
{
ApplicationBeans
result
=
child
.
getBean
(
BeansEndpoint
.
class
).
beans
();
ApplicationBeans
result
=
child
.
getBean
(
BeansEndpoint
.
class
).
beans
();
assertThat
(
result
.
getContexts
().
get
(
parent
.
getId
()).
getBeans
())
assertThat
(
result
.
getContexts
().
get
(
parent
.
getId
()).
getBeans
())
.
containsKey
(
"bean"
);
.
containsKey
(
"bean"
);
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointParentTests.java
View file @
b234501a
...
@@ -42,7 +42,7 @@ public class ConfigurationPropertiesReportEndpointParentTests {
...
@@ -42,7 +42,7 @@ public class ConfigurationPropertiesReportEndpointParentTests {
.
run
((
parent
)
->
{
.
run
((
parent
)
->
{
new
ApplicationContextRunner
()
new
ApplicationContextRunner
()
.
withUserConfiguration
(
ClassConfigurationProperties
.
class
)
.
withUserConfiguration
(
ClassConfigurationProperties
.
class
)
.
withParent
(
parent
).
run
(
child
->
{
.
withParent
(
parent
).
run
(
(
child
)
->
{
ConfigurationPropertiesReportEndpoint
endpoint
=
child
ConfigurationPropertiesReportEndpoint
endpoint
=
child
.
getBean
(
ConfigurationPropertiesReportEndpoint
.
class
);
.
getBean
(
ConfigurationPropertiesReportEndpoint
.
class
);
ApplicationConfigurationProperties
applicationProperties
=
endpoint
ApplicationConfigurationProperties
applicationProperties
=
endpoint
...
@@ -65,7 +65,7 @@ public class ConfigurationPropertiesReportEndpointParentTests {
...
@@ -65,7 +65,7 @@ public class ConfigurationPropertiesReportEndpointParentTests {
new
ApplicationContextRunner
()
new
ApplicationContextRunner
()
.
withUserConfiguration
(
.
withUserConfiguration
(
BeanMethodConfigurationProperties
.
class
)
BeanMethodConfigurationProperties
.
class
)
.
withParent
(
parent
).
run
(
child
->
{
.
withParent
(
parent
).
run
(
(
child
)
->
{
ConfigurationPropertiesReportEndpoint
endpoint
=
child
ConfigurationPropertiesReportEndpoint
endpoint
=
child
.
getBean
(
ConfigurationPropertiesReportEndpoint
.
class
);
.
getBean
(
ConfigurationPropertiesReportEndpoint
.
class
);
ApplicationConfigurationProperties
applicationProperties
=
endpoint
ApplicationConfigurationProperties
applicationProperties
=
endpoint
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/AbstractWebEndpointIntegrationTests.java
View file @
b234501a
...
@@ -159,9 +159,8 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
...
@@ -159,9 +159,8 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
@Test
@Test
public
void
readOperationWithMappingFailureProducesBadRequestResponse
()
{
public
void
readOperationWithMappingFailureProducesBadRequestResponse
()
{
load
(
QueryEndpointConfiguration
.
class
,
(
client
)
->
{
load
(
QueryEndpointConfiguration
.
class
,
(
client
)
->
{
WebTestClient
.
BodyContentSpec
body
=
client
.
get
()
WebTestClient
.
BodyContentSpec
body
=
client
.
get
().
uri
(
"/query?two=two"
)
.
uri
(
"/query?two=two"
).
exchange
().
expectStatus
().
isBadRequest
()
.
exchange
().
expectStatus
().
isBadRequest
().
expectBody
();
.
expectBody
();
validateErrorBody
(
body
,
HttpStatus
.
BAD_REQUEST
,
"/endpoints/query"
,
validateErrorBody
(
body
,
HttpStatus
.
BAD_REQUEST
,
"/endpoints/query"
,
"Missing parameters: one"
);
"Missing parameters: one"
);
});
});
...
@@ -282,9 +281,8 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
...
@@ -282,9 +281,8 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
@Test
@Test
public
void
readOperationWithMissingRequiredParametersReturnsBadRequestResponse
()
{
public
void
readOperationWithMissingRequiredParametersReturnsBadRequestResponse
()
{
load
(
RequiredParameterEndpointConfiguration
.
class
,
(
client
)
->
{
load
(
RequiredParameterEndpointConfiguration
.
class
,
(
client
)
->
{
WebTestClient
.
BodyContentSpec
body
=
client
.
get
()
WebTestClient
.
BodyContentSpec
body
=
client
.
get
().
uri
(
"/requiredparameters"
)
.
uri
(
"/requiredparameters"
).
exchange
().
expectStatus
().
isBadRequest
()
.
exchange
().
expectStatus
().
isBadRequest
().
expectBody
();
.
expectBody
();
validateErrorBody
(
body
,
HttpStatus
.
BAD_REQUEST
,
validateErrorBody
(
body
,
HttpStatus
.
BAD_REQUEST
,
"/endpoints/requiredparameters"
,
"Missing parameters: foo"
);
"/endpoints/requiredparameters"
,
"Missing parameters: foo"
);
});
});
...
@@ -334,9 +332,8 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
...
@@ -334,9 +332,8 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
protected
void
validateErrorBody
(
WebTestClient
.
BodyContentSpec
body
,
protected
void
validateErrorBody
(
WebTestClient
.
BodyContentSpec
body
,
HttpStatus
status
,
String
path
,
String
message
)
{
HttpStatus
status
,
String
path
,
String
message
)
{
body
.
jsonPath
(
"status"
).
isEqualTo
(
status
.
value
())
body
.
jsonPath
(
"status"
).
isEqualTo
(
status
.
value
()).
jsonPath
(
"error"
)
.
jsonPath
(
"error"
).
isEqualTo
(
status
.
getReasonPhrase
())
.
isEqualTo
(
status
.
getReasonPhrase
()).
jsonPath
(
"path"
).
isEqualTo
(
path
)
.
jsonPath
(
"path"
).
isEqualTo
(
path
)
.
jsonPath
(
"message"
).
isEqualTo
(
message
);
.
jsonPath
(
"message"
).
isEqualTo
(
message
);
}
}
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/BaseConfiguration.java
View file @
b234501a
...
@@ -68,8 +68,8 @@ class BaseConfiguration {
...
@@ -68,8 +68,8 @@ class BaseConfiguration {
ParameterValueMapper
parameterMapper
=
new
ConversionServiceParameterValueMapper
(
ParameterValueMapper
parameterMapper
=
new
ConversionServiceParameterValueMapper
(
DefaultConversionService
.
getSharedInstance
());
DefaultConversionService
.
getSharedInstance
());
return
new
WebEndpointDiscoverer
(
applicationContext
,
parameterMapper
,
return
new
WebEndpointDiscoverer
(
applicationContext
,
parameterMapper
,
endpointMediaTypes
(),
PathMapper
.
useEndpointId
(),
endpointMediaTypes
(),
PathMapper
.
useEndpointId
(),
Collections
.
emptyList
(),
Collections
.
emptyList
()
,
Collections
.
emptyList
()
);
Collections
.
emptyList
());
}
}
@Bean
@Bean
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpointDiscovererTests.java
View file @
b234501a
...
@@ -298,9 +298,9 @@ public class WebEndpointDiscovererTests {
...
@@ -298,9 +298,9 @@ public class WebEndpointDiscovererTests {
Map
<
WebOperationRequestPredicate
,
Long
>
matchCounts
=
new
HashMap
<>();
Map
<
WebOperationRequestPredicate
,
Long
>
matchCounts
=
new
HashMap
<>();
for
(
WebOperationRequestPredicate
predicate
:
predicates
)
{
for
(
WebOperationRequestPredicate
predicate
:
predicates
)
{
matchCounts
.
put
(
predicate
,
Stream
.
of
(
matchers
)
matchCounts
.
put
(
predicate
,
Stream
.
of
(
matchers
)
.
filter
(
matcher
->
matcher
.
matches
(
predicate
)).
count
());
.
filter
(
(
matcher
)
->
matcher
.
matches
(
predicate
)).
count
());
}
}
return
matchCounts
.
values
().
stream
().
noneMatch
(
count
->
count
!=
1
);
return
matchCounts
.
values
().
stream
().
noneMatch
(
(
count
)
->
count
!=
1
);
},
Arrays
.
toString
(
matchers
));
},
Arrays
.
toString
(
matchers
));
}
}
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetricsIntegrationTests.java
View file @
b234501a
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -100,7 +100,7 @@ public class SpringIntegrationMetricsIntegrationTests {
...
@@ -100,7 +100,7 @@ public class SpringIntegrationMetricsIntegrationTests {
(
e
)
->
e
.
id
(
"toJson"
))
(
e
)
->
e
.
id
(
"toJson"
))
.
handle
(
String
.
class
,
this
::
fahrenheitToCelsius
,
.
handle
(
String
.
class
,
this
::
fahrenheitToCelsius
,
(
e
)
->
e
.
id
(
"temperatureConverter"
))
(
e
)
->
e
.
id
(
"temperatureConverter"
))
.
transform
(
this
::
extractResult
,
e
->
e
.
id
(
"toResponse"
));
.
transform
(
this
::
extractResult
,
(
e
)
->
e
.
id
(
"toResponse"
));
}
}
private
double
extractResult
(
String
json
)
{
private
double
extractResult
(
String
json
)
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java
View file @
b234501a
...
@@ -157,7 +157,7 @@ public class FlywayAutoConfiguration {
...
@@ -157,7 +157,7 @@ public class FlywayAutoConfiguration {
private
String
getProperty
(
Supplier
<
String
>
property
,
private
String
getProperty
(
Supplier
<
String
>
property
,
Supplier
<
String
>
defaultValue
)
{
Supplier
<
String
>
defaultValue
)
{
String
value
=
property
.
get
();
String
value
=
property
.
get
();
return
value
==
null
?
defaultValue
.
get
()
:
value
;
return
(
value
==
null
?
defaultValue
.
get
()
:
value
)
;
}
}
private
void
checkLocationExists
(
String
...
locations
)
{
private
void
checkLocationExists
(
String
...
locations
)
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/jetty/JettyCustomizer.java
View file @
b234501a
...
@@ -57,16 +57,19 @@ public final class JettyCustomizer {
...
@@ -57,16 +57,19 @@ public final class JettyCustomizer {
propertyMapper
.
from
(
jettyProperties:
:
getSelectors
).
whenNonNull
()
propertyMapper
.
from
(
jettyProperties:
:
getSelectors
).
whenNonNull
()
.
to
(
factory:
:
setSelectors
);
.
to
(
factory:
:
setSelectors
);
propertyMapper
.
from
(
serverProperties:
:
getMaxHttpHeaderSize
)
propertyMapper
.
from
(
serverProperties:
:
getMaxHttpHeaderSize
)
.
when
(
JettyCustomizer:
:
isPositive
).
to
(
maxHttpHeaderSize
->
.
when
(
JettyCustomizer:
:
isPositive
)
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
.
to
((
maxHttpHeaderSize
)
->
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
propertyMapper
.
from
(
jettyProperties:
:
getMaxHttpPostSize
)
propertyMapper
.
from
(
jettyProperties:
:
getMaxHttpPostSize
)
.
when
(
JettyCustomizer:
:
isPositive
)
.
when
(
JettyCustomizer:
:
isPositive
)
.
to
(
maxHttpPostSize
->
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
.
to
((
maxHttpPostSize
)
->
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
propertyMapper
.
from
(
serverProperties:
:
getConnectionTimeout
).
whenNonNull
()
propertyMapper
.
from
(
serverProperties:
:
getConnectionTimeout
).
whenNonNull
()
.
to
(
connectionTimeout
->
customizeConnectionTimeout
(
factory
,
connectionTimeout
));
.
to
((
connectionTimeout
)
->
customizeConnectionTimeout
(
factory
,
connectionTimeout
));
propertyMapper
.
from
(
jettyProperties:
:
getAccesslog
)
propertyMapper
.
from
(
jettyProperties:
:
getAccesslog
)
.
when
(
ServerProperties
.
Jetty
.
Accesslog
::
isEnabled
)
.
when
(
ServerProperties
.
Jetty
.
Accesslog
::
isEnabled
)
.
to
(
accesslog
->
customizeAccessLog
(
factory
,
accesslog
));
.
to
(
(
accesslog
)
->
customizeAccessLog
(
factory
,
accesslog
));
}
}
private
static
boolean
isPositive
(
Integer
value
)
{
private
static
boolean
isPositive
(
Integer
value
)
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/tomcat/TomcatCustomizer.java
View file @
b234501a
...
@@ -58,29 +58,35 @@ public final class TomcatCustomizer {
...
@@ -58,29 +58,35 @@ public final class TomcatCustomizer {
customizeRemoteIpValve
(
serverProperties
,
environment
,
factory
);
customizeRemoteIpValve
(
serverProperties
,
environment
,
factory
);
propertyMapper
.
from
(
tomcatProperties:
:
getMaxThreads
)
propertyMapper
.
from
(
tomcatProperties:
:
getMaxThreads
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
to
(
maxThreads
->
customizeMaxThreads
(
factory
,
tomcatProperties
.
getMaxThreads
()));
.
to
((
maxThreads
)
->
customizeMaxThreads
(
factory
,
tomcatProperties
.
getMaxThreads
()));
propertyMapper
.
from
(
tomcatProperties:
:
getMinSpareThreads
)
propertyMapper
.
from
(
tomcatProperties:
:
getMinSpareThreads
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
to
(
minSpareThreads
->
customizeMinThreads
(
factory
,
minSpareThreads
));
.
to
((
minSpareThreads
)
->
customizeMinThreads
(
factory
,
minSpareThreads
));
propertyMapper
.
from
(()
->
determineMaxHttpHeaderSize
(
serverProperties
,
tomcatProperties
))
propertyMapper
.
from
(()
->
determineMaxHttpHeaderSize
(
serverProperties
,
tomcatProperties
))
.
when
(
TomcatCustomizer:
:
isPositive
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
to
(
maxHttpHeaderSize
->
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
.
to
((
maxHttpHeaderSize
)
->
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
propertyMapper
.
from
(
tomcatProperties:
:
getMaxHttpPostSize
)
propertyMapper
.
from
(
tomcatProperties:
:
getMaxHttpPostSize
)
.
when
(
maxHttpPostSize
->
maxHttpPostSize
!=
0
)
.
when
((
maxHttpPostSize
)
->
maxHttpPostSize
!=
0
)
.
to
(
maxHttpPostSize
->
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
.
to
((
maxHttpPostSize
)
->
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
propertyMapper
.
from
(
tomcatProperties:
:
getAccesslog
)
propertyMapper
.
from
(
tomcatProperties:
:
getAccesslog
)
.
when
(
ServerProperties
.
Tomcat
.
Accesslog
::
isEnabled
)
.
when
(
ServerProperties
.
Tomcat
.
Accesslog
::
isEnabled
)
.
to
(
enabled
->
customizeAccessLog
(
tomcatProperties
,
factory
));
.
to
(
(
enabled
)
->
customizeAccessLog
(
tomcatProperties
,
factory
));
propertyMapper
.
from
(
tomcatProperties:
:
getUriEncoding
).
whenNonNull
()
propertyMapper
.
from
(
tomcatProperties:
:
getUriEncoding
).
whenNonNull
()
.
to
(
factory:
:
setUriEncoding
);
.
to
(
factory:
:
setUriEncoding
);
propertyMapper
.
from
(
serverProperties:
:
getConnectionTimeout
).
whenNonNull
()
propertyMapper
.
from
(
serverProperties:
:
getConnectionTimeout
).
whenNonNull
()
.
to
(
connectionTimeout
->
customizeConnectionTimeout
(
factory
,
connectionTimeout
));
.
to
((
connectionTimeout
)
->
customizeConnectionTimeout
(
factory
,
connectionTimeout
));
propertyMapper
.
from
(
tomcatProperties:
:
getMaxConnections
)
propertyMapper
.
from
(
tomcatProperties:
:
getMaxConnections
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
to
(
maxConnections
->
customizeMaxConnections
(
factory
,
maxConnections
));
.
to
(
(
maxConnections
)
->
customizeMaxConnections
(
factory
,
maxConnections
));
propertyMapper
.
from
(
tomcatProperties:
:
getAcceptCount
)
propertyMapper
.
from
(
tomcatProperties:
:
getAcceptCount
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
to
(
acceptCount
->
customizeAcceptCount
(
factory
,
acceptCount
));
.
to
(
(
acceptCount
)
->
customizeAcceptCount
(
factory
,
acceptCount
));
customizeStaticResources
(
serverProperties
.
getTomcat
().
getResource
(),
factory
);
customizeStaticResources
(
serverProperties
.
getTomcat
().
getResource
(),
factory
);
}
}
...
@@ -234,4 +240,5 @@ public final class TomcatCustomizer {
...
@@ -234,4 +240,5 @@ public final class TomcatCustomizer {
});
});
});
});
}
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/undertow/UndertowCustomizer.java
View file @
b234501a
...
@@ -63,21 +63,21 @@ public final class UndertowCustomizer {
...
@@ -63,21 +63,21 @@ public final class UndertowCustomizer {
.
to
(
factory:
:
setAccessLogSuffix
);
.
to
(
factory:
:
setAccessLogSuffix
);
propertyMapper
.
from
(
accesslogProperties:
:
isRotate
)
propertyMapper
.
from
(
accesslogProperties:
:
isRotate
)
.
to
(
factory:
:
setAccessLogRotate
);
.
to
(
factory:
:
setAccessLogRotate
);
propertyMapper
.
from
(()
->
propertyMapper
getOrDeduceUseForwardHeaders
(
serverProperties
,
environment
)).
to
(
.
from
(()
->
getOrDeduceUseForwardHeaders
(
serverProperties
,
environment
))
factory:
:
setUseForwardHeaders
);
.
to
(
factory:
:
setUseForwardHeaders
);
propertyMapper
.
from
(
serverProperties:
:
getMaxHttpHeaderSize
)
propertyMapper
.
from
(
serverProperties:
:
getMaxHttpHeaderSize
)
.
when
(
UndertowCustomizer:
:
isPositive
)
.
when
(
UndertowCustomizer:
:
isPositive
)
.
to
(
maxHttpHeaderSize
->
.
to
(
(
maxHttpHeaderSize
)
->
customizeMaxHttpHeaderSize
(
factory
,
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
maxHttpHeaderSize
));
propertyMapper
.
from
(
undertowProperties:
:
getMaxHttpPostSize
)
propertyMapper
.
from
(
undertowProperties:
:
getMaxHttpPostSize
)
.
when
(
UndertowCustomizer:
:
isPositive
)
.
when
(
UndertowCustomizer:
:
isPositive
)
.
to
(
maxHttpPostSize
->
.
to
(
(
maxHttpPostSize
)
->
customizeMaxHttpPostSize
(
factory
,
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
maxHttpPostSize
));
propertyMapper
.
from
(
serverProperties:
:
getConnectionTimeout
)
propertyMapper
.
from
(
serverProperties:
:
getConnectionTimeout
)
.
to
(
connectionTimeout
->
.
to
(
(
connectionTimeout
)
->
customizeConnectionTimeout
(
factory
,
c
ustomizeConnectionTimeout
(
factory
,
c
onnectionTimeout
));
connectionTimeout
));
factory
.
addDeploymentInfoCustomizers
(
deploymentInfo
->
deploymentInfo
factory
.
addDeploymentInfoCustomizers
(
(
deploymentInfo
)
->
deploymentInfo
.
setEagerFilterInit
(
undertowProperties
.
isEagerFilterInit
()));
.
setEagerFilterInit
(
undertowProperties
.
isEagerFilterInit
()));
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizer.java
View file @
b234501a
...
@@ -67,14 +67,14 @@ public class DefaultReactiveWebServerFactoryCustomizer
...
@@ -67,14 +67,14 @@ public class DefaultReactiveWebServerFactoryCustomizer
map
.
from
(
this
.
serverProperties
::
getSsl
).
to
(
factory:
:
setSsl
);
map
.
from
(
this
.
serverProperties
::
getSsl
).
to
(
factory:
:
setSsl
);
map
.
from
(
this
.
serverProperties
::
getCompression
).
to
(
factory:
:
setCompression
);
map
.
from
(
this
.
serverProperties
::
getCompression
).
to
(
factory:
:
setCompression
);
map
.
from
(
this
.
serverProperties
::
getHttp2
).
to
(
factory:
:
setHttp2
);
map
.
from
(
this
.
serverProperties
::
getHttp2
).
to
(
factory:
:
setHttp2
);
map
.
from
(()
->
factory
).
whenInstanceOf
(
TomcatReactiveWebServerFactory
.
class
)
map
.
from
(()
->
factory
).
whenInstanceOf
(
TomcatReactiveWebServerFactory
.
class
)
.
to
(
.
to
(
tomcatFactory
->
TomcatCustomizer
.
customizeTomcat
(
(
tomcatFactory
)
->
TomcatCustomizer
.
customizeTomcat
(
this
.
serverProperties
,
this
.
serverProperties
,
this
.
environment
,
tomcatFactory
));
this
.
environment
,
tomcatFactory
));
map
.
from
(()
->
factory
).
whenInstanceOf
(
JettyReactiveWebServerFactory
.
class
)
map
.
from
(()
->
factory
).
whenInstanceOf
(
JettyReactiveWebServerFactory
.
class
)
.
to
(
.
to
(
jettyFactory
->
JettyCustomizer
.
customizeJetty
(
this
.
serverProperties
,
(
jettyFactory
)
->
JettyCustomizer
.
customizeJetty
(
this
.
serverProperties
,
this
.
environment
,
jettyFactory
));
this
.
environment
,
jettyFactory
));
map
.
from
(()
->
factory
).
whenInstanceOf
(
UndertowReactiveWebServerFactory
.
class
)
map
.
from
(()
->
factory
).
whenInstanceOf
(
UndertowReactiveWebServerFactory
.
class
)
.
to
(
undertowFactory
->
UndertowCustomizer
.
customizeUndertow
(
.
to
(
(
undertowFactory
)
->
UndertowCustomizer
.
customizeUndertow
(
this
.
serverProperties
,
this
.
environment
,
undertowFactory
));
this
.
serverProperties
,
this
.
environment
,
undertowFactory
));
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizer.java
View file @
b234501a
...
@@ -83,17 +83,17 @@ public class DefaultServletWebServerFactoryCustomizer
...
@@ -83,17 +83,17 @@ public class DefaultServletWebServerFactoryCustomizer
map
.
from
(
this
.
serverProperties
::
getHttp2
).
to
(
factory:
:
setHttp2
);
map
.
from
(
this
.
serverProperties
::
getHttp2
).
to
(
factory:
:
setHttp2
);
map
.
from
(
this
.
serverProperties
::
getServerHeader
).
to
(
factory:
:
setServerHeader
);
map
.
from
(
this
.
serverProperties
::
getServerHeader
).
to
(
factory:
:
setServerHeader
);
map
.
from
(()
->
factory
).
whenInstanceOf
(
TomcatServletWebServerFactory
.
class
)
map
.
from
(()
->
factory
).
whenInstanceOf
(
TomcatServletWebServerFactory
.
class
)
.
to
(
tomcatFactory
->
{
.
to
(
(
tomcatFactory
)
->
{
TomcatCustomizer
.
customizeTomcat
(
this
.
serverProperties
,
TomcatCustomizer
.
customizeTomcat
(
this
.
serverProperties
,
this
.
environment
,
tomcatFactory
);
this
.
environment
,
tomcatFactory
);
TomcatServletCustomizer
.
customizeTomcat
(
this
.
serverProperties
,
TomcatServletCustomizer
.
customizeTomcat
(
this
.
serverProperties
,
this
.
environment
,
tomcatFactory
);
this
.
environment
,
tomcatFactory
);
});
});
map
.
from
(()
->
factory
).
whenInstanceOf
(
JettyServletWebServerFactory
.
class
)
map
.
from
(()
->
factory
).
whenInstanceOf
(
JettyServletWebServerFactory
.
class
)
.
to
(
.
to
(
jettyFactory
->
JettyCustomizer
.
customizeJetty
(
this
.
serverProperties
,
(
jettyFactory
)
->
JettyCustomizer
.
customizeJetty
(
this
.
serverProperties
,
this
.
environment
,
jettyFactory
));
this
.
environment
,
jettyFactory
));
map
.
from
(()
->
factory
).
whenInstanceOf
(
UndertowServletWebServerFactory
.
class
)
map
.
from
(()
->
factory
).
whenInstanceOf
(
UndertowServletWebServerFactory
.
class
)
.
to
(
undertowFactory
->
UndertowCustomizer
.
customizeUndertow
(
.
to
(
(
undertowFactory
)
->
UndertowCustomizer
.
customizeUndertow
(
this
.
serverProperties
,
this
.
environment
,
undertowFactory
));
this
.
serverProperties
,
this
.
environment
,
undertowFactory
));
map
.
from
(
this
.
serverProperties
.
getServlet
()::
getContextParameters
)
map
.
from
(
this
.
serverProperties
.
getServlet
()::
getContextParameters
)
.
to
(
factory:
:
setInitParameters
);
.
to
(
factory:
:
setInitParameters
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesAutoConfigurationTests.java
View file @
b234501a
...
@@ -60,11 +60,12 @@ public class CassandraRepositoriesAutoConfigurationTests {
...
@@ -60,11 +60,12 @@ public class CassandraRepositoriesAutoConfigurationTests {
@Test
@Test
public
void
testDefaultRepositoryConfiguration
()
{
public
void
testDefaultRepositoryConfiguration
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
).
run
((
context
)
->
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
assertThat
(
context
).
hasSingleBean
(
CityRepository
.
class
);
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
Cluster
.
class
);
assertThat
(
context
).
hasSingleBean
(
CityRepository
.
class
);
assertThat
(
getInitialEntitySet
(
context
)).
hasSize
(
1
);
assertThat
(
context
).
hasSingleBean
(
Cluster
.
class
);
});
assertThat
(
getInitialEntitySet
(
context
)).
hasSize
(
1
);
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesAutoConfigurationTests.java
View file @
b234501a
...
@@ -58,16 +58,17 @@ public class MongoReactiveRepositoriesAutoConfigurationTests {
...
@@ -58,16 +58,17 @@ public class MongoReactiveRepositoriesAutoConfigurationTests {
@Test
@Test
public
void
testDefaultRepositoryConfiguration
()
{
public
void
testDefaultRepositoryConfiguration
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
).
run
((
context
)
->
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
assertThat
(
context
).
hasSingleBean
(
ReactiveCityRepository
.
class
);
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
assertThat
(
context
).
hasSingleBean
(
ReactiveCityRepository
.
class
);
MongoMappingContext
mappingContext
=
context
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
.
getBean
(
MongoMappingContext
.
class
);
MongoMappingContext
mappingContext
=
context
@SuppressWarnings
(
"unchecked"
)
.
getBean
(
MongoMappingContext
.
class
);
Set
<?
extends
Class
<?>>
entities
=
(
Set
<?
extends
Class
<?>>)
ReflectionTestUtils
@SuppressWarnings
(
"unchecked"
)
.
getField
(
mappingContext
,
"initialEntitySet"
);
Set
<?
extends
Class
<?>>
entities
=
(
Set
<?
extends
Class
<?>>)
ReflectionTestUtils
assertThat
(
entities
).
hasSize
(
1
);
.
getField
(
mappingContext
,
"initialEntitySet"
);
});
assertThat
(
entities
).
hasSize
(
1
);
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesAutoConfigurationTests.java
View file @
b234501a
...
@@ -53,16 +53,17 @@ public class MongoRepositoriesAutoConfigurationTests {
...
@@ -53,16 +53,17 @@ public class MongoRepositoriesAutoConfigurationTests {
@Test
@Test
public
void
testDefaultRepositoryConfiguration
()
{
public
void
testDefaultRepositoryConfiguration
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
).
run
((
context
)
->
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
assertThat
(
context
).
hasSingleBean
(
CityRepository
.
class
);
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
assertThat
(
context
).
hasSingleBean
(
CityRepository
.
class
);
MongoMappingContext
mappingContext
=
context
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
.
getBean
(
MongoMappingContext
.
class
);
MongoMappingContext
mappingContext
=
context
@SuppressWarnings
(
"unchecked"
)
.
getBean
(
MongoMappingContext
.
class
);
Set
<?
extends
Class
<?>>
entities
=
(
Set
<?
extends
Class
<?>>)
ReflectionTestUtils
@SuppressWarnings
(
"unchecked"
)
.
getField
(
mappingContext
,
"initialEntitySet"
);
Set
<?
extends
Class
<?>>
entities
=
(
Set
<?
extends
Class
<?>>)
ReflectionTestUtils
assertThat
(
entities
).
hasSize
(
1
);
.
getField
(
mappingContext
,
"initialEntitySet"
);
});
assertThat
(
entities
).
hasSize
(
1
);
});
}
}
@Test
@Test
...
@@ -80,8 +81,9 @@ public class MongoRepositoriesAutoConfigurationTests {
...
@@ -80,8 +81,9 @@ public class MongoRepositoriesAutoConfigurationTests {
@Test
@Test
public
void
autoConfigurationShouldNotKickInEvenIfManualConfigDidNotCreateAnyRepositories
()
{
public
void
autoConfigurationShouldNotKickInEvenIfManualConfigDidNotCreateAnyRepositories
()
{
this
.
contextRunner
.
withUserConfiguration
(
SortOfInvalidCustomConfiguration
.
class
).
run
(
this
.
contextRunner
.
withUserConfiguration
(
SortOfInvalidCustomConfiguration
.
class
)
(
context
)
->
assertThat
(
context
).
doesNotHaveBean
(
CityRepository
.
class
));
.
run
((
context
)
->
assertThat
(
context
)
.
doesNotHaveBean
(
CityRepository
.
class
));
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/AuthenticationManagerConfigurationTests.java
View file @
b234501a
...
@@ -74,7 +74,8 @@ public class AuthenticationManagerConfigurationTests {
...
@@ -74,7 +74,8 @@ public class AuthenticationManagerConfigurationTests {
this
.
contextRunner
this
.
contextRunner
.
withUserConfiguration
(
TestConfigWithClientRegistrationRepository
.
class
,
.
withUserConfiguration
(
TestConfigWithClientRegistrationRepository
.
class
,
AuthenticationManagerConfiguration
.
class
)
AuthenticationManagerConfiguration
.
class
)
.
run
(((
context
)
->
assertThat
(
context
).
doesNotHaveBean
(
InMemoryUserDetailsManager
.
class
)));
.
run
(((
context
)
->
assertThat
(
context
)
.
doesNotHaveBean
(
InMemoryUserDetailsManager
.
class
)));
}
}
private
void
testPasswordEncoding
(
Class
<?>
configClass
,
String
providedPassword
,
private
void
testPasswordEncoding
(
Class
<?>
configClass
,
String
providedPassword
,
...
...
spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java
View file @
b234501a
...
@@ -70,8 +70,8 @@ class PropertiesMigrationReporter {
...
@@ -70,8 +70,8 @@ class PropertiesMigrationReporter {
return
report
;
return
report
;
}
}
properties
.
forEach
((
name
,
candidates
)
->
{
properties
.
forEach
((
name
,
candidates
)
->
{
PropertySource
<?>
propertySource
=
mapPropertiesWithReplacement
(
report
,
PropertySource
<?>
propertySource
=
mapPropertiesWithReplacement
(
report
,
name
,
name
,
candidates
);
candidates
);
if
(
propertySource
!=
null
)
{
if
(
propertySource
!=
null
)
{
this
.
environment
.
getPropertySources
().
addBefore
(
name
,
propertySource
);
this
.
environment
.
getPropertySources
().
addBefore
(
name
,
propertySource
);
}
}
...
@@ -84,8 +84,8 @@ class PropertiesMigrationReporter {
...
@@ -84,8 +84,8 @@ class PropertiesMigrationReporter {
List
<
PropertyMigration
>
properties
)
{
List
<
PropertyMigration
>
properties
)
{
List
<
PropertyMigration
>
renamed
=
new
ArrayList
<>();
List
<
PropertyMigration
>
renamed
=
new
ArrayList
<>();
List
<
PropertyMigration
>
unsupported
=
new
ArrayList
<>();
List
<
PropertyMigration
>
unsupported
=
new
ArrayList
<>();
properties
.
forEach
((
property
)
->
properties
.
forEach
((
property
)
->
(
isRenamed
(
property
)
?
renamed
:
unsupported
)
(
isRenamed
(
property
)
?
renamed
:
unsupported
)
.
add
(
property
));
.
add
(
property
));
report
.
add
(
name
,
renamed
,
unsupported
);
report
.
add
(
name
,
renamed
,
unsupported
);
if
(
renamed
.
isEmpty
())
{
if
(
renamed
.
isEmpty
())
{
return
null
;
return
null
;
...
@@ -133,7 +133,7 @@ class PropertiesMigrationReporter {
...
@@ -133,7 +133,7 @@ class PropertiesMigrationReporter {
List
<
ConfigurationMetadataProperty
>
candidates
=
this
.
allProperties
.
values
()
List
<
ConfigurationMetadataProperty
>
candidates
=
this
.
allProperties
.
values
()
.
stream
().
filter
(
filter
).
collect
(
Collectors
.
toList
());
.
stream
().
filter
(
filter
).
collect
(
Collectors
.
toList
());
getPropertySourcesAsMap
().
forEach
((
name
,
source
)
->
{
getPropertySourcesAsMap
().
forEach
((
name
,
source
)
->
{
candidates
.
forEach
(
metadata
->
{
candidates
.
forEach
(
(
metadata
)
->
{
ConfigurationProperty
configurationProperty
=
source
ConfigurationProperty
configurationProperty
=
source
.
getConfigurationProperty
(
.
getConfigurationProperty
(
ConfigurationPropertyName
.
of
(
metadata
.
getId
()));
ConfigurationPropertyName
.
of
(
metadata
.
getId
()));
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java
View file @
b234501a
...
@@ -359,8 +359,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
...
@@ -359,8 +359,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
@Test
@Test
public
void
annotatedGetter
()
{
public
void
annotatedGetter
()
{
ConfigurationMetadata
metadata
=
compile
(
AnnotatedGetter
.
class
);
ConfigurationMetadata
metadata
=
compile
(
AnnotatedGetter
.
class
);
assertThat
(
metadata
)
.
has
(
Metadata
.
withGroup
(
"specific"
)
assertThat
(
metadata
)
.
fromSource
(
AnnotatedGetter
.
class
));
.
has
(
Metadata
.
withGroup
(
"specific"
).
fromSource
(
AnnotatedGetter
.
class
));
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"specific.name"
,
String
.
class
)
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"specific.name"
,
String
.
class
)
.
fromSource
(
AnnotatedGetter
.
class
));
.
fromSource
(
AnnotatedGetter
.
class
));
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java
View file @
b234501a
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyValueFailureAnalyzer.java
View file @
b234501a
...
@@ -94,8 +94,8 @@ class InvalidConfigurationPropertyValueFailureAnalyzer
...
@@ -94,8 +94,8 @@ class InvalidConfigurationPropertyValueFailureAnalyzer
private
void
appendReason
(
StringBuilder
message
,
private
void
appendReason
(
StringBuilder
message
,
InvalidConfigurationPropertyValueException
cause
)
{
InvalidConfigurationPropertyValueException
cause
)
{
if
(
StringUtils
.
hasText
(
cause
.
getReason
()))
{
if
(
StringUtils
.
hasText
(
cause
.
getReason
()))
{
message
.
append
(
String
.
format
(
" Validation failed for the following "
message
.
append
(
String
+
"reason:%n%n"
));
.
format
(
" Validation failed for the following "
+
"reason:%n%n"
));
message
.
append
(
cause
.
getReason
());
message
.
append
(
cause
.
getReason
());
}
}
else
{
else
{
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyValueFailureAnalyzerTests.java
View file @
b234501a
...
@@ -75,8 +75,7 @@ public class InvalidConfigurationPropertyValueFailureAnalyzerTests {
...
@@ -75,8 +75,7 @@ public class InvalidConfigurationPropertyValueFailureAnalyzerTests {
InvalidConfigurationPropertyValueException
failure
=
new
InvalidConfigurationPropertyValueException
(
InvalidConfigurationPropertyValueException
failure
=
new
InvalidConfigurationPropertyValueException
(
"test.property"
,
"invalid"
,
null
);
"test.property"
,
"invalid"
,
null
);
FailureAnalysis
analysis
=
performAnalysis
(
failure
);
FailureAnalysis
analysis
=
performAnalysis
(
failure
);
assertThat
(
analysis
.
getAction
())
assertThat
(
analysis
.
getAction
()).
contains
(
"Review the value of the property."
);
.
contains
(
"Review the value of the property."
);
assertThat
(
analysis
.
getDescription
()).
contains
(
"No reason was provided."
)
assertThat
(
analysis
.
getDescription
()).
contains
(
"No reason was provided."
)
.
doesNotContain
(
"Additionally, this property is also set"
);
.
doesNotContain
(
"Additionally, this property is also set"
);
}
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/metadata/AbstractDataSourcePoolMetadataTests.java
View file @
b234501a
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -74,7 +74,7 @@ public abstract class AbstractDataSourcePoolMetadataTests<D extends AbstractData
...
@@ -74,7 +74,7 @@ public abstract class AbstractDataSourcePoolMetadataTests<D extends AbstractData
final
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
(
final
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
(
getDataSourceMetadata
().
getDataSource
());
getDataSourceMetadata
().
getDataSource
());
jdbcTemplate
.
execute
((
ConnectionCallback
<
Void
>)
(
connection
)
->
{
jdbcTemplate
.
execute
((
ConnectionCallback
<
Void
>)
(
connection
)
->
{
jdbcTemplate
.
execute
((
ConnectionCallback
<
Void
>)
connection1
->
{
jdbcTemplate
.
execute
((
ConnectionCallback
<
Void
>)
(
connection1
)
->
{
assertThat
(
getDataSourceMetadata
().
getActive
()).
isEqualTo
(
2
);
assertThat
(
getDataSourceMetadata
().
getActive
()).
isEqualTo
(
2
);
assertThat
(
getDataSourceMetadata
().
getUsage
()).
isEqualTo
(
1.0f
);
assertThat
(
getDataSourceMetadata
().
getUsage
()).
isEqualTo
(
1.0f
);
return
null
;
return
null
;
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java
View file @
b234501a
...
@@ -143,7 +143,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
...
@@ -143,7 +143,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
protected
ReactorClientHttpConnector
buildTrustAllSslConnector
()
{
protected
ReactorClientHttpConnector
buildTrustAllSslConnector
()
{
return
new
ReactorClientHttpConnector
(
return
new
ReactorClientHttpConnector
(
(
options
)
->
options
.
sslSupport
(
sslContextBuilder
->
{
(
options
)
->
options
.
sslSupport
(
(
sslContextBuilder
)
->
{
sslContextBuilder
.
sslProvider
(
SslProvider
.
JDK
)
sslContextBuilder
.
sslProvider
(
SslProvider
.
JDK
)
.
trustManager
(
InsecureTrustManagerFactory
.
INSTANCE
);
.
trustManager
(
InsecureTrustManagerFactory
.
INSTANCE
);
}));
}));
...
@@ -180,7 +180,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
...
@@ -180,7 +180,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
.
getInstance
(
KeyManagerFactory
.
getDefaultAlgorithm
());
.
getInstance
(
KeyManagerFactory
.
getDefaultAlgorithm
());
clientKeyManagerFactory
.
init
(
clientKeyStore
,
"password"
.
toCharArray
());
clientKeyManagerFactory
.
init
(
clientKeyStore
,
"password"
.
toCharArray
());
return
new
ReactorClientHttpConnector
(
return
new
ReactorClientHttpConnector
(
(
options
)
->
options
.
sslSupport
(
sslContextBuilder
->
{
(
options
)
->
options
.
sslSupport
(
(
sslContextBuilder
)
->
{
sslContextBuilder
.
sslProvider
(
SslProvider
.
JDK
)
sslContextBuilder
.
sslProvider
(
SslProvider
.
JDK
)
.
trustManager
(
InsecureTrustManagerFactory
.
INSTANCE
)
.
trustManager
(
InsecureTrustManagerFactory
.
INSTANCE
)
.
keyManager
(
clientKeyManagerFactory
);
.
keyManager
(
clientKeyManagerFactory
);
...
...
spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/ManagementPortAndPathSampleActuatorApplicationTests.java
View file @
b234501a
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -38,7 +38,8 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -38,7 +38,8 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"management.server.port=0"
,
"management.server.servlet.context-path=/management"
})
"management.server.port=0"
,
"management.server.servlet.context-path=/management"
})
public
class
ManagementPortAndPathSampleActuatorApplicationTests
{
public
class
ManagementPortAndPathSampleActuatorApplicationTests
{
@LocalServerPort
@LocalServerPort
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java
View file @
b234501a
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -97,8 +97,7 @@ class ApplicationBuilder {
...
@@ -97,8 +97,7 @@ class ApplicationBuilder {
return
resourcesJar
;
return
resourcesJar
;
}
}
private
void
writePom
(
File
appFolder
,
File
resourcesJar
)
private
void
writePom
(
File
appFolder
,
File
resourcesJar
)
throws
IOException
{
throws
IOException
{
Map
<
String
,
Object
>
context
=
new
HashMap
<>();
Map
<
String
,
Object
>
context
=
new
HashMap
<>();
context
.
put
(
"packaging"
,
this
.
packaging
);
context
.
put
(
"packaging"
,
this
.
packaging
);
context
.
put
(
"container"
,
this
.
container
);
context
.
put
(
"container"
,
this
.
container
);
...
...
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