Closes gh-27431
This commit is contained in:
Andy Wilkinson 2021-07-21 11:53:10 +01:00
commit bb26b7bdf5
9 changed files with 10 additions and 16 deletions

View File

@ -185,7 +185,6 @@ class MetricsRestTemplateCustomizerTests {
assertThat(restTemplate.getForObject(URI.create("/second/456"), String.class)).isEqualTo("OK"); assertThat(restTemplate.getForObject(URI.create("/second/456"), String.class)).isEqualTo("OK");
this.registry.get("http.client.requests").tags("uri", "/second/456").timer(); this.registry.get("http.client.requests").tags("uri", "/second/456").timer();
this.mockServer.verify(); this.mockServer.verify();
} }
private static final class TestInterceptor implements ClientHttpRequestInterceptor { private static final class TestInterceptor implements ClientHttpRequestInterceptor {

View File

@ -260,7 +260,7 @@ class MetricsWebFilterTests {
class FaultyWebFluxTagsProvider extends DefaultWebFluxTagsProvider { class FaultyWebFluxTagsProvider extends DefaultWebFluxTagsProvider {
private volatile AtomicBoolean fail = new AtomicBoolean(false); private final AtomicBoolean fail = new AtomicBoolean(false);
FaultyWebFluxTagsProvider() { FaultyWebFluxTagsProvider() {
super(true); super(true);

View File

@ -31,7 +31,7 @@ import io.micrometer.core.instrument.Tag;
*/ */
class FaultyWebMvcTagsProvider extends DefaultWebMvcTagsProvider { class FaultyWebMvcTagsProvider extends DefaultWebMvcTagsProvider {
private volatile AtomicBoolean fail = new AtomicBoolean(false); private final AtomicBoolean fail = new AtomicBoolean(false);
FaultyWebMvcTagsProvider() { FaultyWebMvcTagsProvider() {
super(true); super(true);

View File

@ -359,7 +359,7 @@ See the blog post on https://boxfuse.com/blog/spring-boot-ec2.html[deploying Spr
[[deployment.cloud.azure]] [[deployment.cloud.azure]]
=== 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].

View File

@ -98,9 +98,8 @@ public class SpringApplicationBuilder {
} }
/** /**
* Creates a new {@link org.springframework.boot.SpringApplication} instances from the * Creates a new {@link SpringApplication} instance from the given sources. Subclasses
* given sources. Subclasses may override in order to provide a custom subclass of * may override in order to provide a custom subclass of {@link SpringApplication}.
* {@link org.springframework.boot.SpringApplication}
* @param sources the sources * @param sources the sources
* @return the {@link org.springframework.boot.SpringApplication} instance * @return the {@link org.springframework.boot.SpringApplication} instance
* @since 1.1.0 * @since 1.1.0

View File

@ -174,7 +174,7 @@ public final class DataSourceBuilder<T extends DataSource> {
Set<DataSourceProperty> applied = new HashSet<>(); Set<DataSourceProperty> applied = new HashSet<>();
for (DataSourceProperty property : DataSourceProperty.values()) { for (DataSourceProperty property : DataSourceProperty.values()) {
String value = this.values.get(property); 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); value = deriveFromProperties.get(this.deriveFrom, property);
} }
if (value != null) { if (value != null) {
@ -262,7 +262,7 @@ public final class DataSourceBuilder<T extends DataSource> {
PASSWORD(false, "password"); PASSWORD(false, "password");
private boolean optional; private final boolean optional;
private final String[] names; private final String[] names;

View File

@ -123,7 +123,7 @@ class RandomValuePropertySourceTests {
} }
@Test @Test
void longRangeWhenLowerBoundNegativeShouldFailWithIllegalArgumentException() { void longRangeWhenLowerBoundNegative() {
Long value = (Long) this.source.getProperty("random.long[-4,4]"); Long value = (Long) this.source.getProperty("random.long[-4,4]");
assertThat(value >= -4).isTrue(); assertThat(value >= -4).isTrue();
assertThat(value < 4).isTrue(); assertThat(value < 4).isTrue();

View File

@ -48,8 +48,8 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "server.http2.enabled=true", "server.ssl.enabled=true", properties = { "server.http2.enabled=true", "server.ssl.enabled=true",
"server.ssl.keystore=classpath:sample.jks", "server.ssl.key-store-password=secret", "server.ssl.keystore=classpath:sample.jks", "server.ssl.key-store-password=secret",
"server.ssl.key-password=password", "logging.level.org.eclipse.jetty=debug" }) "server.ssl.key-password=password" })
public class Jetty10Http2OverTlsTests { class Jetty10Http2OverTlsTests {
@LocalServerPort @LocalServerPort
private int port; private int port;

View File

@ -20,7 +20,6 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClient;
@ -36,9 +35,6 @@ class CorsSampleActuatorApplicationTests {
@Autowired @Autowired
private WebTestClient webClient; private WebTestClient webClient;
@Autowired
private ApplicationContext applicationContext;
@Test @Test
void endpointShouldReturnUnauthorized() { void endpointShouldReturnUnauthorized() {
this.webClient.get().uri("/actuator/env").exchange().expectStatus().isUnauthorized(); this.webClient.get().uri("/actuator/env").exchange().expectStatus().isUnauthorized();