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
2f77ef77
Commit
2f77ef77
authored
Jan 12, 2019
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.1.x'
parents
631a0fe2
72400d3a
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
120 additions
and
129 deletions
+120
-129
ReactiveManagementWebSecurityAutoConfiguration.java
...ctive/ReactiveManagementWebSecurityAutoConfiguration.java
+1
-1
ManagementWebSecurityAutoConfiguration.java
...urity/servlet/ManagementWebSecurityAutoConfiguration.java
+1
-1
AtlasMetricsExportAutoConfigurationTests.java
...xport/atlas/AtlasMetricsExportAutoConfigurationTests.java
+2
-2
AtlasPropertiesTests.java
...oconfigure/metrics/export/atlas/AtlasPropertiesTests.java
+2
-2
DatadogMetricsExportAutoConfigurationTests.java
...t/datadog/DatadogMetricsExportAutoConfigurationTests.java
+3
-3
DynatraceMetricsExportAutoConfigurationTests.java
...natrace/DynatraceMetricsExportAutoConfigurationTests.java
+5
-5
ElasticMetricsExportAutoConfigurationTests.java
...t/elastic/ElasticMetricsExportAutoConfigurationTests.java
+2
-2
GangliaMetricsExportAutoConfigurationTests.java
...t/ganglia/GangliaMetricsExportAutoConfigurationTests.java
+2
-2
GraphiteMetricsExportAutoConfigurationTests.java
...graphite/GraphiteMetricsExportAutoConfigurationTests.java
+3
-3
HumioMetricsExportAutoConfigurationTests.java
...xport/humio/HumioMetricsExportAutoConfigurationTests.java
+2
-2
InfluxMetricsExportAutoConfigurationTests.java
...ort/influx/InfluxMetricsExportAutoConfigurationTests.java
+2
-2
NewRelicMetricsExportAutoConfigurationTests.java
...newrelic/NewRelicMetricsExportAutoConfigurationTests.java
+4
-4
PrometheusMetricsExportAutoConfigurationTests.java
...etheus/PrometheusMetricsExportAutoConfigurationTests.java
+2
-2
SignalFxMetricsExportAutoConfigurationTests.java
...signalfx/SignalFxMetricsExportAutoConfigurationTests.java
+3
-3
SimpleMetricsExportAutoConfigurationTests.java
...ort/simple/SimpleMetricsExportAutoConfigurationTests.java
+2
-2
ReactiveManagementWebSecurityAutoConfigurationTests.java
.../ReactiveManagementWebSecurityAutoConfigurationTests.java
+1
-1
ManagementWebSecurityAutoConfigurationTests.java
.../servlet/ManagementWebSecurityAutoConfigurationTests.java
+1
-1
ElasticsearchRestHealthIndicator.java
...tuate/elasticsearch/ElasticsearchRestHealthIndicator.java
+1
-2
ElasticsearchRestHealthIndicatorTest.java
...e/elasticsearch/ElasticsearchRestHealthIndicatorTest.java
+24
-41
NettyWebServerFactoryCustomizer.java
...nfigure/web/embedded/NettyWebServerFactoryCustomizer.java
+5
-8
pom.xml
spring-boot-project/spring-boot-dependencies/pom.xml
+1
-1
CollectionBinder.java
...mework/boot/context/properties/bind/CollectionBinder.java
+1
-1
ValidationBindHandler.java
...ext/properties/bind/validation/ValidationBindHandler.java
+14
-16
CompressionConnectorCustomizer.java
...t/web/embedded/tomcat/CompressionConnectorCustomizer.java
+21
-14
CollectionBinderTests.java
...k/boot/context/properties/bind/CollectionBinderTests.java
+1
-1
ValidationBindHandlerTests.java
...roperties/bind/validation/ValidationBindHandlerTests.java
+1
-1
RestTemplateBuilderTests.java
...ngframework/boot/web/client/RestTemplateBuilderTests.java
+3
-3
JettyServletWebServerFactoryTests.java
...web/embedded/jetty/JettyServletWebServerFactoryTests.java
+3
-3
checkstyle.xml
src/checkstyle/checkstyle.xml
+7
-0
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/ReactiveManagementWebSecurityAutoConfiguration.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfiguration.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -107,7 +107,7 @@ public class AtlasMetricsExportAutoConfigurationTests {
...
@@ -107,7 +107,7 @@ public class AtlasMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
AtlasConfig
customConfig
()
{
public
AtlasConfig
customConfig
()
{
return
(
k
)
->
null
;
return
(
k
ey
)
->
null
;
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasPropertiesTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -31,7 +31,7 @@ public class AtlasPropertiesTests {
...
@@ -31,7 +31,7 @@ public class AtlasPropertiesTests {
@Test
@Test
public
void
defaultValuesAreConsistent
()
{
public
void
defaultValuesAreConsistent
()
{
AtlasProperties
properties
=
new
AtlasProperties
();
AtlasProperties
properties
=
new
AtlasProperties
();
AtlasConfig
config
=
(
k
)
->
null
;
AtlasConfig
config
=
(
k
ey
)
->
null
;
assertThat
(
properties
.
getStep
()).
isEqualTo
(
config
.
step
());
assertThat
(
properties
.
getStep
()).
isEqualTo
(
config
.
step
());
assertThat
(
properties
.
isEnabled
()).
isEqualTo
(
config
.
enabled
());
assertThat
(
properties
.
isEnabled
()).
isEqualTo
(
config
.
enabled
());
assertThat
(
properties
.
getConnectTimeout
()).
isEqualTo
(
config
.
connectTimeout
());
assertThat
(
properties
.
getConnectTimeout
()).
isEqualTo
(
config
.
connectTimeout
());
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -116,8 +116,8 @@ public class DatadogMetricsExportAutoConfigurationTests {
...
@@ -116,8 +116,8 @@ public class DatadogMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
DatadogConfig
customConfig
()
{
public
DatadogConfig
customConfig
()
{
return
(
k
)
->
{
return
(
k
ey
)
->
{
if
(
"datadog.apiKey"
.
equals
(
k
))
{
if
(
"datadog.apiKey"
.
equals
(
k
ey
))
{
return
"12345"
;
return
"12345"
;
}
}
return
null
;
return
null
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -125,14 +125,14 @@ public class DynatraceMetricsExportAutoConfigurationTests {
...
@@ -125,14 +125,14 @@ public class DynatraceMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
DynatraceConfig
customConfig
()
{
public
DynatraceConfig
customConfig
()
{
return
(
k
)
->
{
return
(
k
ey
)
->
{
if
(
"dynatrace.uri"
.
equals
(
k
))
{
if
(
"dynatrace.uri"
.
equals
(
k
ey
))
{
return
"https://dynatrace.example.com"
;
return
"https://dynatrace.example.com"
;
}
}
if
(
"dynatrace.apiToken"
.
equals
(
k
))
{
if
(
"dynatrace.apiToken"
.
equals
(
k
ey
))
{
return
"abcde"
;
return
"abcde"
;
}
}
if
(
"dynatrace.deviceId"
.
equals
(
k
))
{
if
(
"dynatrace.deviceId"
.
equals
(
k
ey
))
{
return
"test"
;
return
"test"
;
}
}
return
null
;
return
null
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -108,7 +108,7 @@ public class ElasticMetricsExportAutoConfigurationTests {
...
@@ -108,7 +108,7 @@ public class ElasticMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
ElasticConfig
customConfig
()
{
public
ElasticConfig
customConfig
()
{
return
(
k
)
->
null
;
return
(
k
ey
)
->
null
;
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -107,7 +107,7 @@ public class GangliaMetricsExportAutoConfigurationTests {
...
@@ -107,7 +107,7 @@ public class GangliaMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
GangliaConfig
customConfig
()
{
public
GangliaConfig
customConfig
()
{
return
(
k
)
->
null
;
return
(
k
ey
)
->
null
;
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/graphite/GraphiteMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -124,8 +124,8 @@ public class GraphiteMetricsExportAutoConfigurationTests {
...
@@ -124,8 +124,8 @@ public class GraphiteMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
GraphiteConfig
customConfig
()
{
public
GraphiteConfig
customConfig
()
{
return
(
k
)
->
{
return
(
k
ey
)
->
{
if
(
"Graphite.apiKey"
.
equals
(
k
))
{
if
(
"Graphite.apiKey"
.
equals
(
k
ey
))
{
return
"12345"
;
return
"12345"
;
}
}
return
null
;
return
null
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/humio/HumioMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -109,7 +109,7 @@ public class HumioMetricsExportAutoConfigurationTests {
...
@@ -109,7 +109,7 @@ public class HumioMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
HumioConfig
customConfig
()
{
public
HumioConfig
customConfig
()
{
return
(
k
)
->
null
;
return
(
k
ey
)
->
null
;
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -107,7 +107,7 @@ public class InfluxMetricsExportAutoConfigurationTests {
...
@@ -107,7 +107,7 @@ public class InfluxMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
InfluxConfig
customConfig
()
{
public
InfluxConfig
customConfig
()
{
return
(
k
)
->
null
;
return
(
k
ey
)
->
null
;
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -129,11 +129,11 @@ public class NewRelicMetricsExportAutoConfigurationTests {
...
@@ -129,11 +129,11 @@ public class NewRelicMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
NewRelicConfig
customConfig
()
{
public
NewRelicConfig
customConfig
()
{
return
(
k
)
->
{
return
(
k
ey
)
->
{
if
(
"newrelic.accountId"
.
equals
(
k
))
{
if
(
"newrelic.accountId"
.
equals
(
k
ey
))
{
return
"abcde"
;
return
"abcde"
;
}
}
if
(
"newrelic.apiKey"
.
equals
(
k
))
{
if
(
"newrelic.apiKey"
.
equals
(
k
ey
))
{
return
"12345"
;
return
"12345"
;
}
}
return
null
;
return
null
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -157,7 +157,7 @@ public class PrometheusMetricsExportAutoConfigurationTests {
...
@@ -157,7 +157,7 @@ public class PrometheusMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
PrometheusConfig
customConfig
()
{
public
PrometheusConfig
customConfig
()
{
return
(
k
)
->
null
;
return
(
k
ey
)
->
null
;
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -124,8 +124,8 @@ public class SignalFxMetricsExportAutoConfigurationTests {
...
@@ -124,8 +124,8 @@ public class SignalFxMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
SignalFxConfig
customConfig
()
{
public
SignalFxConfig
customConfig
()
{
return
(
k
)
->
{
return
(
k
ey
)
->
{
if
(
"signalfx.accessToken"
.
equals
(
k
))
{
if
(
"signalfx.accessToken"
.
equals
(
k
ey
))
{
return
"abcde"
;
return
"abcde"
;
}
}
return
null
;
return
null
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleMetricsExportAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -90,7 +90,7 @@ public class SimpleMetricsExportAutoConfigurationTests {
...
@@ -90,7 +90,7 @@ public class SimpleMetricsExportAutoConfigurationTests {
@Bean
@Bean
public
SimpleConfig
customConfig
()
{
public
SimpleConfig
customConfig
()
{
return
(
k
)
->
null
;
return
(
k
ey
)
->
null
;
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/ReactiveManagementWebSecurityAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchRestHealthIndicator.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -81,7 +81,6 @@ public class ElasticsearchRestHealthIndicator extends AbstractHealthIndicator {
...
@@ -81,7 +81,6 @@ public class ElasticsearchRestHealthIndicator extends AbstractHealthIndicator {
else
{
else
{
builder
.
up
();
builder
.
up
();
}
}
builder
.
withDetails
(
response
);
builder
.
withDetails
(
response
);
}
}
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchRestHealthIndicatorTest.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -33,8 +33,8 @@ import org.springframework.boot.actuate.health.Status;
...
@@ -33,8 +33,8 @@ import org.springframework.boot.actuate.health.Status;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
entry
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
entry
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
mock
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
BDDMockito
.
when
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
/**
* Tests for {@link ElasticsearchRestHealthIndicator}.
* Tests for {@link ElasticsearchRestHealthIndicator}.
...
@@ -54,15 +54,12 @@ public class ElasticsearchRestHealthIndicatorTest {
...
@@ -54,15 +54,12 @@ public class ElasticsearchRestHealthIndicatorTest {
BasicHttpEntity
httpEntity
=
new
BasicHttpEntity
();
BasicHttpEntity
httpEntity
=
new
BasicHttpEntity
();
httpEntity
.
setContent
(
httpEntity
.
setContent
(
new
ByteArrayInputStream
(
createJsonResult
(
200
,
"green"
).
getBytes
()));
new
ByteArrayInputStream
(
createJsonResult
(
200
,
"green"
).
getBytes
()));
Response
response
=
mock
(
Response
.
class
);
Response
response
=
mock
(
Response
.
class
);
StatusLine
statusLine
=
mock
(
StatusLine
.
class
);
StatusLine
statusLine
=
mock
(
StatusLine
.
class
);
given
(
statusLine
.
getStatusCode
()).
willReturn
(
200
);
when
(
statusLine
.
getStatusCode
()).
thenReturn
(
200
);
given
(
response
.
getStatusLine
()).
willReturn
(
statusLine
);
when
(
response
.
getStatusLine
()).
thenReturn
(
statusLine
);
given
(
response
.
getEntity
()).
willReturn
(
httpEntity
);
when
(
response
.
getEntity
()).
thenReturn
(
httpEntity
);
given
(
this
.
restClient
.
performRequest
(
any
(
Request
.
class
))).
willReturn
(
response
);
when
(
this
.
restClient
.
performRequest
(
any
(
Request
.
class
))).
thenReturn
(
response
);
Health
health
=
this
.
elasticsearchRestHealthIndicator
.
health
();
Health
health
=
this
.
elasticsearchRestHealthIndicator
.
health
();
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
UP
);
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
UP
);
assertHealthDetailsWithStatus
(
health
.
getDetails
(),
"green"
);
assertHealthDetailsWithStatus
(
health
.
getDetails
(),
"green"
);
...
@@ -73,15 +70,12 @@ public class ElasticsearchRestHealthIndicatorTest {
...
@@ -73,15 +70,12 @@ public class ElasticsearchRestHealthIndicatorTest {
BasicHttpEntity
httpEntity
=
new
BasicHttpEntity
();
BasicHttpEntity
httpEntity
=
new
BasicHttpEntity
();
httpEntity
.
setContent
(
httpEntity
.
setContent
(
new
ByteArrayInputStream
(
createJsonResult
(
200
,
"yellow"
).
getBytes
()));
new
ByteArrayInputStream
(
createJsonResult
(
200
,
"yellow"
).
getBytes
()));
Response
response
=
mock
(
Response
.
class
);
Response
response
=
mock
(
Response
.
class
);
StatusLine
statusLine
=
mock
(
StatusLine
.
class
);
StatusLine
statusLine
=
mock
(
StatusLine
.
class
);
given
(
statusLine
.
getStatusCode
()).
willReturn
(
200
);
when
(
statusLine
.
getStatusCode
()).
thenReturn
(
200
);
given
(
response
.
getStatusLine
()).
willReturn
(
statusLine
);
when
(
response
.
getStatusLine
()).
thenReturn
(
statusLine
);
given
(
response
.
getEntity
()).
willReturn
(
httpEntity
);
when
(
response
.
getEntity
()).
thenReturn
(
httpEntity
);
given
(
this
.
restClient
.
performRequest
(
any
(
Request
.
class
))).
willReturn
(
response
);
when
(
this
.
restClient
.
performRequest
(
any
(
Request
.
class
))).
thenReturn
(
response
);
Health
health
=
this
.
elasticsearchRestHealthIndicator
.
health
();
Health
health
=
this
.
elasticsearchRestHealthIndicator
.
health
();
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
UP
);
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
UP
);
assertHealthDetailsWithStatus
(
health
.
getDetails
(),
"yellow"
);
assertHealthDetailsWithStatus
(
health
.
getDetails
(),
"yellow"
);
...
@@ -89,9 +83,8 @@ public class ElasticsearchRestHealthIndicatorTest {
...
@@ -89,9 +83,8 @@ public class ElasticsearchRestHealthIndicatorTest {
@Test
@Test
public
void
elasticsearchIsDown
()
throws
IOException
{
public
void
elasticsearchIsDown
()
throws
IOException
{
when
(
this
.
restClient
.
performRequest
(
any
(
Request
.
class
)))
given
(
this
.
restClient
.
performRequest
(
any
(
Request
.
class
)))
.
thenThrow
(
new
IOException
(
"Couldn't connect"
));
.
willThrow
(
new
IOException
(
"Couldn't connect"
));
Health
health
=
this
.
elasticsearchRestHealthIndicator
.
health
();
Health
health
=
this
.
elasticsearchRestHealthIndicator
.
health
();
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
DOWN
);
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
DOWN
);
assertThat
(
health
.
getDetails
())
assertThat
(
health
.
getDetails
())
...
@@ -102,12 +95,10 @@ public class ElasticsearchRestHealthIndicatorTest {
...
@@ -102,12 +95,10 @@ public class ElasticsearchRestHealthIndicatorTest {
public
void
elasticsearchIsDownByResponseCode
()
throws
IOException
{
public
void
elasticsearchIsDownByResponseCode
()
throws
IOException
{
Response
response
=
mock
(
Response
.
class
);
Response
response
=
mock
(
Response
.
class
);
StatusLine
statusLine
=
mock
(
StatusLine
.
class
);
StatusLine
statusLine
=
mock
(
StatusLine
.
class
);
given
(
statusLine
.
getStatusCode
()).
willReturn
(
500
);
when
(
statusLine
.
getStatusCode
()).
thenReturn
(
500
);
given
(
statusLine
.
getReasonPhrase
()).
willReturn
(
"Internal server error"
);
when
(
statusLine
.
getReasonPhrase
()).
thenReturn
(
"Internal server error"
);
given
(
response
.
getStatusLine
()).
willReturn
(
statusLine
);
when
(
response
.
getStatusLine
()).
thenReturn
(
statusLine
);
given
(
this
.
restClient
.
performRequest
(
any
(
Request
.
class
))).
willReturn
(
response
);
when
(
this
.
restClient
.
performRequest
(
any
(
Request
.
class
))).
thenReturn
(
response
);
Health
health
=
this
.
elasticsearchRestHealthIndicator
.
health
();
Health
health
=
this
.
elasticsearchRestHealthIndicator
.
health
();
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
DOWN
);
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
DOWN
);
assertThat
(
health
.
getDetails
()).
contains
(
entry
(
"statusCode"
,
500
),
assertThat
(
health
.
getDetails
()).
contains
(
entry
(
"statusCode"
,
500
),
...
@@ -119,15 +110,12 @@ public class ElasticsearchRestHealthIndicatorTest {
...
@@ -119,15 +110,12 @@ public class ElasticsearchRestHealthIndicatorTest {
BasicHttpEntity
httpEntity
=
new
BasicHttpEntity
();
BasicHttpEntity
httpEntity
=
new
BasicHttpEntity
();
httpEntity
.
setContent
(
httpEntity
.
setContent
(
new
ByteArrayInputStream
(
createJsonResult
(
200
,
"red"
).
getBytes
()));
new
ByteArrayInputStream
(
createJsonResult
(
200
,
"red"
).
getBytes
()));
Response
response
=
mock
(
Response
.
class
);
Response
response
=
mock
(
Response
.
class
);
StatusLine
statusLine
=
mock
(
StatusLine
.
class
);
StatusLine
statusLine
=
mock
(
StatusLine
.
class
);
given
(
statusLine
.
getStatusCode
()).
willReturn
(
200
);
when
(
statusLine
.
getStatusCode
()).
thenReturn
(
200
);
given
(
response
.
getStatusLine
()).
willReturn
(
statusLine
);
when
(
response
.
getStatusLine
()).
thenReturn
(
statusLine
);
given
(
response
.
getEntity
()).
willReturn
(
httpEntity
);
when
(
response
.
getEntity
()).
thenReturn
(
httpEntity
);
given
(
this
.
restClient
.
performRequest
(
any
(
Request
.
class
))).
willReturn
(
response
);
when
(
this
.
restClient
.
performRequest
(
any
(
Request
.
class
))).
thenReturn
(
response
);
Health
health
=
this
.
elasticsearchRestHealthIndicator
.
health
();
Health
health
=
this
.
elasticsearchRestHealthIndicator
.
health
();
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
OUT_OF_SERVICE
);
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
OUT_OF_SERVICE
);
assertHealthDetailsWithStatus
(
health
.
getDetails
(),
"red"
);
assertHealthDetailsWithStatus
(
health
.
getDetails
(),
"red"
);
...
@@ -148,9 +136,8 @@ public class ElasticsearchRestHealthIndicatorTest {
...
@@ -148,9 +136,8 @@ public class ElasticsearchRestHealthIndicatorTest {
}
}
private
String
createJsonResult
(
int
responseCode
,
String
status
)
{
private
String
createJsonResult
(
int
responseCode
,
String
status
)
{
String
json
;
if
(
responseCode
==
200
)
{
if
(
responseCode
==
200
)
{
json
=
String
.
format
(
"{\"cluster_name\":\"elasticsearch\","
return
String
.
format
(
"{\"cluster_name\":\"elasticsearch\","
+
"\"status\":\"%s\",\"timed_out\":false,\"number_of_nodes\":1,"
+
"\"status\":\"%s\",\"timed_out\":false,\"number_of_nodes\":1,"
+
"\"number_of_data_nodes\":1,\"active_primary_shards\":0,"
+
"\"number_of_data_nodes\":1,\"active_primary_shards\":0,"
+
"\"active_shards\":0,\"relocating_shards\":0,\"initializing_shards\":0,"
+
"\"active_shards\":0,\"relocating_shards\":0,\"initializing_shards\":0,"
...
@@ -159,12 +146,8 @@ public class ElasticsearchRestHealthIndicatorTest {
...
@@ -159,12 +146,8 @@ public class ElasticsearchRestHealthIndicatorTest {
+
"\"task_max_waiting_in_queue_millis\":0,\"active_shards_percent_as_number\":100.0}"
,
+
"\"task_max_waiting_in_queue_millis\":0,\"active_shards_percent_as_number\":100.0}"
,
status
);
status
);
}
}
else
{
return
"{\n"
+
" \"error\": \"Server Error\",\n"
+
" \"status\": "
json
=
"{\n"
+
" \"error\": \"Server Error\",\n"
+
" \"status\": "
+
responseCode
+
"\n"
+
"}"
;
+
responseCode
+
"\n"
+
"}"
;
}
return
json
;
}
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizer.java
View file @
2f77ef77
...
@@ -66,9 +66,8 @@ public class NettyWebServerFactoryCustomizer
...
@@ -66,9 +66,8 @@ public class NettyWebServerFactoryCustomizer
.
to
((
maxHttpRequestHeaderSize
)
->
customizeMaxHttpHeaderSize
(
factory
,
.
to
((
maxHttpRequestHeaderSize
)
->
customizeMaxHttpHeaderSize
(
factory
,
maxHttpRequestHeaderSize
));
maxHttpRequestHeaderSize
));
propertyMapper
.
from
(
this
.
serverProperties
::
getConnectionTimeout
).
whenNonNull
()
propertyMapper
.
from
(
this
.
serverProperties
::
getConnectionTimeout
).
whenNonNull
()
.
asInt
(
Duration:
:
toMillis
)
.
asInt
(
Duration:
:
toMillis
).
to
((
duration
)
->
factory
.
to
((
duration
)
->
customizeConnectionTimeOut
(
factory
,
duration
));
.
addServerCustomizers
(
getConnectionTimeOutCustomizer
(
duration
)));
}
}
private
boolean
getOrDeduceUseForwardHeaders
(
ServerProperties
serverProperties
,
private
boolean
getOrDeduceUseForwardHeaders
(
ServerProperties
serverProperties
,
...
@@ -87,11 +86,9 @@ public class NettyWebServerFactoryCustomizer
...
@@ -87,11 +86,9 @@ public class NettyWebServerFactoryCustomizer
.
maxHeaderSize
(
maxHttpHeaderSize
)));
.
maxHeaderSize
(
maxHttpHeaderSize
)));
}
}
private
void
customizeConnectionTimeOut
(
NettyReactiveWebServerFactory
factory
,
private
NettyServerCustomizer
getConnectionTimeOutCustomizer
(
int
duration
)
{
int
duration
)
{
return
(
httpServer
)
->
httpServer
.
tcpConfiguration
((
tcpServer
)
->
tcpServer
factory
.
addServerCustomizers
((
NettyServerCustomizer
)
(
httpServer
)
->
httpServer
.
selectorOption
(
ChannelOption
.
CONNECT_TIMEOUT_MILLIS
,
duration
));
.
tcpConfiguration
((
tcpServer
)
->
tcpServer
.
selectorOption
(
ChannelOption
.
CONNECT_TIMEOUT_MILLIS
,
duration
)));
}
}
}
}
spring-boot-project/spring-boot-dependencies/pom.xml
View file @
2f77ef77
...
@@ -164,7 +164,7 @@
...
@@ -164,7 +164,7 @@
<!-- deprecated in favor of "spring-framework.version" -->
<!-- deprecated in favor of "spring-framework.version" -->
<spring.version>
5.1.4.RELEASE
</spring.version>
<spring.version>
5.1.4.RELEASE
</spring.version>
<spring-amqp.version>
2.1.3.RELEASE
</spring-amqp.version>
<spring-amqp.version>
2.1.3.RELEASE
</spring-amqp.version>
<spring-batch.version>
4.1.
0
.RELEASE
</spring-batch.version>
<spring-batch.version>
4.1.
1
.RELEASE
</spring-batch.version>
<spring-cloud-connectors.version>
2.0.4.RELEASE
</spring-cloud-connectors.version>
<spring-cloud-connectors.version>
2.0.4.RELEASE
</spring-cloud-connectors.version>
<spring-data-releasetrain.version>
Lovelace-SR4
</spring-data-releasetrain.version>
<spring-data-releasetrain.version>
Lovelace-SR4
</spring-data-releasetrain.version>
<spring-framework.version>
${spring.version}
</spring-framework.version>
<spring-framework.version>
${spring.version}
</spring-framework.version>
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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/context/properties/bind/validation/ValidationBindHandler.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -70,9 +70,6 @@ public class ValidationBindHandler extends AbstractBindHandler {
...
@@ -70,9 +70,6 @@ public class ValidationBindHandler extends AbstractBindHandler {
public
void
onFinish
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
public
void
onFinish
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
BindContext
context
,
Object
result
)
throws
Exception
{
BindContext
context
,
Object
result
)
throws
Exception
{
validate
(
name
,
target
,
context
,
result
);
validate
(
name
,
target
,
context
,
result
);
if
(
context
.
getDepth
()
==
0
&&
!
this
.
exceptions
.
isEmpty
())
{
throw
this
.
exceptions
.
pop
();
}
super
.
onFinish
(
name
,
target
,
context
,
result
);
super
.
onFinish
(
name
,
target
,
context
,
result
);
}
}
...
@@ -81,9 +78,6 @@ public class ValidationBindHandler extends AbstractBindHandler {
...
@@ -81,9 +78,6 @@ public class ValidationBindHandler extends AbstractBindHandler {
BindContext
context
,
Exception
error
)
throws
Exception
{
BindContext
context
,
Exception
error
)
throws
Exception
{
Object
result
=
super
.
onFailure
(
name
,
target
,
context
,
error
);
Object
result
=
super
.
onFailure
(
name
,
target
,
context
,
error
);
validate
(
name
,
target
,
context
,
null
);
validate
(
name
,
target
,
context
,
null
);
if
(!
this
.
exceptions
.
isEmpty
())
{
throw
this
.
exceptions
.
pop
();
}
return
result
;
return
result
;
}
}
...
@@ -91,7 +85,12 @@ public class ValidationBindHandler extends AbstractBindHandler {
...
@@ -91,7 +85,12 @@ public class ValidationBindHandler extends AbstractBindHandler {
BindContext
context
,
Object
result
)
{
BindContext
context
,
Object
result
)
{
Object
validationTarget
=
getValidationTarget
(
target
,
context
,
result
);
Object
validationTarget
=
getValidationTarget
(
target
,
context
,
result
);
Class
<?>
validationType
=
target
.
getBoxedType
().
resolve
();
Class
<?>
validationType
=
target
.
getBoxedType
().
resolve
();
validate
(
name
,
validationTarget
,
validationType
);
if
(
validationTarget
!=
null
)
{
validateAndPush
(
name
,
validationTarget
,
validationType
);
}
if
(
context
.
getDepth
()
==
0
&&
!
this
.
exceptions
.
isEmpty
())
{
throw
this
.
exceptions
.
pop
();
}
}
}
private
Object
getValidationTarget
(
Bindable
<?>
target
,
BindContext
context
,
private
Object
getValidationTarget
(
Bindable
<?>
target
,
BindContext
context
,
...
@@ -105,14 +104,13 @@ public class ValidationBindHandler extends AbstractBindHandler {
...
@@ -105,14 +104,13 @@ public class ValidationBindHandler extends AbstractBindHandler {
return
null
;
return
null
;
}
}
private
void
validate
(
ConfigurationPropertyName
name
,
Object
target
,
Class
<?>
type
)
{
private
void
validateAndPush
(
ConfigurationPropertyName
name
,
Object
target
,
if
(
target
!=
null
)
{
Class
<?>
type
)
{
BindingResult
errors
=
new
BeanPropertyBindingResult
(
target
,
name
.
toString
());
BindingResult
errors
=
new
BeanPropertyBindingResult
(
target
,
name
.
toString
());
Arrays
.
stream
(
this
.
validators
).
filter
((
validator
)
->
validator
.
supports
(
type
))
Arrays
.
stream
(
this
.
validators
).
filter
((
validator
)
->
validator
.
supports
(
type
))
.
forEach
((
validator
)
->
validator
.
validate
(
target
,
errors
));
.
forEach
((
validator
)
->
validator
.
validate
(
target
,
errors
));
if
(
errors
.
hasErrors
())
{
if
(
errors
.
hasErrors
())
{
this
.
exceptions
.
push
(
getBindValidationException
(
name
,
errors
));
this
.
exceptions
.
push
(
getBindValidationException
(
name
,
errors
));
}
}
}
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/CompressionConnectorCustomizer.java
View file @
2f77ef77
...
@@ -54,30 +54,37 @@ class CompressionConnectorCustomizer implements TomcatConnectorCustomizer {
...
@@ -54,30 +54,37 @@ class CompressionConnectorCustomizer implements TomcatConnectorCustomizer {
}
}
}
}
private
void
customize
(
Http2Protocol
upgradeP
rotocol
)
{
private
void
customize
(
Http2Protocol
p
rotocol
)
{
Compression
compression
=
this
.
compression
;
Compression
compression
=
this
.
compression
;
upgradeProtocol
.
setCompression
(
"on"
);
protocol
.
setCompression
(
"on"
);
upgradeProtocol
protocol
.
setCompressionMinSize
(
getMinResponseSize
(
compression
));
.
setCompressionMinSize
((
int
)
compression
.
getMinResponseSize
().
toBytes
());
protocol
.
setCompressibleMimeType
(
getMimeTypes
(
compression
));
upgradeProtocol
.
setCompressibleMimeType
(
StringUtils
.
arrayToCommaDelimitedString
(
compression
.
getMimeTypes
()));
if
(
this
.
compression
.
getExcludedUserAgents
()
!=
null
)
{
if
(
this
.
compression
.
getExcludedUserAgents
()
!=
null
)
{
upgradeProtocol
protocol
.
setNoCompressionUserAgents
(
getExcludedUserAgents
());
.
setNoCompressionUserAgents
(
StringUtils
.
arrayToCommaDelimitedString
(
this
.
compression
.
getExcludedUserAgents
()));
}
}
}
}
private
void
customize
(
AbstractHttp11Protocol
<?>
protocol
)
{
private
void
customize
(
AbstractHttp11Protocol
<?>
protocol
)
{
Compression
compression
=
this
.
compression
;
Compression
compression
=
this
.
compression
;
protocol
.
setCompression
(
"on"
);
protocol
.
setCompression
(
"on"
);
protocol
.
setCompressionMinSize
((
int
)
compression
.
getMinResponseSize
().
toBytes
());
protocol
.
setCompressionMinSize
(
getMinResponseSize
(
compression
));
protocol
.
setCompressibleMimeType
(
protocol
.
setCompressibleMimeType
(
getMimeTypes
(
compression
));
StringUtils
.
arrayToCommaDelimitedString
(
compression
.
getMimeTypes
()));
if
(
this
.
compression
.
getExcludedUserAgents
()
!=
null
)
{
if
(
this
.
compression
.
getExcludedUserAgents
()
!=
null
)
{
protocol
.
setNoCompressionUserAgents
(
StringUtils
.
arrayToCommaDelimitedString
(
protocol
.
setNoCompressionUserAgents
(
getExcludedUserAgents
());
this
.
compression
.
getExcludedUserAgents
()));
}
}
}
}
private
int
getMinResponseSize
(
Compression
compression
)
{
return
(
int
)
compression
.
getMinResponseSize
().
toBytes
();
}
private
String
getMimeTypes
(
Compression
compression
)
{
return
StringUtils
.
arrayToCommaDelimitedString
(
compression
.
getMimeTypes
());
}
private
String
getExcludedUserAgents
()
{
return
StringUtils
.
arrayToCommaDelimitedString
(
this
.
compression
.
getExcludedUserAgents
());
}
}
}
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/CollectionBinderTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java
View file @
2f77ef77
...
@@ -403,9 +403,9 @@ public class RestTemplateBuilderTests {
...
@@ -403,9 +403,9 @@ public class RestTemplateBuilderTests {
RestTemplateCustomizer
customizer2
=
mock
(
RestTemplateCustomizer
.
class
);
RestTemplateCustomizer
customizer2
=
mock
(
RestTemplateCustomizer
.
class
);
RestTemplate
template
=
this
.
builder
.
customizers
(
customizer1
)
RestTemplate
template
=
this
.
builder
.
customizers
(
customizer1
)
.
additionalCustomizers
(
customizer2
).
build
();
.
additionalCustomizers
(
customizer2
).
build
();
InOrder
inOrder
=
inOrder
(
customizer1
,
customizer2
);
InOrder
ordered
=
inOrder
(
customizer1
,
customizer2
);
inOrder
.
verify
(
customizer1
).
customize
(
template
);
ordered
.
verify
(
customizer1
).
customize
(
template
);
inOrder
.
verify
(
customizer2
).
customize
(
template
);
ordered
.
verify
(
customizer2
).
customize
(
template
);
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java
View file @
2f77ef77
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -306,12 +306,12 @@ public class JettyServletWebServerFactoryTests
...
@@ -306,12 +306,12 @@ public class JettyServletWebServerFactoryTests
contexts
.
iterator
().
next
().
addEventListener
(
new
ServletContextListener
()
{
contexts
.
iterator
().
next
().
addEventListener
(
new
ServletContextListener
()
{
@Override
@Override
public
void
contextInitialized
(
ServletContextEvent
sce
)
{
public
void
contextInitialized
(
ServletContextEvent
event
)
{
throw
new
RuntimeException
();
throw
new
RuntimeException
();
}
}
@Override
@Override
public
void
contextDestroyed
(
ServletContextEvent
sce
)
{
public
void
contextDestroyed
(
ServletContextEvent
event
)
{
}
}
});
});
...
...
src/checkstyle/checkstyle.xml
View file @
2f77ef77
...
@@ -26,5 +26,12 @@
...
@@ -26,5 +26,12 @@
value=
"Please use specialized AssertJ assertThat*Exception method."
/>
value=
"Please use specialized AssertJ assertThat*Exception method."
/>
<property
name=
"ignoreComments"
value=
"true"
/>
<property
name=
"ignoreComments"
value=
"true"
/>
</module>
</module>
<module
name=
"com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck"
>
<property
name=
"maximum"
value=
"0"
/>
<property
name=
"format"
value=
"org\.mockito\.Mockito\.(when|doThrow|doAnswer)"
/>
<property
name=
"message"
value=
"Please use BDDMockito imports."
/>
<property
name=
"ignoreComments"
value=
"true"
/>
</module>
</module>
</module>
</module>
</module>
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