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
f03849d5
Commit
f03849d5
authored
Apr 10, 2018
by
Johnny Lim
Committed by
Stephane Nicoll
Apr 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
See gh-12812
parent
a9020df9
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
25 additions
and
34 deletions
+25
-34
MeterRegistryConfigurer.java
...ctuate/autoconfigure/metrics/MeterRegistryConfigurer.java
+2
-3
WebFluxMetricsAutoConfiguration.java
...metrics/web/reactive/WebFluxMetricsAutoConfiguration.java
+1
-1
MeterRegistryCustomizerTests.java
...e/autoconfigure/metrics/MeterRegistryCustomizerTests.java
+1
-1
NewRelicMetricsExportAutoConfigurationTests.java
...newrelic/NewRelicMetricsExportAutoConfigurationTests.java
+1
-3
SignalFxMetricsExportAutoConfigurationTests.java
...signalfx/SignalFxMetricsExportAutoConfigurationTests.java
+0
-1
AbstractHealthIndicator.java
...ramework/boot/actuate/health/AbstractHealthIndicator.java
+1
-1
MetricsWebFilter.java
...actuate/metrics/web/reactive/server/MetricsWebFilter.java
+1
-1
production-ready-features.adoc
...oot-docs/src/main/asciidoc/production-ready-features.adoc
+3
-3
CustomWebFluxSecurityExample.java
.../boot/docs/web/security/CustomWebFluxSecurityExample.java
+3
-5
WebTestClientSpringBootTestIntegrationTests.java
...ebclient/WebTestClientSpringBootTestIntegrationTests.java
+1
-2
ApplicationContextAssert.java
...k/boot/test/context/assertj/ApplicationContextAssert.java
+5
-5
TestRestTemplateTests.java
...framework/boot/test/web/client/TestRestTemplateTests.java
+1
-1
ConfigurationPropertySourcesTests.java
.../properties/source/ConfigurationPropertySourcesTests.java
+0
-1
README.adoc
spring-boot-samples/README.adoc
+1
-1
application.properties
...ot-sample-kafka/src/main/resources/application.properties
+2
-2
SampleSecureWebFluxCustomSecurityTests.java
...ecure/webflux/SampleSecureWebFluxCustomSecurityTests.java
+2
-3
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryConfigurer.java
View file @
f03849d5
...
...
@@ -25,13 +25,12 @@ import io.micrometer.core.instrument.binder.MeterBinder;
import
io.micrometer.core.instrument.composite.CompositeMeterRegistry
;
import
io.micrometer.core.instrument.config.MeterFilter
;
import
org.springframework.beans.factory.config.BeanPostProcessor
;
import
org.springframework.boot.util.LambdaSafe
;
/**
*
{@link BeanPostProcessor}
to apply {@link MeterRegistryCustomizer customizers},
*
Configurer
to apply {@link MeterRegistryCustomizer customizers},
* {@link MeterFilter filters}, {@link MeterBinder binders} and {@link Metrics#addRegistry
* global registration} to {@link MeterRegistry meter registries}. This
post processo
r
* global registration} to {@link MeterRegistry meter registries}. This
configure
r
* intentionally skips {@link CompositeMeterRegistry} with the assumptions that the
* registries it contains are beans and will be customized directly.
*
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/reactive/WebFluxMetricsAutoConfiguration.java
View file @
f03849d5
...
...
@@ -34,7 +34,7 @@ import org.springframework.context.annotation.Configuration;
/**
* {@link EnableAutoConfiguration Auto-configuration} for instrumentation of Spring
* Web
f
lux MVC annotation-based programming model request mappings.
* Web
F
lux MVC annotation-based programming model request mappings.
*
* @author Jon Schneider
* @since 2.0.0
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryCustomizerTests.java
View file @
f03849d5
...
...
@@ -85,7 +85,7 @@ public class MeterRegistryCustomizerTests {
}
@Bean
public
MeterRegistryCustomizer
<
PrometheusMeterRegistry
>
promet
eh
usOnlyCommonTags
()
{
public
MeterRegistryCustomizer
<
PrometheusMeterRegistry
>
promet
he
usOnlyCommonTags
()
{
return
(
registry
)
->
registry
.
config
().
commonTags
(
"job"
,
"myjob"
);
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicMetricsExportAutoConfigurationTests.java
View file @
f03849d5
...
...
@@ -80,9 +80,7 @@ public class NewRelicMetricsExportAutoConfigurationTests {
@Test
public
void
autoConfigurationCanBeDisabled
()
{
this
.
contextRunner
.
withUserConfiguration
(
BaseConfiguration
.
class
)
.
withPropertyValues
(
"management.metrics.export.newrelic.enabled=false"
,
"management.metrics.export.newrelic.api-key=abcde"
,
"management.metrics.export.newrelic.account-id=12345"
)
.
withPropertyValues
(
"management.metrics.export.newrelic.enabled=false"
)
.
run
((
context
)
->
assertThat
(
context
)
.
doesNotHaveBean
(
NewRelicMeterRegistry
.
class
)
.
doesNotHaveBean
(
NewRelicConfig
.
class
));
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java
View file @
f03849d5
...
...
@@ -72,7 +72,6 @@ public class SignalFxMetricsExportAutoConfigurationTests {
public
void
autoConfigurationCanBeDisabled
()
{
this
.
contextRunner
.
withUserConfiguration
(
BaseConfiguration
.
class
)
.
withPropertyValues
(
"management.metrics.export.signalfx.access-token=abcde"
,
"management.metrics.export.signalfx.enabled=false"
)
.
run
((
context
)
->
assertThat
(
context
)
.
doesNotHaveBean
(
SignalFxMeterRegistry
.
class
)
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractHealthIndicator.java
View file @
f03849d5
...
...
@@ -50,7 +50,7 @@ public abstract class AbstractHealthIndicator implements HealthIndicator {
* Create a new {@link AbstractHealthIndicator} instance with a default
* {@code healthCheckFailedMessage}.
*/
p
ublic
AbstractHealthIndicator
()
{
p
rotected
AbstractHealthIndicator
()
{
this
(
NO_MESSAGE
);
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java
View file @
f03849d5
...
...
@@ -30,7 +30,7 @@ import org.springframework.web.server.WebFilter;
import
org.springframework.web.server.WebFilterChain
;
/**
* Intercepts incoming HTTP requests modeled with the Web
f
lux annotation-based programming
* Intercepts incoming HTTP requests modeled with the Web
F
lux annotation-based programming
* model.
*
* @author Jon Schneider
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc
View file @
f03849d5
...
...
@@ -551,7 +551,7 @@ JMX or an HTTP request is converted to the required types using an instance of
[[production-ready-endpoints-custom-web]]
==== Custom Web Endpoints
Operations on a `@Endpoint`, `@WebEndpoint`, or `@WebEndpointExtension` are automatically
Operations on a
n
`@Endpoint`, `@WebEndpoint`, or `@WebEndpointExtension` are automatically
exposed over HTTP using Jersey, Spring MVC, or Spring WebFlux.
...
...
@@ -673,7 +673,7 @@ possible.
==== Controller endpoints
`@ControllerEndpoint` and `@RestControllerEndpoint` can be used to implement an endpoint
that is only exposed by Spring MVC or Spring WebFlux. Methods are mapped using the
standard annotations
Spring MVC and Spring WebFlux annotations
such as `@RequestMapping`
standard annotations
for Spring MVC and Spring WebFlux
such as `@RequestMapping`
and `@GetMapping`, with the endpoint's ID being used as a prefix for the path. Controller
endpoints provide deeper integration with Spring's web frameworks but at the expense of
portability. The `@Endpoint` and `@WebEndpoint` annotations should be preferred whenever
...
...
@@ -1763,7 +1763,7 @@ is required. A `CacheMetricsRegistrar` bean is made available to make that proce
[[production-ready-metrics-jdbc]]
==== DataSource Metrics
Auto-configuration enables the instrumentation of all available DataSource` objects with a
Auto-configuration enables the instrumentation of all available
`
DataSource` objects with a
metric named `jdbc`. Data source instrumentation results in gauges representing the
currently active, maximum allowed, and minimum allowed connections in the pool. Each of
these gauges has a name that is prefixed by `jdbc`.
...
...
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/security/CustomWebFluxSecurityExample.java
View file @
f03849d5
...
...
@@ -18,7 +18,6 @@ package org.springframework.boot.docs.web.security;
import
org.springframework.boot.autoconfigure.security.reactive.PathRequest
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity
;
import
org.springframework.security.config.web.server.ServerHttpSecurity
;
import
org.springframework.security.web.server.SecurityWebFilterChain
;
...
...
@@ -27,20 +26,19 @@ import org.springframework.security.web.server.SecurityWebFilterChain;
*
* @author Madhura Bhave
*/
@EnableWebFluxSecurity
public
class
CustomWebFluxSecurityExample
{
// @formatter:off
// tag::configuration[]
@Bean
public
SecurityWebFilterChain
springSecurityFilterChain
(
ServerHttpSecurity
http
)
{
http
return
http
.
authorizeExchange
()
.
matchers
(
PathRequest
.
toStaticResources
().
atCommonLocations
()).
permitAll
()
.
pathMatchers
(
"/foo"
,
"/bar"
)
.
authenticated
().
and
()
.
formLogin
()
;
return
http
.
build
();
.
formLogin
()
.
and
()
.
build
();
}
// end::configuration[]
// @formatter:on
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebTestClientSpringBootTestIntegrationTests.java
View file @
f03849d5
...
...
@@ -74,8 +74,7 @@ public class WebTestClientSpringBootTestIntegrationTests {
@Bean
public
SecurityWebFilterChain
springSecurityFilterChain
(
ServerHttpSecurity
http
)
{
http
.
authorizeExchange
().
anyExchange
().
permitAll
();
return
http
.
build
();
return
http
.
authorizeExchange
().
anyExchange
().
permitAll
().
and
().
build
();
}
}
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java
View file @
f03849d5
...
...
@@ -110,7 +110,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
* Verifies that the application context contains a single bean with the given type.
* <p>
* Example: <pre class="code">
* assertThat(context).hasSingleBean(Foo.class); </pre>
* assertThat(context).hasSingleBean(Foo.class
, Scope.NO_ANCESTORS
); </pre>
* @param type the bean type
* @param scope the scope of the assertion
* @return {@code this} assertion object.
...
...
@@ -159,7 +159,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
* Verifies that the application context does not contain any beans of the given type.
* <p>
* Example: <pre class="code">
* assertThat(context).doesNotHaveBean(Foo.class); </pre>
* assertThat(context).doesNotHaveBean(Foo.class
, Scope.NO_ANCESTORS
); </pre>
* @param type the bean type
* @param scope the scope of the assertion
* @return {@code this} assertion object.
...
...
@@ -255,8 +255,8 @@ public class ApplicationContextAssert<C extends ApplicationContext>
* assert on {@code null} is returned.
* <p>
* Example: <pre class="code">
* assertThat(context).getBean(Foo.class).isInstanceOf(DefaultFoo.class);
* assertThat(context).getBean(Bar.class).isNull();</pre>
* assertThat(context).getBean(Foo.class
, Scope.NO_ANCESTORS
).isInstanceOf(DefaultFoo.class);
* assertThat(context).getBean(Bar.class
, Scope.NO_ANCESTORS
).isNull();</pre>
* @param <T> the bean type
* @param type the bean type
* @param scope the scope of the assertion
...
...
@@ -374,7 +374,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
* can be found an assert on an empty {@code map} is returned.
* <p>
* Example: <pre class="code">
* assertThat(context).getBeans(Foo.class).containsKey("foo");
* assertThat(context).getBeans(Foo.class
, Scope.NO_ANCESTORS
).containsKey("foo");
* </pre>
* @param <T> the bean type
* @param type the bean type
...
...
spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateTests.java
View file @
f03849d5
...
...
@@ -142,7 +142,7 @@ public class TestRestTemplateTests {
.
willReturn
(
new
DefaultUriBuilderFactory
());
RestTemplateBuilder
builder
=
mock
(
RestTemplateBuilder
.
class
);
given
(
builder
.
build
()).
willReturn
(
delegate
);
final
TestRestTemplate
restTemplate
=
new
TestRestTemplate
(
builder
);
TestRestTemplate
restTemplate
=
new
TestRestTemplate
(
builder
);
ReflectionUtils
.
doWithMethods
(
RestOperations
.
class
,
new
MethodCallback
()
{
@Override
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java
View file @
f03849d5
...
...
@@ -60,7 +60,6 @@ public class ConfigurationPropertySourcesTests {
public
void
attachShouldReAttachInMergedSetup
()
{
ConfigurableEnvironment
parent
=
new
StandardEnvironment
();
ConfigurationPropertySources
.
attach
(
parent
);
parent
.
getProperty
(
"my.example-property"
);
ConfigurableEnvironment
child
=
new
StandardEnvironment
();
child
.
merge
(
parent
);
child
.
getPropertySources
().
addLast
(
new
MapPropertySource
(
"config"
,
...
...
spring-boot-samples/README.adoc
View file @
f03849d5
...
...
@@ -120,7 +120,7 @@ The following sample applications are provided:
| Demonstrates JUnit Jupiter-based testing
| link:spring-boot-sample-kafka[spring-boot-sample-kafka]
|
c
onsumer and producer using Apache Kafka
|
C
onsumer and producer using Apache Kafka
| link:spring-boot-sample-liquibase[spring-boot-sample-liquibase]
| Database migrations with Liquibase
...
...
spring-boot-samples/spring-boot-sample-kafka/src/main/resources/application.properties
View file @
f03849d5
...
...
@@ -2,5 +2,5 @@ spring.kafka.bootstrap-servers=localhost:9092
spring.kafka.consumer.group-id
=
testGroup
spring.kafka.consumer.auto-offset-reset
=
earliest
spring.kafka.consumer.value-deserializer
=
org.springframework.kafka.support.serializer.JsonDeserializer
spring.kafka.producer.value-serializer
=
org.springframework.kafka.support.serializer.JsonSerializer
spring.kafka.consumer.properties.spring.json.trusted.packages
=
sample.kafka
\ No newline at end of file
spring.kafka.consumer.properties.spring.json.trusted.packages
=
sample.kafka
spring.kafka.producer.value-serializer
=
org.springframework.kafka.support.serializer.JsonSerializer
\ No newline at end of file
spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java
View file @
f03849d5
...
...
@@ -116,15 +116,14 @@ public class SampleSecureWebFluxCustomSecurityTests {
@Bean
public
SecurityWebFilterChain
springSecurityFilterChain
(
ServerHttpSecurity
http
)
{
http
.
authorizeExchange
().
matchers
(
EndpointRequest
.
to
(
"health"
,
"info"
))
return
http
.
authorizeExchange
().
matchers
(
EndpointRequest
.
to
(
"health"
,
"info"
))
.
permitAll
()
.
matchers
(
EndpointRequest
.
toAnyEndpoint
()
.
excluding
(
MappingsEndpoint
.
class
))
.
hasRole
(
"ACTUATOR"
)
.
matchers
(
PathRequest
.
toStaticResources
().
atCommonLocations
())
.
permitAll
().
pathMatchers
(
"/login"
).
permitAll
().
anyExchange
()
.
authenticated
().
and
().
httpBasic
();
return
http
.
build
();
.
authenticated
().
and
().
httpBasic
().
and
().
build
();
}
}
...
...
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