Skip to content

Commit f03849d

Browse files
izeyesnicoll
authored andcommitted
1 parent a9020df commit f03849d

File tree

16 files changed

+25
-34
lines changed

16 files changed

+25
-34
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryConfigurer.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
2626
import io.micrometer.core.instrument.config.MeterFilter;
2727

28-
import org.springframework.beans.factory.config.BeanPostProcessor;
2928
import org.springframework.boot.util.LambdaSafe;
3029

3130
/**
32-
* {@link BeanPostProcessor} to apply {@link MeterRegistryCustomizer customizers},
31+
* Configurer to apply {@link MeterRegistryCustomizer customizers},
3332
* {@link MeterFilter filters}, {@link MeterBinder binders} and {@link Metrics#addRegistry
34-
* global registration} to {@link MeterRegistry meter registries}. This post processor
33+
* global registration} to {@link MeterRegistry meter registries}. This configurer
3534
* intentionally skips {@link CompositeMeterRegistry} with the assumptions that the
3635
* registries it contains are beans and will be customized directly.
3736
*

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/reactive/WebFluxMetricsAutoConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
/**
3636
* {@link EnableAutoConfiguration Auto-configuration} for instrumentation of Spring
37-
* Webflux MVC annotation-based programming model request mappings.
37+
* WebFlux MVC annotation-based programming model request mappings.
3838
*
3939
* @author Jon Schneider
4040
* @since 2.0.0

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryCustomizerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public MeterRegistryCustomizer<MeterRegistry> commonTags() {
8585
}
8686

8787
@Bean
88-
public MeterRegistryCustomizer<PrometheusMeterRegistry> prometehusOnlyCommonTags() {
88+
public MeterRegistryCustomizer<PrometheusMeterRegistry> prometheusOnlyCommonTags() {
8989
return (registry) -> registry.config().commonTags("job", "myjob");
9090
}
9191

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicMetricsExportAutoConfigurationTests.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ public void autoConfiguresWithAccountIdAndApiKey() {
8080
@Test
8181
public void autoConfigurationCanBeDisabled() {
8282
this.contextRunner.withUserConfiguration(BaseConfiguration.class)
83-
.withPropertyValues("management.metrics.export.newrelic.enabled=false",
84-
"management.metrics.export.newrelic.api-key=abcde",
85-
"management.metrics.export.newrelic.account-id=12345")
83+
.withPropertyValues("management.metrics.export.newrelic.enabled=false")
8684
.run((context) -> assertThat(context)
8785
.doesNotHaveBean(NewRelicMeterRegistry.class)
8886
.doesNotHaveBean(NewRelicConfig.class));

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public void autoConfiguresWithAnAccessToken() {
7272
public void autoConfigurationCanBeDisabled() {
7373
this.contextRunner.withUserConfiguration(BaseConfiguration.class)
7474
.withPropertyValues(
75-
"management.metrics.export.signalfx.access-token=abcde",
7675
"management.metrics.export.signalfx.enabled=false")
7776
.run((context) -> assertThat(context)
7877
.doesNotHaveBean(SignalFxMeterRegistry.class)

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractHealthIndicator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public abstract class AbstractHealthIndicator implements HealthIndicator {
5050
* Create a new {@link AbstractHealthIndicator} instance with a default
5151
* {@code healthCheckFailedMessage}.
5252
*/
53-
public AbstractHealthIndicator() {
53+
protected AbstractHealthIndicator() {
5454
this(NO_MESSAGE);
5555
}
5656

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import org.springframework.web.server.WebFilterChain;
3131

3232
/**
33-
* Intercepts incoming HTTP requests modeled with the Webflux annotation-based programming
33+
* Intercepts incoming HTTP requests modeled with the WebFlux annotation-based programming
3434
* model.
3535
*
3636
* @author Jon Schneider

spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ JMX or an HTTP request is converted to the required types using an instance of
551551

552552
[[production-ready-endpoints-custom-web]]
553553
==== Custom Web Endpoints
554-
Operations on a `@Endpoint`, `@WebEndpoint`, or `@WebEndpointExtension` are automatically
554+
Operations on an `@Endpoint`, `@WebEndpoint`, or `@WebEndpointExtension` are automatically
555555
exposed over HTTP using Jersey, Spring MVC, or Spring WebFlux.
556556

557557

@@ -673,7 +673,7 @@ possible.
673673
==== Controller endpoints
674674
`@ControllerEndpoint` and `@RestControllerEndpoint` can be used to implement an endpoint
675675
that is only exposed by Spring MVC or Spring WebFlux. Methods are mapped using the
676-
standard annotations Spring MVC and Spring WebFlux annotations such as `@RequestMapping`
676+
standard annotations for Spring MVC and Spring WebFlux such as `@RequestMapping`
677677
and `@GetMapping`, with the endpoint's ID being used as a prefix for the path. Controller
678678
endpoints provide deeper integration with Spring's web frameworks but at the expense of
679679
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
17631763

17641764
[[production-ready-metrics-jdbc]]
17651765
==== DataSource Metrics
1766-
Auto-configuration enables the instrumentation of all available DataSource` objects with a
1766+
Auto-configuration enables the instrumentation of all available `DataSource` objects with a
17671767
metric named `jdbc`. Data source instrumentation results in gauges representing the
17681768
currently active, maximum allowed, and minimum allowed connections in the pool. Each of
17691769
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

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import org.springframework.boot.autoconfigure.security.reactive.PathRequest;
2020
import org.springframework.context.annotation.Bean;
21-
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
2221
import org.springframework.security.config.web.server.ServerHttpSecurity;
2322
import org.springframework.security.web.server.SecurityWebFilterChain;
2423

@@ -27,20 +26,19 @@
2726
*
2827
* @author Madhura Bhave
2928
*/
30-
@EnableWebFluxSecurity
3129
public class CustomWebFluxSecurityExample {
3230

3331
// @formatter:off
3432
// tag::configuration[]
3533
@Bean
3634
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
37-
http
35+
return http
3836
.authorizeExchange()
3937
.matchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
4038
.pathMatchers("/foo", "/bar")
4139
.authenticated().and()
42-
.formLogin();
43-
return http.build();
40+
.formLogin().and()
41+
.build();
4442
}
4543
// end::configuration[]
4644
// @formatter:on

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebTestClientSpringBootTestIntegrationTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ static class TestConfiguration {
7474

7575
@Bean
7676
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
77-
http.authorizeExchange().anyExchange().permitAll();
78-
return http.build();
77+
return http.authorizeExchange().anyExchange().permitAll().and().build();
7978
}
8079

8180
}

spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public ApplicationContextAssert<C> hasSingleBean(Class<?> type) {
110110
* Verifies that the application context contains a single bean with the given type.
111111
* <p>
112112
* Example: <pre class="code">
113-
* assertThat(context).hasSingleBean(Foo.class); </pre>
113+
* assertThat(context).hasSingleBean(Foo.class, Scope.NO_ANCESTORS); </pre>
114114
* @param type the bean type
115115
* @param scope the scope of the assertion
116116
* @return {@code this} assertion object.
@@ -159,7 +159,7 @@ public ApplicationContextAssert<C> doesNotHaveBean(Class<?> type) {
159159
* Verifies that the application context does not contain any beans of the given type.
160160
* <p>
161161
* Example: <pre class="code">
162-
* assertThat(context).doesNotHaveBean(Foo.class); </pre>
162+
* assertThat(context).doesNotHaveBean(Foo.class, Scope.NO_ANCESTORS); </pre>
163163
* @param type the bean type
164164
* @param scope the scope of the assertion
165165
* @return {@code this} assertion object.
@@ -255,8 +255,8 @@ public <T> AbstractObjectAssert<?, T> getBean(Class<T> type) {
255255
* assert on {@code null} is returned.
256256
* <p>
257257
* Example: <pre class="code">
258-
* assertThat(context).getBean(Foo.class).isInstanceOf(DefaultFoo.class);
259-
* assertThat(context).getBean(Bar.class).isNull();</pre>
258+
* assertThat(context).getBean(Foo.class, Scope.NO_ANCESTORS).isInstanceOf(DefaultFoo.class);
259+
* assertThat(context).getBean(Bar.class, Scope.NO_ANCESTORS).isNull();</pre>
260260
* @param <T> the bean type
261261
* @param type the bean type
262262
* @param scope the scope of the assertion
@@ -374,7 +374,7 @@ public <T> MapAssert<String, T> getBeans(Class<T> type) {
374374
* can be found an assert on an empty {@code map} is returned.
375375
* <p>
376376
* Example: <pre class="code">
377-
* assertThat(context).getBeans(Foo.class).containsKey("foo");
377+
* assertThat(context).getBeans(Foo.class, Scope.NO_ANCESTORS).containsKey("foo");
378378
* </pre>
379379
* @param <T> the bean type
380380
* @param type the bean type

spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public void restOperationsAreAvailable() {
142142
.willReturn(new DefaultUriBuilderFactory());
143143
RestTemplateBuilder builder = mock(RestTemplateBuilder.class);
144144
given(builder.build()).willReturn(delegate);
145-
final TestRestTemplate restTemplate = new TestRestTemplate(builder);
145+
TestRestTemplate restTemplate = new TestRestTemplate(builder);
146146
ReflectionUtils.doWithMethods(RestOperations.class, new MethodCallback() {
147147

148148
@Override

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public void attachShouldAddAdapterAtBeginning() {
6060
public void attachShouldReAttachInMergedSetup() {
6161
ConfigurableEnvironment parent = new StandardEnvironment();
6262
ConfigurationPropertySources.attach(parent);
63-
parent.getProperty("my.example-property");
6463
ConfigurableEnvironment child = new StandardEnvironment();
6564
child.merge(parent);
6665
child.getPropertySources().addLast(new MapPropertySource("config",

spring-boot-samples/README.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The following sample applications are provided:
120120
| Demonstrates JUnit Jupiter-based testing
121121

122122
| link:spring-boot-sample-kafka[spring-boot-sample-kafka]
123-
| consumer and producer using Apache Kafka
123+
| Consumer and producer using Apache Kafka
124124

125125
| link:spring-boot-sample-liquibase[spring-boot-sample-liquibase]
126126
| Database migrations with Liquibase

spring-boot-samples/spring-boot-sample-kafka/src/main/resources/application.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ spring.kafka.bootstrap-servers=localhost:9092
22
spring.kafka.consumer.group-id=testGroup
33
spring.kafka.consumer.auto-offset-reset=earliest
44
spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer
5-
spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer
6-
spring.kafka.consumer.properties.spring.json.trusted.packages=sample.kafka
5+
spring.kafka.consumer.properties.spring.json.trusted.packages=sample.kafka
6+
spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer

spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,14 @@ public MapReactiveUserDetailsService userDetailsService() {
116116

117117
@Bean
118118
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
119-
http.authorizeExchange().matchers(EndpointRequest.to("health", "info"))
119+
return http.authorizeExchange().matchers(EndpointRequest.to("health", "info"))
120120
.permitAll()
121121
.matchers(EndpointRequest.toAnyEndpoint()
122122
.excluding(MappingsEndpoint.class))
123123
.hasRole("ACTUATOR")
124124
.matchers(PathRequest.toStaticResources().atCommonLocations())
125125
.permitAll().pathMatchers("/login").permitAll().anyExchange()
126-
.authenticated().and().httpBasic();
127-
return http.build();
126+
.authenticated().and().httpBasic().and().build();
128127
}
129128

130129
}

0 commit comments

Comments
 (0)