Skip to content

Commit

Permalink
Merge branch '2.6.x' into 2.7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed May 26, 2022
2 parents 455ee0c + 3d203d0 commit 935d126
Show file tree
Hide file tree
Showing 39 changed files with 112 additions and 154 deletions.
Expand Up @@ -38,6 +38,7 @@ public class DeployedPlugin implements Plugin<Project> {
public static final String GENERATE_POM_TASK_NAME = "generatePomFileForMavenPublication";

@Override
@SuppressWarnings("deprecation")
public void apply(Project project) {
project.getPlugins().apply(MavenPublishPlugin.class);
project.getPlugins().apply(MavenRepositoryPlugin.class);
Expand Down
Expand Up @@ -28,6 +28,7 @@

import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.Task;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.OutputDirectory;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 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.
Expand Down Expand Up @@ -84,6 +84,7 @@ public String getMilestone() {
}

@TaskAction
@SuppressWarnings("deprecation")
void upgradeDependencies() {
GitHubRepository repository = createGitHub().getRepository(this.bom.getUpgrade().getGitHub().getOrganization(),
this.bom.getUpgrade().getGitHub().getRepository());
Expand Down
Expand Up @@ -241,10 +241,6 @@ boolean matches(EndpointId endpointId) {
return this.matchesAll || this.endpointIds.contains(endpointId);
}

static EndpointPatterns forExposure(EndpointExposure exposure) {
return (exposure != null) ? new EndpointPatterns(exposure.getDefaultIncludes()) : null;
}

}

}
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 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.
Expand Down Expand Up @@ -62,6 +62,7 @@ public ModelAndView handle(HttpServletRequest request, HttpServletResponse respo

@Override
@Deprecated
@SuppressWarnings("deprecation")
public long getLastModified(HttpServletRequest request, Object handler) {
Optional<HandlerAdapter> adapter = getAdapter(handler);
return adapter.map((handlerAdapter) -> handlerAdapter.getLastModified(request, handler)).orElse(0L);
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 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.
Expand Down Expand Up @@ -125,26 +125,27 @@ void matchWhenRequestHasSuffixShouldBeNull() {
private RequestMatchResult getMatchResult(String servletPath, boolean isPatternParser) {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setServletPath(servletPath);
AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext();
if (isPatternParser) {
context.register(WebMvcConfiguration.class);
}
else {
context.register(PathMatcherWebMvcConfiguration.class);
}
context.register(TestEndpointConfiguration.class);
context.refresh();
WebMvcEndpointHandlerMapping bean = context.getBean(WebMvcEndpointHandlerMapping.class);
try {
// Setup request attributes
ServletRequestPathUtils.parseAndCache(request);
// Trigger initLookupPath
bean.getHandler(request);
}
catch (Exception ex) {
throw new RuntimeException(ex);
try (AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext()) {
if (isPatternParser) {
context.register(WebMvcConfiguration.class);
}
else {
context.register(PathMatcherWebMvcConfiguration.class);
}
context.register(TestEndpointConfiguration.class);
context.refresh();
WebMvcEndpointHandlerMapping bean = context.getBean(WebMvcEndpointHandlerMapping.class);
try {
// Setup request attributes
ServletRequestPathUtils.parseAndCache(request);
// Trigger initLookupPath
bean.getHandler(request);
}
catch (Exception ex) {
throw new RuntimeException(ex);
}
return bean.match(request, "/spring");
}
return bean.match(request, "/spring");
}

@Override
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 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.
Expand All @@ -17,10 +17,11 @@
package org.springframework.boot.autoconfigure.data.redis;

import io.lettuce.core.resource.ClientResources;
import io.lettuce.core.resource.ClientResources.Builder;

/**
* Callback interface that can be implemented by beans wishing to customize the
* {@link ClientResources} via a {@link ClientResources.Builder} whilst retaining default
* {@link ClientResources} via a {@link Builder} whilst retaining default
* auto-configuration.
*
* @author Stephane Nicoll
Expand All @@ -29,9 +30,9 @@
public interface ClientResourcesBuilderCustomizer {

/**
* Customize the {@link ClientResources.Builder}.
* Customize the {@link Builder}.
* @param clientResourcesBuilder the builder to customize
*/
void customize(ClientResources.Builder clientResourcesBuilder);
void customize(Builder clientResourcesBuilder);

}
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2022 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.
Expand All @@ -17,6 +17,7 @@
package org.springframework.boot.autoconfigure.elasticsearch;

import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.config.RequestConfig.Builder;
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
import org.elasticsearch.client.RestClientBuilder;

Expand Down Expand Up @@ -52,11 +53,11 @@ default void customize(HttpAsyncClientBuilder builder) {
}

/**
* Customize the {@link RequestConfig.Builder}.
* Customize the {@link Builder}.
* @param builder the builder
* @since 2.3.0
*/
default void customize(RequestConfig.Builder builder) {
default void customize(Builder builder) {
}

}
Expand Up @@ -325,10 +325,6 @@ private void configureJavaMigrations(FluentConfiguration flyway, List<JavaMigrat
}
}

private String normalizePrefix(String location) {
return location.replace("filesystem:", "file:");
}

@Bean
@ConditionalOnMissingBean
public FlywayMigrationInitializer flywayInitializer(Flyway flyway,
Expand Down
Expand Up @@ -48,13 +48,6 @@ public class FlywayProperties {
*/
private boolean enabled = true;

/**
* Whether to check that migration scripts location exists. Should be set to false
* when using a wildcard location or a remote-hosted location such as S3 or GCS.
*/
@Deprecated
private boolean checkLocation = true;

/**
* Whether to fail if a location of migration scripts doesn't exist.
*/
Expand Down
Expand Up @@ -48,16 +48,6 @@ public class ArtemisProperties {
*/
private String brokerUrl;

/**
* Artemis broker host.
*/
private String host;

/**
* Artemis broker port.
*/
private int port = 61616;

/**
* Login user of the broker.
*/
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 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.
Expand All @@ -18,11 +18,12 @@

import de.flapdoodle.embed.process.config.store.DownloadConfig;
import de.flapdoodle.embed.process.config.store.ImmutableDownloadConfig;
import de.flapdoodle.embed.process.config.store.ImmutableDownloadConfig.Builder;

/**
* Callback interface that can be implemented by beans wishing to customize the
* {@link DownloadConfig} via an {@link ImmutableDownloadConfig.Builder} whilst retaining
* default auto-configuration.
* {@link DownloadConfig} via a {@link Builder} whilst retaining default
* auto-configuration.
*
* @author Michael Gmeiner
* @since 2.2.0
Expand All @@ -31,9 +32,8 @@
public interface DownloadConfigBuilderCustomizer {

/**
* Customize the {@link ImmutableDownloadConfig.Builder}.
* @param downloadConfigBuilder the {@link ImmutableDownloadConfig.Builder} to
* customize
* Customize the {@link Builder}.
* @param downloadConfigBuilder the {@link Builder} to customize
*/
void customize(ImmutableDownloadConfig.Builder downloadConfigBuilder);

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 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.
Expand Down Expand Up @@ -28,15 +28,15 @@
import org.springframework.util.StringUtils;

/**
* Initialize a {@link ConnectionFactoryOptions.Builder} based on {@link R2dbcProperties}.
* Initialize a {@link Builder} based on {@link R2dbcProperties}.
*
* @author Stephane Nicoll
*/
class ConnectionFactoryOptionsInitializer {

/**
* Initialize a {@link io.r2dbc.spi.ConnectionFactoryOptions.Builder
* ConnectionFactoryOptions.Builder} using the specified properties.
* Initialize a {@link Builder ConnectionFactoryOptions.Builder} using the specified
* properties.
* @param properties the properties to use to initialize the builder
* @param embeddedDatabaseConnection the embedded connection to use as a fallback
* @return an initialized builder
Expand Down
Expand Up @@ -39,18 +39,15 @@
import org.junit.jupiter.api.Test;

import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.jdbc.DatabaseDriver;
import org.springframework.boot.jdbc.EmbeddedDatabaseConnection;
import org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.util.StringUtils;
Expand Down Expand Up @@ -272,22 +269,6 @@ DataSource dataSource() {

}

@Configuration(proxyBeanMethods = false)
@DependsOnDatabaseInitialization
static class TestInitializedDataSourceConfiguration {

private boolean called;

@Autowired
void validateDataSourceIsInitialized(DataSource dataSource) {
// Inject the datasource to validate it is initialized at the injection point
JdbcTemplate template = new JdbcTemplate(dataSource);
assertThat(template.queryForObject("SELECT COUNT(*) from BAR", Integer.class)).isEqualTo(1);
this.called = true;
}

}

// see testExplicitDriverClassClearsUsername
public static class DatabaseTestDriver implements Driver {

Expand Down
Expand Up @@ -506,6 +506,7 @@ void listenerProperties() {

@Test
@Deprecated
@SuppressWarnings("deprecation")
void logOnlyRecordMetadataProperty() {
this.contextRunner.withPropertyValues("spring.kafka.listener.only-log-record-metadata=true").run((context) -> {
AbstractKafkaListenerContainerFactory<?, ?, ?> kafkaListenerContainerFactory = (AbstractKafkaListenerContainerFactory<?, ?, ?>) context
Expand Down
Expand Up @@ -154,7 +154,7 @@ void autoConfigurationShouldConfigureResourceServerUsingOidcIssuerUri() throws I
.getBean(SupplierReactiveJwtDecoder.class);
Mono<ReactiveJwtDecoder> reactiveJwtDecoderSupplier = (Mono<ReactiveJwtDecoder>) ReflectionTestUtils
.getField(supplierReactiveJwtDecoder, "jwtDecoderMono");
ReactiveJwtDecoder reactiveJwtDecoder = reactiveJwtDecoderSupplier.block();
reactiveJwtDecoderSupplier.block();
});
// The last request is to the JWK Set endpoint to look up the algorithm
assertThat(this.server.getRequestCount()).isEqualTo(1);
Expand All @@ -177,7 +177,7 @@ void autoConfigurationShouldConfigureResourceServerUsingOidcRfc8414IssuerUri() t
.getBean(SupplierReactiveJwtDecoder.class);
Mono<ReactiveJwtDecoder> reactiveJwtDecoderSupplier = (Mono<ReactiveJwtDecoder>) ReflectionTestUtils
.getField(supplierReactiveJwtDecoder, "jwtDecoderMono");
ReactiveJwtDecoder reactiveJwtDecoder = reactiveJwtDecoderSupplier.block();
reactiveJwtDecoderSupplier.block();
});
// The last request is to the JWK Set endpoint to look up the algorithm
assertThat(this.server.getRequestCount()).isEqualTo(2);
Expand All @@ -200,7 +200,7 @@ void autoConfigurationShouldConfigureResourceServerUsingOAuthIssuerUri() throws
.getBean(SupplierReactiveJwtDecoder.class);
Mono<ReactiveJwtDecoder> reactiveJwtDecoderSupplier = (Mono<ReactiveJwtDecoder>) ReflectionTestUtils
.getField(supplierReactiveJwtDecoder, "jwtDecoderMono");
ReactiveJwtDecoder reactiveJwtDecoder = reactiveJwtDecoderSupplier.block();
reactiveJwtDecoderSupplier.block();
});
// The last request is to the JWK Set endpoint to look up the algorithm
assertThat(this.server.getRequestCount()).isEqualTo(3);
Expand Down Expand Up @@ -417,7 +417,6 @@ void autoConfigurationShouldNotConfigureIssuerUriAndAudienceJwtValidatorIfProper
});
}

@SuppressWarnings("unchecked")
@Test
void autoConfigurationShouldConfigureIssuerAndAudienceJwtValidatorIfPropertyProvided() throws Exception {
this.server = new MockWebServer();
Expand Down Expand Up @@ -487,7 +486,6 @@ void autoConfigurationShouldConfigureAudienceValidatorIfPropertyProvidedAndIssue
});
}

@SuppressWarnings("unchecked")
@Test
void autoConfigurationShouldConfigureAudienceValidatorIfPropertyProvidedAndPublicKey() throws Exception {
this.server = new MockWebServer();
Expand Down

0 comments on commit 935d126

Please sign in to comment.