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 {
*/
public
CloudFoundryWebEndpointDiscoverer
(
ApplicationContext
applicationContext
,
ParameterValueMapper
parameterValueMapper
,
EndpointMediaTypes
endpointMediaTypes
,
PathMapper
endpointPathMapper
,
EndpointMediaTypes
endpointMediaTypes
,
PathMapper
endpointPathMapper
,
Collection
<
OperationInvokerAdvisor
>
invokerAdvisors
,
Collection
<
EndpointFilter
<
ExposableWebEndpoint
>>
filters
)
{
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;
import
org.springframework.boot.actuate.endpoint.web.PathMapper
;
/**
* A {@link PathMapper} implementation that uses a simple {@link Map} to
*
determine the
endpoint path.
* A {@link PathMapper} implementation that uses a simple {@link Map} to
determine the
* endpoint path.
*
* @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 {
@Bean
public
CacheMetricsRegistrar
cacheMetricsRegistrar
()
{
return
new
CacheMetricsRegistrar
(
this
.
registry
,
this
.
properties
.
getMetricName
(),
this
.
binderProviders
);
return
new
CacheMetricsRegistrar
(
this
.
registry
,
this
.
properties
.
getMetricName
(),
this
.
binderProviders
);
}
@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 {
this
.
load
((
id
)
->
null
,
(
id
)
->
id
,
configuration
,
consumer
);
}
private
void
load
(
Function
<
String
,
Long
>
timeToLive
,
PathMapper
endpointPathMapper
,
Class
<?>
configuration
,
private
void
load
(
Function
<
String
,
Long
>
timeToLive
,
PathMapper
endpointPathMapper
,
Class
<?>
configuration
,
Consumer
<
CloudFoundryWebEndpointDiscoverer
>
consumer
)
{
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
(
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 {
@Before
public
void
setup
()
{
MockitoAnnotations
.
initMocks
(
this
);
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
tokenValidator
,
this
.
securityService
,
"my-app-id"
);
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
tokenValidator
,
this
.
securityService
,
"my-app-id"
);
}
@Test
...
...
@@ -90,8 +90,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests {
@Test
public
void
preHandleWhenApplicationIdIsNullShouldReturnError
()
{
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
tokenValidator
,
this
.
securityService
,
null
);
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
tokenValidator
,
this
.
securityService
,
null
);
MockServerWebExchange
request
=
MockServerWebExchange
.
from
(
MockServerHttpRequest
.
get
(
"/a"
)
.
header
(
HttpHeaders
.
AUTHORIZATION
,
"bearer "
+
mockAccessToken
())
...
...
@@ -105,8 +105,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests {
@Test
public
void
preHandleWhenCloudFoundrySecurityServiceIsNullShouldReturnError
()
{
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
tokenValidator
,
null
,
"my-app-id"
);
this
.
interceptor
=
new
CloudFoundrySecurityInterceptor
(
this
.
tokenValidator
,
null
,
"my-app-id"
);
MockServerWebExchange
request
=
MockServerWebExchange
.
from
(
MockServerHttpRequest
.
get
(
"/a"
).
header
(
HttpHeaders
.
AUTHORIZATION
,
mockAccessToken
()).
build
());
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 {
@Test
public
void
autoConfiguredCacheManagerWithCustomMetricName
()
{
this
.
contextRunner
.
withPropertyValues
(
"management.metrics.cache.metric-name=custom.name"
,
.
withPropertyValues
(
"management.metrics.cache.metric-name=custom.name"
,
"spring.cache.type=caffeine"
,
"spring.cache.cache-names=cache1"
)
.
run
((
context
)
->
{
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
super
(
"Failed to invoke operation because the following required "
+
"parameters were missing: "
+
StringUtils
.
collectionToCommaDelimitedString
(
missingParameters
),
"Missing parameters: "
+
missingParameters
.
stream
()
.
map
(
OperationParameter:
:
getName
)
.
collect
(
Collectors
.
joining
(
","
)));
"Missing parameters: "
+
missingParameters
.
stream
()
.
map
(
OperationParameter:
:
getName
)
.
collect
(
Collectors
.
joining
(
","
)));
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;
import
org.springframework.web.bind.annotation.PostMapping
;
/**
* Identifies a type as being an endpoint that is only exposed over Spring MVC or
*
Spring
WebFlux. Mapped methods must be annotated with {@link GetMapping @GetMapping},
* Identifies a type as being an endpoint that is only exposed over Spring MVC or
Spring
* WebFlux. Mapped methods must be annotated with {@link GetMapping @GetMapping},
* {@link PostMapping @PostMapping}, {@link DeleteMapping @DeleteMapping}, etc annotations
* rather than {@link ReadOperation @ReadOperation},
* {@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;
import
org.springframework.util.Assert
;
/**
* {@link EndpointDiscoverer} for {@link ExposableControllerEndpoint controller endpoints}.
* {@link EndpointDiscoverer} for {@link ExposableControllerEndpoint controller
* endpoints}.
*
* @author Phillip Webb
* @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
private
Mono
<
ResponseEntity
<
Object
>>
handleResult
(
Publisher
<?>
result
,
HttpMethod
httpMethod
)
{
return
Mono
.
from
(
result
).
map
(
this
::
toResponseEntity
)
.
onErrorMap
(
InvalidEndpointRequestException
.
class
,
(
ex
)
->
new
ResponseStatusException
(
HttpStatus
.
BAD_REQUEST
,
.
onErrorMap
(
InvalidEndpointRequestException
.
class
,
(
ex
)
->
new
ResponseStatusException
(
HttpStatus
.
BAD_REQUEST
,
ex
.
getReason
()))
.
defaultIfEmpty
(
new
ResponseEntity
<>(
httpMethod
==
HttpMethod
.
GET
?
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
private
Map
<
Object
,
ExposableControllerEndpoint
>
getHandlers
(
Collection
<
ExposableControllerEndpoint
>
endpoints
)
{
Map
<
Object
,
ExposableControllerEndpoint
>
handlers
=
new
LinkedHashMap
<>();
endpoints
.
forEach
((
endpoint
)
->
handlers
.
put
(
endpoint
.
getController
(),
endpoint
));
endpoints
.
forEach
((
endpoint
)
->
handlers
.
put
(
endpoint
.
getController
(),
endpoint
));
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
private
Map
<
Object
,
ExposableControllerEndpoint
>
getHandlers
(
Collection
<
ExposableControllerEndpoint
>
endpoints
)
{
Map
<
Object
,
ExposableControllerEndpoint
>
handlers
=
new
LinkedHashMap
<>();
endpoints
.
forEach
((
endpoint
)
->
handlers
.
put
(
endpoint
.
getController
(),
endpoint
));
endpoints
.
forEach
((
endpoint
)
->
handlers
.
put
(
endpoint
.
getController
(),
endpoint
));
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");
* you may not use this file except in compliance with the License.
...
...
@@ -75,12 +75,12 @@ public class RouterFunctionMetrics {
Iterable
<
Tag
>
tags
)
{
return
(
request
,
next
)
->
{
final
long
start
=
System
.
nanoTime
();
return
next
.
handle
(
request
).
doOnSuccess
(
response
->
{
return
next
.
handle
(
request
).
doOnSuccess
(
(
response
)
->
{
Iterable
<
Tag
>
allTags
=
Tags
.
concat
(
tags
,
this
.
defaultTags
.
apply
(
request
,
response
));
this
.
registry
.
timer
(
name
,
allTags
).
record
(
System
.
nanoTime
()
-
start
,
TimeUnit
.
NANOSECONDS
);
}).
doOnError
(
error
->
{
}).
doOnError
(
(
error
)
->
{
// FIXME how do we get the response under an error condition?
Iterable
<
Tag
>
allTags
=
Tags
.
concat
(
tags
,
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 {
parentRunner
.
run
((
parent
)
->
{
new
ApplicationContextRunner
()
.
withUserConfiguration
(
EndpointConfiguration
.
class
).
withParent
(
parent
)
.
run
(
child
->
{
.
run
(
(
child
)
->
{
ApplicationBeans
result
=
child
.
getBean
(
BeansEndpoint
.
class
).
beans
();
assertThat
(
result
.
getContexts
().
get
(
parent
.
getId
()).
getBeans
())
.
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 {
.
run
((
parent
)
->
{
new
ApplicationContextRunner
()
.
withUserConfiguration
(
ClassConfigurationProperties
.
class
)
.
withParent
(
parent
).
run
(
child
->
{
.
withParent
(
parent
).
run
(
(
child
)
->
{
ConfigurationPropertiesReportEndpoint
endpoint
=
child
.
getBean
(
ConfigurationPropertiesReportEndpoint
.
class
);
ApplicationConfigurationProperties
applicationProperties
=
endpoint
...
...
@@ -65,7 +65,7 @@ public class ConfigurationPropertiesReportEndpointParentTests {
new
ApplicationContextRunner
()
.
withUserConfiguration
(
BeanMethodConfigurationProperties
.
class
)
.
withParent
(
parent
).
run
(
child
->
{
.
withParent
(
parent
).
run
(
(
child
)
->
{
ConfigurationPropertiesReportEndpoint
endpoint
=
child
.
getBean
(
ConfigurationPropertiesReportEndpoint
.
class
);
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
@Test
public
void
readOperationWithMappingFailureProducesBadRequestResponse
()
{
load
(
QueryEndpointConfiguration
.
class
,
(
client
)
->
{
WebTestClient
.
BodyContentSpec
body
=
client
.
get
()
.
uri
(
"/query?two=two"
).
exchange
().
expectStatus
().
isBadRequest
()
.
expectBody
();
WebTestClient
.
BodyContentSpec
body
=
client
.
get
().
uri
(
"/query?two=two"
)
.
exchange
().
expectStatus
().
isBadRequest
().
expectBody
();
validateErrorBody
(
body
,
HttpStatus
.
BAD_REQUEST
,
"/endpoints/query"
,
"Missing parameters: one"
);
});
...
...
@@ -282,9 +281,8 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
@Test
public
void
readOperationWithMissingRequiredParametersReturnsBadRequestResponse
()
{
load
(
RequiredParameterEndpointConfiguration
.
class
,
(
client
)
->
{
WebTestClient
.
BodyContentSpec
body
=
client
.
get
()
.
uri
(
"/requiredparameters"
).
exchange
().
expectStatus
().
isBadRequest
()
.
expectBody
();
WebTestClient
.
BodyContentSpec
body
=
client
.
get
().
uri
(
"/requiredparameters"
)
.
exchange
().
expectStatus
().
isBadRequest
().
expectBody
();
validateErrorBody
(
body
,
HttpStatus
.
BAD_REQUEST
,
"/endpoints/requiredparameters"
,
"Missing parameters: foo"
);
});
...
...
@@ -334,9 +332,8 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
protected
void
validateErrorBody
(
WebTestClient
.
BodyContentSpec
body
,
HttpStatus
status
,
String
path
,
String
message
)
{
body
.
jsonPath
(
"status"
).
isEqualTo
(
status
.
value
())
.
jsonPath
(
"error"
).
isEqualTo
(
status
.
getReasonPhrase
())
.
jsonPath
(
"path"
).
isEqualTo
(
path
)
body
.
jsonPath
(
"status"
).
isEqualTo
(
status
.
value
()).
jsonPath
(
"error"
)
.
isEqualTo
(
status
.
getReasonPhrase
()).
jsonPath
(
"path"
).
isEqualTo
(
path
)
.
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 {
ParameterValueMapper
parameterMapper
=
new
ConversionServiceParameterValueMapper
(
DefaultConversionService
.
getSharedInstance
());
return
new
WebEndpointDiscoverer
(
applicationContext
,
parameterMapper
,
endpointMediaTypes
(),
PathMapper
.
useEndpointId
(),
Collections
.
emptyList
()
,
Collections
.
emptyList
()
);
endpointMediaTypes
(),
PathMapper
.
useEndpointId
(),
Collections
.
emptyList
(),
Collections
.
emptyList
());
}
@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 {
Map
<
WebOperationRequestPredicate
,
Long
>
matchCounts
=
new
HashMap
<>();
for
(
WebOperationRequestPredicate
predicate
:
predicates
)
{
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
));
}
...
...
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");
* you may not use this file except in compliance with the License.
...
...
@@ -100,7 +100,7 @@ public class SpringIntegrationMetricsIntegrationTests {
(
e
)
->
e
.
id
(
"toJson"
))
.
handle
(
String
.
class
,
this
::
fahrenheitToCelsius
,
(
e
)
->
e
.
id
(
"temperatureConverter"
))
.
transform
(
this
::
extractResult
,
e
->
e
.
id
(
"toResponse"
));
.
transform
(
this
::
extractResult
,
(
e
)
->
e
.
id
(
"toResponse"
));
}
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 {
private
String
getProperty
(
Supplier
<
String
>
property
,
Supplier
<
String
>
defaultValue
)
{
String
value
=
property
.
get
();
return
value
==
null
?
defaultValue
.
get
()
:
value
;
return
(
value
==
null
?
defaultValue
.
get
()
:
value
)
;
}
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 {
propertyMapper
.
from
(
jettyProperties:
:
getSelectors
).
whenNonNull
()
.
to
(
factory:
:
setSelectors
);
propertyMapper
.
from
(
serverProperties:
:
getMaxHttpHeaderSize
)
.
when
(
JettyCustomizer:
:
isPositive
).
to
(
maxHttpHeaderSize
->
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
.
when
(
JettyCustomizer:
:
isPositive
)
.
to
((
maxHttpHeaderSize
)
->
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
propertyMapper
.
from
(
jettyProperties:
:
getMaxHttpPostSize
)
.
when
(
JettyCustomizer:
:
isPositive
)
.
to
(
maxHttpPostSize
->
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
.
to
((
maxHttpPostSize
)
->
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
propertyMapper
.
from
(
serverProperties:
:
getConnectionTimeout
).
whenNonNull
()
.
to
(
connectionTimeout
->
customizeConnectionTimeout
(
factory
,
connectionTimeout
));
.
to
((
connectionTimeout
)
->
customizeConnectionTimeout
(
factory
,
connectionTimeout
));
propertyMapper
.
from
(
jettyProperties:
:
getAccesslog
)
.
when
(
ServerProperties
.
Jetty
.
Accesslog
::
isEnabled
)
.
to
(
accesslog
->
customizeAccessLog
(
factory
,
accesslog
));
.
to
(
(
accesslog
)
->
customizeAccessLog
(
factory
,
accesslog
));
}
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 {
customizeRemoteIpValve
(
serverProperties
,
environment
,
factory
);
propertyMapper
.
from
(
tomcatProperties:
:
getMaxThreads
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
to
(
maxThreads
->
customizeMaxThreads
(
factory
,
tomcatProperties
.
getMaxThreads
()));
.
to
((
maxThreads
)
->
customizeMaxThreads
(
factory
,
tomcatProperties
.
getMaxThreads
()));
propertyMapper
.
from
(
tomcatProperties:
:
getMinSpareThreads
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
to
(
minSpareThreads
->
customizeMinThreads
(
factory
,
minSpareThreads
));
propertyMapper
.
from
(()
->
determineMaxHttpHeaderSize
(
serverProperties
,
tomcatProperties
))
.
to
((
minSpareThreads
)
->
customizeMinThreads
(
factory
,
minSpareThreads
));
propertyMapper
.
from
(()
->
determineMaxHttpHeaderSize
(
serverProperties
,
tomcatProperties
))
.
when
(
TomcatCustomizer:
:
isPositive
)
.
to
(
maxHttpHeaderSize
->
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
.
to
((
maxHttpHeaderSize
)
->
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
propertyMapper
.
from
(
tomcatProperties:
:
getMaxHttpPostSize
)
.
when
(
maxHttpPostSize
->
maxHttpPostSize
!=
0
)
.
to
(
maxHttpPostSize
->
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
.
when
((
maxHttpPostSize
)
->
maxHttpPostSize
!=
0
)
.
to
((
maxHttpPostSize
)
->
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
propertyMapper
.
from
(
tomcatProperties:
:
getAccesslog
)
.
when
(
ServerProperties
.
Tomcat
.
Accesslog
::
isEnabled
)
.
to
(
enabled
->
customizeAccessLog
(
tomcatProperties
,
factory
));
.
to
(
(
enabled
)
->
customizeAccessLog
(
tomcatProperties
,
factory
));
propertyMapper
.
from
(
tomcatProperties:
:
getUriEncoding
).
whenNonNull
()
.
to
(
factory:
:
setUriEncoding
);
propertyMapper
.
from
(
serverProperties:
:
getConnectionTimeout
).
whenNonNull
()
.
to
(
connectionTimeout
->
customizeConnectionTimeout
(
factory
,
connectionTimeout
));
.
to
((
connectionTimeout
)
->
customizeConnectionTimeout
(
factory
,
connectionTimeout
));
propertyMapper
.
from
(
tomcatProperties:
:
getMaxConnections
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
to
(
maxConnections
->
customizeMaxConnections
(
factory
,
maxConnections
));
.
to
(
(
maxConnections
)
->
customizeMaxConnections
(
factory
,
maxConnections
));
propertyMapper
.
from
(
tomcatProperties:
:
getAcceptCount
)
.
when
(
TomcatCustomizer:
:
isPositive
)
.
to
(
acceptCount
->
customizeAcceptCount
(
factory
,
acceptCount
));
.
to
(
(
acceptCount
)
->
customizeAcceptCount
(
factory
,
acceptCount
));
customizeStaticResources
(
serverProperties
.
getTomcat
().
getResource
(),
factory
);
}
...
...
@@ -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 {
.
to
(
factory:
:
setAccessLogSuffix
);
propertyMapper
.
from
(
accesslogProperties:
:
isRotate
)
.
to
(
factory:
:
setAccessLogRotate
);
propertyMapper
.
from
(()
->
getOrDeduceUseForwardHeaders
(
serverProperties
,
environment
)).
to
(
factory:
:
setUseForwardHeaders
);
propertyMapper
.
from
(()
->
getOrDeduceUseForwardHeaders
(
serverProperties
,
environment
))
.
to
(
factory:
:
setUseForwardHeaders
);
propertyMapper
.
from
(
serverProperties:
:
getMaxHttpHeaderSize
)
.
when
(
UndertowCustomizer:
:
isPositive
)
.
to
(
maxHttpHeaderSize
->
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
.
to
(
(
maxHttpHeaderSize
)
->
customizeMaxHttpHeaderSize
(
factory
,
maxHttpHeaderSize
));
propertyMapper
.
from
(
undertowProperties:
:
getMaxHttpPostSize
)
.
when
(
UndertowCustomizer:
:
isPositive
)
.
to
(
maxHttpPostSize
->
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
.
to
(
(
maxHttpPostSize
)
->
customizeMaxHttpPostSize
(
factory
,
maxHttpPostSize
));
propertyMapper
.
from
(
serverProperties:
:
getConnectionTimeout
)
.
to
(
connectionTimeout
->
c
ustomizeConnectionTimeout
(
factory
,
c
onnectionTimeout
));
factory
.
addDeploymentInfoCustomizers
(
deploymentInfo
->
deploymentInfo
.
to
(
(
connectionTimeout
)
->
customizeConnectionTimeout
(
factory
,
connectionTimeout
));
factory
.
addDeploymentInfoCustomizers
(
(
deploymentInfo
)
->
deploymentInfo
.
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
map
.
from
(
this
.
serverProperties
::
getSsl
).
to
(
factory:
:
setSsl
);
map
.
from
(
this
.
serverProperties
::
getCompression
).
to
(
factory:
:
setCompression
);
map
.
from
(
this
.
serverProperties
::
getHttp2
).
to
(
factory:
:
setHttp2
);
map
.
from
(()
->
factory
).
whenInstanceOf
(
TomcatReactiveWebServerFactory
.
class
)
.
to
(
tomcatFactory
->
TomcatCustomizer
.
customizeTomcat
(
this
.
serverProperties
,
this
.
environment
,
tomcatFactory
));
map
.
from
(()
->
factory
).
whenInstanceOf
(
JettyReactiveWebServerFactory
.
class
)
.
to
(
jettyFactory
->
JettyCustomizer
.
customizeJetty
(
this
.
serverProperties
,
map
.
from
(()
->
factory
).
whenInstanceOf
(
TomcatReactiveWebServerFactory
.
class
)
.
to
(
(
tomcatFactory
)
->
TomcatCustomizer
.
customizeTomcat
(
this
.
serverProperties
,
this
.
environment
,
tomcatFactory
));
map
.
from
(()
->
factory
).
whenInstanceOf
(
JettyReactiveWebServerFactory
.
class
)
.
to
(
(
jettyFactory
)
->
JettyCustomizer
.
customizeJetty
(
this
.
serverProperties
,
this
.
environment
,
jettyFactory
));
map
.
from
(()
->
factory
).
whenInstanceOf
(
UndertowReactiveWebServerFactory
.
class
)
.
to
(
undertowFactory
->
UndertowCustomizer
.
customizeUndertow
(
.
to
(
(
undertowFactory
)
->
UndertowCustomizer
.
customizeUndertow
(
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
map
.
from
(
this
.
serverProperties
::
getHttp2
).
to
(
factory:
:
setHttp2
);
map
.
from
(
this
.
serverProperties
::
getServerHeader
).
to
(
factory:
:
setServerHeader
);
map
.
from
(()
->
factory
).
whenInstanceOf
(
TomcatServletWebServerFactory
.
class
)
.
to
(
tomcatFactory
->
{
.
to
(
(
tomcatFactory
)
->
{
TomcatCustomizer
.
customizeTomcat
(
this
.
serverProperties
,
this
.
environment
,
tomcatFactory
);
TomcatServletCustomizer
.
customizeTomcat
(
this
.
serverProperties
,
this
.
environment
,
tomcatFactory
);
});
map
.
from
(()
->
factory
).
whenInstanceOf
(
JettyServletWebServerFactory
.
class
)
.
to
(
jettyFactory
->
JettyCustomizer
.
customizeJetty
(
this
.
serverProperties
,
map
.
from
(()
->
factory
).
whenInstanceOf
(
JettyServletWebServerFactory
.
class
)
.
to
(
(
jettyFactory
)
->
JettyCustomizer
.
customizeJetty
(
this
.
serverProperties
,
this
.
environment
,
jettyFactory
));
map
.
from
(()
->
factory
).
whenInstanceOf
(
UndertowServletWebServerFactory
.
class
)
.
to
(
undertowFactory
->
UndertowCustomizer
.
customizeUndertow
(
.
to
(
(
undertowFactory
)
->
UndertowCustomizer
.
customizeUndertow
(
this
.
serverProperties
,
this
.
environment
,
undertowFactory
));
map
.
from
(
this
.
serverProperties
.
getServlet
()::
getContextParameters
)
.
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 {
@Test
public
void
testDefaultRepositoryConfiguration
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
).
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
CityRepository
.
class
);
assertThat
(
context
).
hasSingleBean
(
Cluster
.
class
);
assertThat
(
getInitialEntitySet
(
context
)).
hasSize
(
1
);
});
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
CityRepository
.
class
);
assertThat
(
context
).
hasSingleBean
(
Cluster
.
class
);
assertThat
(
getInitialEntitySet
(
context
)).
hasSize
(
1
);
});
}
@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 {
@Test
public
void
testDefaultRepositoryConfiguration
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
).
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
ReactiveCityRepository
.
class
);
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
MongoMappingContext
mappingContext
=
context
.
getBean
(
MongoMappingContext
.
class
);
@SuppressWarnings
(
"unchecked"
)
Set
<?
extends
Class
<?>>
entities
=
(
Set
<?
extends
Class
<?>>)
ReflectionTestUtils
.
getField
(
mappingContext
,
"initialEntitySet"
);
assertThat
(
entities
).
hasSize
(
1
);
});
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
ReactiveCityRepository
.
class
);
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
MongoMappingContext
mappingContext
=
context
.
getBean
(
MongoMappingContext
.
class
);
@SuppressWarnings
(
"unchecked"
)
Set
<?
extends
Class
<?>>
entities
=
(
Set
<?
extends
Class
<?>>)
ReflectionTestUtils
.
getField
(
mappingContext
,
"initialEntitySet"
);
assertThat
(
entities
).
hasSize
(
1
);
});
}
@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 {
@Test
public
void
testDefaultRepositoryConfiguration
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
).
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
CityRepository
.
class
);
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
MongoMappingContext
mappingContext
=
context
.
getBean
(
MongoMappingContext
.
class
);
@SuppressWarnings
(
"unchecked"
)
Set
<?
extends
Class
<?>>
entities
=
(
Set
<?
extends
Class
<?>>)
ReflectionTestUtils
.
getField
(
mappingContext
,
"initialEntitySet"
);
assertThat
(
entities
).
hasSize
(
1
);
});
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
CityRepository
.
class
);
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
MongoMappingContext
mappingContext
=
context
.
getBean
(
MongoMappingContext
.
class
);
@SuppressWarnings
(
"unchecked"
)
Set
<?
extends
Class
<?>>
entities
=
(
Set
<?
extends
Class
<?>>)
ReflectionTestUtils
.
getField
(
mappingContext
,
"initialEntitySet"
);
assertThat
(
entities
).
hasSize
(
1
);
});
}
@Test
...
...
@@ -80,8 +81,9 @@ public class MongoRepositoriesAutoConfigurationTests {
@Test
public
void
autoConfigurationShouldNotKickInEvenIfManualConfigDidNotCreateAnyRepositories
()
{
this
.
contextRunner
.
withUserConfiguration
(
SortOfInvalidCustomConfiguration
.
class
).
run
(
(
context
)
->
assertThat
(
context
).
doesNotHaveBean
(
CityRepository
.
class
));
this
.
contextRunner
.
withUserConfiguration
(
SortOfInvalidCustomConfiguration
.
class
)
.
run
((
context
)
->
assertThat
(
context
)
.
doesNotHaveBean
(
CityRepository
.
class
));
}
@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 {
this
.
contextRunner
.
withUserConfiguration
(
TestConfigWithClientRegistrationRepository
.
class
,
AuthenticationManagerConfiguration
.
class
)
.
run
(((
context
)
->
assertThat
(
context
).
doesNotHaveBean
(
InMemoryUserDetailsManager
.
class
)));
.
run
(((
context
)
->
assertThat
(
context
)
.
doesNotHaveBean
(
InMemoryUserDetailsManager
.
class
)));
}
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 {
return
report
;
}
properties
.
forEach
((
name
,
candidates
)
->
{
PropertySource
<?>
propertySource
=
mapPropertiesWithReplacement
(
report
,
name
,
candidates
);
PropertySource
<?>
propertySource
=
mapPropertiesWithReplacement
(
report
,
name
,
candidates
);
if
(
propertySource
!=
null
)
{
this
.
environment
.
getPropertySources
().
addBefore
(
name
,
propertySource
);
}
...
...
@@ -84,8 +84,8 @@ class PropertiesMigrationReporter {
List
<
PropertyMigration
>
properties
)
{
List
<
PropertyMigration
>
renamed
=
new
ArrayList
<>();
List
<
PropertyMigration
>
unsupported
=
new
ArrayList
<>();
properties
.
forEach
((
property
)
->
(
isRenamed
(
property
)
?
renamed
:
unsupported
)
.
add
(
property
));
properties
.
forEach
((
property
)
->
(
isRenamed
(
property
)
?
renamed
:
unsupported
)
.
add
(
property
));
report
.
add
(
name
,
renamed
,
unsupported
);
if
(
renamed
.
isEmpty
())
{
return
null
;
...
...
@@ -133,7 +133,7 @@ class PropertiesMigrationReporter {
List
<
ConfigurationMetadataProperty
>
candidates
=
this
.
allProperties
.
values
()
.
stream
().
filter
(
filter
).
collect
(
Collectors
.
toList
());
getPropertySourcesAsMap
().
forEach
((
name
,
source
)
->
{
candidates
.
forEach
(
metadata
->
{
candidates
.
forEach
(
(
metadata
)
->
{
ConfigurationProperty
configurationProperty
=
source
.
getConfigurationProperty
(
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 {
@Test
public
void
annotatedGetter
()
{
ConfigurationMetadata
metadata
=
compile
(
AnnotatedGetter
.
class
);
assertThat
(
metadata
)
.
has
(
Metadata
.
withGroup
(
"specific"
)
.
fromSource
(
AnnotatedGetter
.
class
));
assertThat
(
metadata
)
.
has
(
Metadata
.
withGroup
(
"specific"
).
fromSource
(
AnnotatedGetter
.
class
));
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"specific.name"
,
String
.
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");
* 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
private
void
appendReason
(
StringBuilder
message
,
InvalidConfigurationPropertyValueException
cause
)
{
if
(
StringUtils
.
hasText
(
cause
.
getReason
()))
{
message
.
append
(
String
.
format
(
" Validation failed for the following "
+
"reason:%n%n"
));
message
.
append
(
String
.
format
(
" Validation failed for the following "
+
"reason:%n%n"
));
message
.
append
(
cause
.
getReason
());
}
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 {
InvalidConfigurationPropertyValueException
failure
=
new
InvalidConfigurationPropertyValueException
(
"test.property"
,
"invalid"
,
null
);
FailureAnalysis
analysis
=
performAnalysis
(
failure
);
assertThat
(
analysis
.
getAction
())
.
contains
(
"Review the value of the property."
);
assertThat
(
analysis
.
getAction
()).
contains
(
"Review the value of the property."
);
assertThat
(
analysis
.
getDescription
()).
contains
(
"No reason was provided."
)
.
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");
* you may not use this file except in compliance with the License.
...
...
@@ -74,7 +74,7 @@ public abstract class AbstractDataSourcePoolMetadataTests<D extends AbstractData
final
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
(
getDataSourceMetadata
().
getDataSource
());
jdbcTemplate
.
execute
((
ConnectionCallback
<
Void
>)
(
connection
)
->
{
jdbcTemplate
.
execute
((
ConnectionCallback
<
Void
>)
connection1
->
{
jdbcTemplate
.
execute
((
ConnectionCallback
<
Void
>)
(
connection1
)
->
{
assertThat
(
getDataSourceMetadata
().
getActive
()).
isEqualTo
(
2
);
assertThat
(
getDataSourceMetadata
().
getUsage
()).
isEqualTo
(
1.0f
);
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 {
protected
ReactorClientHttpConnector
buildTrustAllSslConnector
()
{
return
new
ReactorClientHttpConnector
(
(
options
)
->
options
.
sslSupport
(
sslContextBuilder
->
{
(
options
)
->
options
.
sslSupport
(
(
sslContextBuilder
)
->
{
sslContextBuilder
.
sslProvider
(
SslProvider
.
JDK
)
.
trustManager
(
InsecureTrustManagerFactory
.
INSTANCE
);
}));
...
...
@@ -180,7 +180,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
.
getInstance
(
KeyManagerFactory
.
getDefaultAlgorithm
());
clientKeyManagerFactory
.
init
(
clientKeyStore
,
"password"
.
toCharArray
());
return
new
ReactorClientHttpConnector
(
(
options
)
->
options
.
sslSupport
(
sslContextBuilder
->
{
(
options
)
->
options
.
sslSupport
(
(
sslContextBuilder
)
->
{
sslContextBuilder
.
sslProvider
(
SslProvider
.
JDK
)
.
trustManager
(
InsecureTrustManagerFactory
.
INSTANCE
)
.
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");
* you may not use this file except in compliance with the License.
...
...
@@ -38,7 +38,8 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@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
{
@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");
* you may not use this file except in compliance with the License.
...
...
@@ -97,8 +97,7 @@ class ApplicationBuilder {
return
resourcesJar
;
}
private
void
writePom
(
File
appFolder
,
File
resourcesJar
)
throws
IOException
{
private
void
writePom
(
File
appFolder
,
File
resourcesJar
)
throws
IOException
{
Map
<
String
,
Object
>
context
=
new
HashMap
<>();
context
.
put
(
"packaging"
,
this
.
packaging
);
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