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
23d8d608
Commit
23d8d608
authored
Jan 15, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
b2ec7c58
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
41 deletions
+36
-41
MetricsAutoConfiguration.java
...tuate/autoconfigure/metrics/MetricsAutoConfiguration.java
+3
-3
WebMvcMetricsFilterAutoTimedTests.java
...etrics/web/servlet/WebMvcMetricsFilterAutoTimedTests.java
+0
-3
WebMvcMetricsIntegrationTests.java
...te/metrics/web/servlet/WebMvcMetricsIntegrationTests.java
+0
-3
GsonAutoConfiguration.java
...mework/boot/autoconfigure/gson/GsonAutoConfiguration.java
+1
-1
GsonAutoConfigurationTests.java
...k/boot/autoconfigure/gson/GsonAutoConfigurationTests.java
+29
-28
ConfigurableUndertowWebServerFactory.java
...bedded/undertow/ConfigurableUndertowWebServerFactory.java
+2
-2
MapBinderTests.java
...ramework/boot/context/properties/bind/MapBinderTests.java
+1
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsAutoConfiguration.java
View file @
23d8d608
...
...
@@ -88,11 +88,11 @@ public class MetricsAutoConfiguration {
MetricsProperties
metricsProperties
,
ObjectProvider
<
Collection
<
MetricsExporter
>>
exporters
,
ObjectProvider
<
Collection
<
MeterRegistryConfigurer
>>
configurers
)
{
CompositeMeterRegistry
composite
=
metricsProperties
.
isUseGlobalRegistry
()
?
Metrics
.
globalRegistry
:
new
CompositeMeterRegistry
();
CompositeMeterRegistry
composite
=
metricsProperties
.
isUseGlobalRegistry
()
?
Metrics
.
globalRegistry
:
new
CompositeMeterRegistry
();
configurers
.
getIfAvailable
(
Collections:
:
emptyList
)
.
forEach
((
configurer
)
->
configurer
.
configureRegistry
(
composite
));
exporters
.
getIfAvailable
(
Collections:
:
emptyList
).
forEach
(
exporter
->
{
exporters
.
getIfAvailable
(
Collections:
:
emptyList
).
forEach
(
(
exporter
)
->
{
MeterRegistry
childRegistry
=
exporter
.
registry
();
if
(
composite
==
childRegistry
)
{
throw
new
IllegalStateException
(
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterAutoTimedTests.java
View file @
23d8d608
...
...
@@ -55,9 +55,6 @@ public class WebMvcMetricsFilterAutoTimedTests {
@Autowired
private
MeterRegistry
registry
;
@Autowired
private
MockClock
clock
;
@Autowired
private
WebApplicationContext
context
;
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsIntegrationTests.java
View file @
23d8d608
...
...
@@ -65,9 +65,6 @@ public class WebMvcMetricsIntegrationTests {
@Autowired
private
SimpleMeterRegistry
registry
;
@Autowired
private
MockClock
clock
;
private
MockMvc
mvc
;
@Autowired
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/gson/GsonAutoConfiguration.java
View file @
23d8d608
...
...
@@ -46,7 +46,7 @@ public class GsonAutoConfiguration {
@ConditionalOnMissingBean
(
GsonBuilder
.
class
)
public
GsonBuilder
gsonBuilder
(
List
<
GsonBuilderCustomizer
>
customizers
)
{
GsonBuilder
builder
=
new
GsonBuilder
();
customizers
.
forEach
(
c
->
c
.
customize
(
builder
));
customizers
.
forEach
(
(
c
)
->
c
.
customize
(
builder
));
return
builder
;
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/gson/GsonAutoConfigurationTests.java
View file @
23d8d608
...
...
@@ -51,7 +51,7 @@ public class GsonAutoConfigurationTests {
@Test
public
void
gsonRegistration
()
{
this
.
contextRunner
.
run
(
context
->
{
this
.
contextRunner
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
toJson
(
new
DataObject
())).
isEqualTo
(
"{\"data\":1}"
);
});
...
...
@@ -61,7 +61,7 @@ public class GsonAutoConfigurationTests {
public
void
generateNonExecutableJson
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.generate-non-executable-json:true"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
toJson
(
new
DataObject
()))
.
isNotEqualTo
(
"{\"data\":1}"
);
...
...
@@ -74,7 +74,7 @@ public class GsonAutoConfigurationTests {
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.exclude-fields-without-expose-annotation:true"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
toJson
(
new
DataObject
())).
isEqualTo
(
"{}"
);
});
...
...
@@ -83,7 +83,7 @@ public class GsonAutoConfigurationTests {
@Test
public
void
serializeNulls
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.serialize-nulls:true"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
serializeNulls
()).
isTrue
();
});
...
...
@@ -94,7 +94,7 @@ public class GsonAutoConfigurationTests {
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.enable-complex-map-key-serialization:true"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
Map
<
DataObject
,
String
>
original
=
new
LinkedHashMap
<>();
original
.
put
(
new
DataObject
(),
"a"
);
...
...
@@ -104,7 +104,7 @@ public class GsonAutoConfigurationTests {
@Test
public
void
notDisableInnerClassSerialization
()
{
this
.
contextRunner
.
run
(
context
->
{
this
.
contextRunner
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
WrapperObject
wrapperObject
=
new
WrapperObject
();
assertThat
(
gson
.
toJson
(
wrapperObject
.
new
NestedObject
()))
...
...
@@ -116,7 +116,7 @@ public class GsonAutoConfigurationTests {
public
void
disableInnerClassSerialization
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.disable-inner-class-serialization:true"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
WrapperObject
wrapperObject
=
new
WrapperObject
();
assertThat
(
gson
.
toJson
(
wrapperObject
.
new
NestedObject
()))
...
...
@@ -128,7 +128,7 @@ public class GsonAutoConfigurationTests {
public
void
withLongSerializationPolicy
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.long-serialization-policy:"
+
LongSerializationPolicy
.
STRING
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
toJson
(
new
DataObject
()))
.
isEqualTo
(
"{\"data\":\"1\"}"
);
...
...
@@ -141,7 +141,7 @@ public class GsonAutoConfigurationTests {
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.field-naming-policy:"
+
fieldNamingPolicy
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
fieldNamingStrategy
()).
isEqualTo
(
fieldNamingPolicy
);
});
...
...
@@ -150,7 +150,7 @@ public class GsonAutoConfigurationTests {
@Test
public
void
additionalGsonBuilderCustomization
()
{
this
.
contextRunner
.
withUserConfiguration
(
GsonBuilderCustomizerConfig
.
class
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
toJson
(
new
DataObject
())).
isEqualTo
(
"{}"
);
});
...
...
@@ -159,7 +159,7 @@ public class GsonAutoConfigurationTests {
@Test
public
void
customGsonBuilder
()
{
this
.
contextRunner
.
withUserConfiguration
(
GsonBuilderConfig
.
class
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
toJson
(
new
DataObject
()))
.
isEqualTo
(
"{\"data\":1,\"owner\":null}"
);
...
...
@@ -169,7 +169,7 @@ public class GsonAutoConfigurationTests {
@Test
public
void
withPrettyPrinting
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.pretty-printing:true"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
toJson
(
new
DataObject
()))
.
isEqualTo
(
"{\n \"data\": 1\n}"
);
...
...
@@ -178,7 +178,7 @@ public class GsonAutoConfigurationTests {
@Test
public
void
withoutLenient
()
{
this
.
contextRunner
.
run
(
context
->
{
this
.
contextRunner
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
/*
* It seems that lenient setting not work in version 2.8.2. We get access to
...
...
@@ -194,23 +194,24 @@ public class GsonAutoConfigurationTests {
@Test
public
void
withLenient
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.lenient:true"
).
run
(
context
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
/*
* It seems that lenient setting not work in version 2.8.2. We get access to
* it via reflection
*/
Field
lenientField
=
gson
.
getClass
().
getDeclaredField
(
"lenient"
);
lenientField
.
setAccessible
(
true
);
boolean
lenient
=
lenientField
.
getBoolean
(
gson
);
assertThat
(
lenient
).
isTrue
();
});
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.lenient:true"
)
.
run
((
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
/*
* It seems that lenient setting not work in version 2.8.2. We get
* access to it via reflection
*/
Field
lenientField
=
gson
.
getClass
().
getDeclaredField
(
"lenient"
);
lenientField
.
setAccessible
(
true
);
boolean
lenient
=
lenientField
.
getBoolean
(
gson
);
assertThat
(
lenient
).
isTrue
();
});
}
@Test
public
void
withHtmlEscaping
()
{
this
.
contextRunner
.
run
(
context
->
{
this
.
contextRunner
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
htmlSafe
()).
isTrue
();
});
...
...
@@ -219,7 +220,7 @@ public class GsonAutoConfigurationTests {
@Test
public
void
withoutHtmlEscaping
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.disable-html-escaping:true"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
assertThat
(
gson
.
htmlSafe
()).
isFalse
();
});
...
...
@@ -229,7 +230,7 @@ public class GsonAutoConfigurationTests {
@Test
public
void
customDateFormat
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.gson.date-format:H"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
Gson
gson
=
context
.
getBean
(
Gson
.
class
);
DateTime
dateTime
=
new
DateTime
(
1988
,
6
,
25
,
20
,
30
);
Date
date
=
dateTime
.
toDate
();
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/ConfigurableUndertowWebServerFactory.java
View file @
23d8d608
...
...
@@ -18,7 +18,7 @@ package org.springframework.boot.web.embedded.undertow;
import
java.io.File
;
import
io.undertow.Undertow
;
import
io.undertow.Undertow
.Builder
;
import
io.undertow.servlet.api.DeploymentInfo
;
/**
...
...
@@ -33,7 +33,7 @@ public interface ConfigurableUndertowWebServerFactory {
/**
* Add {@link UndertowBuilderCustomizer}s that should be used to customize the
* Undertow {@link
Undertow.
Builder}.
* Undertow {@link Builder}.
* @param customizers the customizers to add
*/
void
addBuilderCustomizers
(
UndertowBuilderCustomizer
...
customizers
);
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/MapBinderTests.java
View file @
23d8d608
...
...
@@ -611,7 +611,7 @@ public class MapBinderTests {
@Override
public
Map
<
String
,
String
>
convert
(
String
s
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
StringUtils
.
commaDelimitedListToSet
(
s
).
forEach
(
k
->
map
.
put
(
k
,
""
));
StringUtils
.
commaDelimitedListToSet
(
s
).
forEach
(
(
k
)
->
map
.
put
(
k
,
""
));
return
map
;
}
...
...
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