Polish
Closes gh-27432
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 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.
|
||||
@@ -46,25 +46,23 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnWebApplication
|
||||
@ConditionalOnClass({ JettyServerThreadPoolMetrics.class, Server.class })
|
||||
@ConditionalOnBean(MeterRegistry.class)
|
||||
@AutoConfigureAfter(CompositeMeterRegistryAutoConfiguration.class)
|
||||
public class JettyMetricsAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(MeterRegistry.class)
|
||||
@ConditionalOnMissingBean({ JettyServerThreadPoolMetrics.class, JettyServerThreadPoolMetricsBinder.class })
|
||||
public JettyServerThreadPoolMetricsBinder jettyServerThreadPoolMetricsBinder(MeterRegistry meterRegistry) {
|
||||
return new JettyServerThreadPoolMetricsBinder(meterRegistry);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(MeterRegistry.class)
|
||||
@ConditionalOnMissingBean({ JettyConnectionMetrics.class, JettyConnectionMetricsBinder.class })
|
||||
public JettyConnectionMetricsBinder jettyConnectionMetricsBinder(MeterRegistry meterRegistry) {
|
||||
return new JettyConnectionMetricsBinder(meterRegistry);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(MeterRegistry.class)
|
||||
@ConditionalOnMissingBean({ JettySslHandshakeMetrics.class, JettySslHandshakeMetricsBinder.class })
|
||||
@ConditionalOnProperty(name = "server.ssl.enabled", havingValue = "true")
|
||||
public JettySslHandshakeMetricsBinder jettySslHandshakeMetricsBinder(MeterRegistry meterRegistry) {
|
||||
|
||||
@@ -185,7 +185,6 @@ class MetricsRestTemplateCustomizerTests {
|
||||
assertThat(restTemplate.getForObject(URI.create("/second/456"), String.class)).isEqualTo("OK");
|
||||
this.registry.get("http.client.requests").tags("uri", "/second/456").timer();
|
||||
this.mockServer.verify();
|
||||
|
||||
}
|
||||
|
||||
private static final class TestInterceptor implements ClientHttpRequestInterceptor {
|
||||
|
||||
@@ -260,7 +260,7 @@ class MetricsWebFilterTests {
|
||||
|
||||
class FaultyWebFluxTagsProvider extends DefaultWebFluxTagsProvider {
|
||||
|
||||
private volatile AtomicBoolean fail = new AtomicBoolean(false);
|
||||
private final AtomicBoolean fail = new AtomicBoolean(false);
|
||||
|
||||
FaultyWebFluxTagsProvider() {
|
||||
super(true);
|
||||
|
||||
@@ -31,7 +31,7 @@ import io.micrometer.core.instrument.Tag;
|
||||
*/
|
||||
class FaultyWebMvcTagsProvider extends DefaultWebMvcTagsProvider {
|
||||
|
||||
private volatile AtomicBoolean fail = new AtomicBoolean(false);
|
||||
private final AtomicBoolean fail = new AtomicBoolean(false);
|
||||
|
||||
FaultyWebMvcTagsProvider() {
|
||||
super(true);
|
||||
|
||||
@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@ClassPathExclusions("commons-pool2-*.jar")
|
||||
public class RedisAutoConfigurationLettuceWithoutCommonsPool2Tests {
|
||||
class RedisAutoConfigurationLettuceWithoutCommonsPool2Tests {
|
||||
|
||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class));
|
||||
|
||||
@@ -1024,7 +1024,7 @@ To disable the auto-configured connection pool metrics, set the following proper
|
||||
[[actuator.metrics.supported.jetty]]
|
||||
==== Jetty Metrics
|
||||
Auto-configuration will bind metrics for Jetty's `ThreadPool` using Micrometer's `JettyServerThreadPoolMetrics`.
|
||||
Metrics for Jetty's `Connector`s are bound using Micrometer's `JettyConnectionMetrics` and, in addition when configprop:server.ssl.enabled[] is set to `true`, Micrometer's `JettySslHandshakeMetrics`.
|
||||
Metrics for Jetty's ``Connector``s are bound using Micrometer's `JettyConnectionMetrics` and, in addition when configprop:server.ssl.enabled[] is set to `true`, Micrometer's `JettySslHandshakeMetrics`.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -359,7 +359,7 @@ See the blog post on https://boxfuse.com/blog/spring-boot-ec2.html[deploying Spr
|
||||
|
||||
[[deployment.cloud.azure]]
|
||||
=== Azure
|
||||
This https://spring.io/guides/gs/spring-boot-for-azure/[Getting Started guide] walks you through deploying your Spring Boot application to either https://azure.microsoft.com/en-ca/services/spring-cloud/[Azure Spring Cloud] or https://docs.microsoft.com/en-ca/azure/app-service/overview[Azure App Service].
|
||||
This https://spring.io/guides/gs/spring-boot-for-azure/[Getting Started guide] walks you through deploying your Spring Boot application to either https://azure.microsoft.com/en-us/services/spring-cloud/[Azure Spring Cloud] or https://docs.microsoft.com/en-us/azure/app-service/overview[Azure App Service].
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ Once the `RSocket` channel is established between server and client, any party c
|
||||
|
||||
As a server, you can get injected with an `RSocketRequester` instance on any handler method of an RSocket `@Controller`.
|
||||
As a client, you need to configure and establish an RSocket connection first.
|
||||
Spring Boot auto-configures an `RSocketRequester.Builder` for such cases with the expected codecs and apply any `RSocketConnectorConfigurer` bean.
|
||||
Spring Boot auto-configures an `RSocketRequester.Builder` for such cases with the expected codecs and applies any `RSocketConnectorConfigurer` bean.
|
||||
|
||||
The `RSocketRequester.Builder` instance is a prototype bean, meaning each injection point will provide you with a new instance .
|
||||
This is done on purpose since this builder is stateful and you shouldn't create requesters with different setups using the same instance.
|
||||
|
||||
@@ -24,7 +24,7 @@ import lombok.Value;
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties using lombok @Value.
|
||||
* Configuration properties using Lombok {@code @Value}.
|
||||
*
|
||||
* @author Mark Jeffrey
|
||||
*/
|
||||
|
||||
@@ -103,7 +103,7 @@ public class SpringApplicationBuilder {
|
||||
|
||||
/**
|
||||
* Creates a new {@link SpringApplication} instance from the given sources. Subclasses
|
||||
* may override in order to provide a custom subclass of {@link SpringApplication}
|
||||
* may override in order to provide a custom subclass of {@link SpringApplication}.
|
||||
* @param sources the sources
|
||||
* @return the {@link SpringApplication} instance
|
||||
* @since 1.1.0
|
||||
@@ -116,9 +116,9 @@ public class SpringApplicationBuilder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@link SpringApplication} instances from the given sources using the
|
||||
* Creates a new {@link SpringApplication} instance from the given sources using the
|
||||
* given {@link ResourceLoader}. Subclasses may override in order to provide a custom
|
||||
* subclass of {@link SpringApplication}
|
||||
* subclass of {@link SpringApplication}.
|
||||
* @param resourceLoader the resource loader (can be null)
|
||||
* @param sources the sources
|
||||
* @return the {@link SpringApplication} instance
|
||||
|
||||
@@ -174,7 +174,7 @@ public final class DataSourceBuilder<T extends DataSource> {
|
||||
Set<DataSourceProperty> applied = new HashSet<>();
|
||||
for (DataSourceProperty property : DataSourceProperty.values()) {
|
||||
String value = this.values.get(property);
|
||||
if (!this.values.containsKey(property) && deriveFromProperties != null && properties.canSet(property)) {
|
||||
if (value == null && deriveFromProperties != null && properties.canSet(property)) {
|
||||
value = deriveFromProperties.get(this.deriveFrom, property);
|
||||
}
|
||||
if (value != null) {
|
||||
@@ -262,7 +262,7 @@ public final class DataSourceBuilder<T extends DataSource> {
|
||||
|
||||
PASSWORD(false, "password");
|
||||
|
||||
private boolean optional;
|
||||
private final boolean optional;
|
||||
|
||||
private final String[] names;
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ class RandomValuePropertySourceTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void longRangeWhenLowerBoundNegativeShouldFailWithIllegalArgumentException() {
|
||||
void longRangeWhenLowerBoundNegative() {
|
||||
Long value = (Long) this.source.getProperty("random.long[-4,4]");
|
||||
assertThat(value >= -4).isTrue();
|
||||
assertThat(value < 4).isTrue();
|
||||
|
||||
@@ -48,8 +48,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
|
||||
properties = { "server.http2.enabled=true", "server.ssl.enabled=true",
|
||||
"server.ssl.keystore=classpath:sample.jks", "server.ssl.key-store-password=secret",
|
||||
"server.ssl.key-password=password", "logging.level.org.eclipse.jetty=debug" })
|
||||
public class Jetty10Http2OverTlsTests {
|
||||
"server.ssl.key-password=password" })
|
||||
class Jetty10Http2OverTlsTests {
|
||||
|
||||
@LocalServerPort
|
||||
private int port;
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||
|
||||
@@ -36,9 +35,6 @@ class CorsSampleActuatorApplicationTests {
|
||||
@Autowired
|
||||
private WebTestClient webClient;
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Test
|
||||
void endpointShouldReturnUnauthorized() {
|
||||
this.webClient.get().uri("/actuator/env").exchange().expectStatus().isUnauthorized();
|
||||
|
||||
Reference in New Issue
Block a user