mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Merge branch '4.1.x'
Closes gh-51607
This commit is contained in:
@@ -412,14 +412,14 @@ class JavaConventions {
|
||||
// https://github.com/spring-projects/spring-graphql/issues/1515
|
||||
String group = details.getId().getGroup();
|
||||
if ("org.springframework".equals(group) || "org.springframework.graphql".equals(group)) {
|
||||
addDocumentaionVariant(project, details, "javadocElements", DocsType.JAVADOC, "javadoc");
|
||||
addDocumentaionVariant(project, details, "sourcesElements", DocsType.SOURCES, "sources");
|
||||
addDocumentationVariant(project, details, "javadocElements", DocsType.JAVADOC, "javadoc");
|
||||
addDocumentationVariant(project, details, "sourcesElements", DocsType.SOURCES, "sources");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void addDocumentaionVariant(Project project, ComponentMetadataDetails details, String name, String docsType,
|
||||
String classifier) {
|
||||
private void addDocumentationVariant(Project project, ComponentMetadataDetails details, String name,
|
||||
String docsType, String classifier) {
|
||||
ModuleVersionIdentifier id = details.getId();
|
||||
String file = "%s-%s-%s.jar".formatted(id.getName(), id.getVersion(), classifier);
|
||||
details.addVariant(name, (variant) -> {
|
||||
|
||||
@@ -528,8 +528,8 @@ public class Library {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return manager.getGroups().stream().flatMap((group) -> group.getBoms().stream().map((bom) -> {
|
||||
String plaform = group.getId() + ":" + bom.name() + ":" + manager.getVersion();
|
||||
return this.project.getDependencies().platform(plaform);
|
||||
String platform = group.getId() + ":" + bom.name() + ":" + manager.getVersion();
|
||||
return this.project.getDependencies().platform(platform);
|
||||
})).toList();
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -41,9 +41,9 @@ class InteractiveUpgradeResolverTests {
|
||||
@Test
|
||||
void resolveUpgradeUpdateVersionNumberInLibrary() {
|
||||
UserInputHandler userInputHandler = mock(UserInputHandler.class);
|
||||
LibraryUpdateResolver libaryUpdateResolver = mock(LibraryUpdateResolver.class);
|
||||
LibraryUpdateResolver libraryUpdateResolver = mock(LibraryUpdateResolver.class);
|
||||
InteractiveUpgradeResolver upgradeResolver = new InteractiveUpgradeResolver(userInputHandler,
|
||||
libaryUpdateResolver);
|
||||
libraryUpdateResolver);
|
||||
List<Library> libraries = new ArrayList<>();
|
||||
DependencyVersion version = DependencyVersion.parse("1.0.0");
|
||||
Library library = new Library("test", null, version, null, null, null, null, null, null, null, null, null);
|
||||
@@ -54,7 +54,7 @@ class InteractiveUpgradeResolverTests {
|
||||
DependencyVersion updateVersion = DependencyVersion.parse("1.0.1");
|
||||
VersionOption versionOption = new VersionOption(updateVersion);
|
||||
updates.add(new LibraryWithVersionOptions(library, List.of(versionOption)));
|
||||
given(libaryUpdateResolver.findLibraryUpdates(any(), any())).willReturn(updates);
|
||||
given(libraryUpdateResolver.findLibraryUpdates(any(), any())).willReturn(updates);
|
||||
Provider<Object> providerOfVersionOption = providerOf(versionOption);
|
||||
given(userInputHandler.askUser(any())).willReturn(providerOfVersionOption);
|
||||
List<Upgrade> upgrades = upgradeResolver.resolveUpgrades(librariesToUpgrade, libraries);
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ public final class CompiledMetadataReader {
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new RuntimeException("Failed to read metadata fom '%s'".formatted(location), ex);
|
||||
throw new RuntimeException("Failed to read metadata from '%s'".formatted(location), ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ public enum TestcontainersStartup {
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the given {@link Startable} unless is's detected as already running.
|
||||
* Start the given {@link Startable} unless it's detected as already running.
|
||||
* @param startable the startable to start
|
||||
* @since 3.4.1
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1021,13 +1021,13 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests {
|
||||
@Test
|
||||
void runWhenHasNonOptionalImportThrowsException() {
|
||||
assertThatExceptionOfType(ConfigDataResourceNotFoundException.class).isThrownBy(
|
||||
() -> this.application.run("--spring.config.location=classpath:missing-appplication.properties"));
|
||||
() -> this.application.run("--spring.config.location=classpath:missing-application.properties"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void runWhenHasNonOptionalImportAndIgnoreNotFoundPropertyDoesNotThrowException() {
|
||||
this.application.run("--spring.config.on-not-found=ignore",
|
||||
"--spring.config.location=classpath:missing-appplication.properties");
|
||||
"--spring.config.location=classpath:missing-application.properties");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ class InfoEndpointDocumentationTests extends MockMvcEndpointDocumentationTests {
|
||||
fieldWithPath("uptime").description("Process uptime, if available.")
|
||||
.optional()
|
||||
.type(JsonFieldType.STRING),
|
||||
fieldWithPath("startTime").description("Process start time, if availabe.")
|
||||
fieldWithPath("startTime").description("Process start time, if available.")
|
||||
.optional()
|
||||
.type(JsonFieldType.STRING),
|
||||
fieldWithPath("currentTime").description("Current time known by the process.")
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ For Spring MVC and Spring WebFlux, this bean must be of type javadoc:org.springf
|
||||
|
||||
Spring WebSocket and JPA will use javadoc:org.springframework.core.task.AsyncTaskExecutor[] if either a single bean of this type is available or a bean named `applicationTaskExecutor` is defined.
|
||||
|
||||
Finally, the boostrap executor of the `ApplicationContext` uses a bean named `applicationTaskExecutor` unless a bean named `bootstrapExecutor` is defined.
|
||||
Finally, the bootstrap executor of the `ApplicationContext` uses a bean named `applicationTaskExecutor` unless a bean named `bootstrapExecutor` is defined.
|
||||
|
||||
The following code snippet demonstrates how to register a custom javadoc:org.springframework.core.task.AsyncTaskExecutor[] to be used with Spring MVC, Spring WebFlux, Spring GraphQL, Spring WebSocket, JPA, and background initialization of beans.
|
||||
|
||||
|
||||
@@ -459,7 +459,7 @@ For more details, please see {url-spring-grpc-docs}/server.html#_declarative_sec
|
||||
==== Servlet Container Based Servers
|
||||
|
||||
If your gRPC server is running xref:web/servlet.adoc[within a standard Servlet Container], you can use typical xref:web/spring-security.adoc#web.security.spring-mvc[web security configuration] to secure your application.
|
||||
Spring Boot will auto-configre javadoc:org.springframework.boot.grpc.server.autoconfigure.GrpcServerExecutorProvider[] and javadoc:org.springframework.grpc.server.security.SecurityContextServerInterceptor[] beans to ensure that Spring Security works correctly.
|
||||
Spring Boot will auto-configure javadoc:org.springframework.boot.grpc.server.autoconfigure.GrpcServerExecutorProvider[] and javadoc:org.springframework.grpc.server.security.SecurityContextServerInterceptor[] beans to ensure that Spring Security works correctly.
|
||||
|
||||
Cross-Site Request Forgery (CSRF) protection is incompatible with the gRPC protocol and will be disabled by default for all gRPC requests.
|
||||
If you prefer to configure your own CSRF protection, you can switch this off by setting configprop:spring.grpc.server.security.csrf.enabled[] to `false`.
|
||||
|
||||
+6
-6
@@ -248,7 +248,7 @@ class ExtractCommand extends Command {
|
||||
Manifest manifest = jarStructure.createLauncherManifest((library) -> librariesDirectory + library);
|
||||
mkdirs(file.getParentFile());
|
||||
try (JarOutputStream output = new JarOutputStream(new FileOutputStream(file))) {
|
||||
ManfiestWriter manfiestWriter = (sourceJarFile) -> {
|
||||
ManifestWriter manifestWriter = (sourceJarFile) -> {
|
||||
JarEntry entry = createJarEntry(JarFile.MANIFEST_NAME,
|
||||
sourceJarFile.getJarEntry(JarFile.MANIFEST_NAME));
|
||||
output.putNextEntry(entry);
|
||||
@@ -257,7 +257,7 @@ class ExtractCommand extends Command {
|
||||
};
|
||||
EnumSet<Type> allowedTypes = EnumSet.of(Type.APPLICATION_CLASS_OR_RESOURCE, Type.META_INF);
|
||||
Set<String> writtenEntries = new HashSet<>();
|
||||
withJarEntries(this.context.getArchiveFile(), manfiestWriter, ((stream, jarEntry) -> {
|
||||
withJarEntries(this.context.getArchiveFile(), manifestWriter, ((stream, jarEntry) -> {
|
||||
Entry entry = jarStructure.resolve(jarEntry);
|
||||
if (entry != null && allowedTypes.contains(entry.type()) && StringUtils.hasLength(entry.location())) {
|
||||
JarEntry newJarEntry = createJarEntry(entry.location(), jarEntry);
|
||||
@@ -346,11 +346,11 @@ class ExtractCommand extends Command {
|
||||
withJarEntries(file, null, callback);
|
||||
}
|
||||
|
||||
private static void withJarEntries(File file, @Nullable ManfiestWriter manfiestWriter, ThrowingConsumer callback)
|
||||
private static void withJarEntries(File file, @Nullable ManifestWriter manifestWriter, ThrowingConsumer callback)
|
||||
throws IOException {
|
||||
try (JarFile jarFile = new JarFile(file)) {
|
||||
if (manfiestWriter != null) {
|
||||
manfiestWriter.writeManifest(jarFile);
|
||||
if (manifestWriter != null) {
|
||||
manifestWriter.writeManifest(jarFile);
|
||||
}
|
||||
Enumeration<JarEntry> entries = jarFile.entries();
|
||||
while (entries.hasMoreElements()) {
|
||||
@@ -385,7 +385,7 @@ class ExtractCommand extends Command {
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
private interface ManfiestWriter {
|
||||
private interface ManifestWriter {
|
||||
|
||||
void writeManifest(JarFile sourceJarFile) throws IOException;
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ final class NestedPath implements Path {
|
||||
|
||||
NestedPath(NestedFileSystem fileSystem, String nestedEntryName) {
|
||||
if (fileSystem == null) {
|
||||
throw new IllegalArgumentException("'filesSystem' must not be null");
|
||||
throw new IllegalArgumentException("'fileSystem' must not be null");
|
||||
}
|
||||
this.fileSystem = fileSystem;
|
||||
this.nestedEntryName = (nestedEntryName != null && !nestedEntryName.isBlank()) ? nestedEntryName : null;
|
||||
|
||||
+2
-2
@@ -697,10 +697,10 @@ public final class ZipContent implements Closeable {
|
||||
}
|
||||
|
||||
void detect(ZipCentralDirectoryFileHeaderRecord centralRecord, FileDataBlock data, long pos,
|
||||
ByteBuffer loadeBuffer) throws IOException {
|
||||
ByteBuffer loadedBuffer) throws IOException {
|
||||
if (!this.detected) {
|
||||
long filenamePos = pos + ZipCentralDirectoryFileHeaderRecord.FILE_NAME_OFFSET;
|
||||
if (centralRecord.fileNameLength() > this.buffer.capacity() && ZipString.startsWith(loadeBuffer, data,
|
||||
if (centralRecord.fileNameLength() > this.buffer.capacity() && ZipString.startsWith(loadedBuffer, data,
|
||||
filenamePos, centralRecord.fileNameLength(), META_INF) >= 0) {
|
||||
this.buffer.clear();
|
||||
data.readFully(this.buffer, filenamePos + centralRecord.fileNameLength() - this.buffer.capacity());
|
||||
|
||||
+1
-1
@@ -193,7 +193,7 @@ class NestedJarFileTests {
|
||||
|
||||
@Test
|
||||
void getEntryWhenMultiReleaseEntryReturnsEntry() throws IOException {
|
||||
File multiReleaseFile = new File(this.tempDir, "mutli.zip");
|
||||
File multiReleaseFile = new File(this.tempDir, "multi.zip");
|
||||
try (ZipContent zip = ZipContent.open(this.file.toPath(), "multi-release.jar")) {
|
||||
try (InputStream in = zip.openRawZipData().asInputStream()) {
|
||||
try (FileOutputStream out = new FileOutputStream(multiReleaseFile)) {
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ class GrpcServerHealthSchedulerTests {
|
||||
HealthStatusManager statusManager = mock();
|
||||
TaskScheduler taskScheduler = mock();
|
||||
GenericWebApplicationContext context = new GenericWebApplicationContext();
|
||||
context.registerBean("registartion", GrpcServletRegistration.class, () -> mock());
|
||||
context.registerBean("registration", GrpcServletRegistration.class, () -> mock());
|
||||
context.refresh();
|
||||
new GrpcServerHealthScheduler(context, serverHealth, statusManager, taskScheduler, Duration.ofSeconds(10),
|
||||
Duration.ofSeconds(30));
|
||||
|
||||
+5
-5
@@ -252,7 +252,7 @@ class HibernateJpaAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenBackgroundBootstrapingAndSingleAsyncTaksExecutorConfiguresBackgroundExecutor() {
|
||||
void whenBackgroundBootstrappingAndSingleAsyncTaskExecutorConfiguresBackgroundExecutor() {
|
||||
this.contextRunner.withPropertyValues("spring.jpa.bootstrap=async")
|
||||
.withUserConfiguration(SingleAsyncTaskExecutorConfiguration.class)
|
||||
.run((context) -> assertThat(
|
||||
@@ -261,7 +261,7 @@ class HibernateJpaAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenBackgroundBootstrapingAndApplicationTaksExecutorConfiguresBackgroundExecutor() {
|
||||
void whenBackgroundBootstrappingAndApplicationTaskExecutorConfiguresBackgroundExecutor() {
|
||||
this.contextRunner.withPropertyValues("spring.jpa.bootstrap=async")
|
||||
.withUserConfiguration(MultipleAsyncTaskExecutorsConfiguration.class,
|
||||
ApplicationTaskExecutorConfiguration.class)
|
||||
@@ -271,7 +271,7 @@ class HibernateJpaAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenBackgroundBootstrapingAndMissingTaksExecutorThrowsException() {
|
||||
void whenBackgroundBootstrappingAndMissingTaskExecutorThrowsException() {
|
||||
this.contextRunner.withPropertyValues("spring.jpa.bootstrap=async")
|
||||
.run((context) -> assertThat(context).getFailure()
|
||||
.rootCause()
|
||||
@@ -281,7 +281,7 @@ class HibernateJpaAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenBackgroundBootstrapingAndMultipleTaksExecutorThrowsException() {
|
||||
void whenBackgroundBootstrappingAndMultipleTaskExecutorThrowsException() {
|
||||
this.contextRunner.withPropertyValues("spring.jpa.bootstrap=async")
|
||||
.withUserConfiguration(MultipleAsyncTaskExecutorsConfiguration.class)
|
||||
.run((context) -> assertThat(context).getFailure()
|
||||
@@ -292,7 +292,7 @@ class HibernateJpaAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenBackgroundBootstrapingAndCustomizedBackgroundExecutorThrowsException() {
|
||||
void whenBackgroundBootstrappingAndCustomizedBackgroundExecutorThrowsException() {
|
||||
this.contextRunner.withPropertyValues("spring.jpa.bootstrap=async")
|
||||
.withBean(EntityManagerFactoryBuilderCustomizer.class, this::bootstrapExecutorCustomizer)
|
||||
.run((context) -> assertThat(
|
||||
|
||||
+1
-1
@@ -282,7 +282,7 @@ public interface InetAddressFilter {
|
||||
|
||||
/**
|
||||
* Return a filter that matches any of the given IP addresses. Address may be either a
|
||||
* full IP address (e.g. {@code 192.168.1.1}) or an IP address block spcified using
|
||||
* full IP address (e.g. {@code 192.168.1.1}) or an IP address block specified using
|
||||
* CIDR notations (for example {@code 192.168.1.0/24}). Both IPv4 and IPv6 addresses
|
||||
* are supported.
|
||||
* @param addresses the IP addresses to match
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ final class InternalInetAddressFilter implements InetAddressFilter {
|
||||
* {@code fc00::/7} (RFC 4193). To keep our private network checking accurate to
|
||||
* modern subnets, we maintain manual parsing.
|
||||
* @param address the address to check
|
||||
* @return if the addess is site local
|
||||
* @return if the address is site local
|
||||
*/
|
||||
private boolean isSiteLocalIpv6Address(byte[] address) {
|
||||
return (address.length == 16)
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ class JettyServletWebServerAutoConfigurationTests extends AbstractServletWebServ
|
||||
}
|
||||
|
||||
@Test
|
||||
void jettyWebSocketUpgradeFilterIsAddedToServletContex() {
|
||||
void jettyWebSocketUpgradeFilterIsAddedToServletContext() {
|
||||
this.serverRunner.run((context) -> {
|
||||
ServletContext servletContext = context.getServletContext();
|
||||
assertThat(servletContext).isNotNull();
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ public final class ConnectionFactoryUnwrapper {
|
||||
*/
|
||||
public static ConnectionFactory unwrapCaching(ConnectionFactory connectionFactory) {
|
||||
if (connectionFactory instanceof CachingConnectionFactory cachingConnectionFactory) {
|
||||
ConnectionFactory unwrapedConnectionFactory = cachingConnectionFactory.getTargetConnectionFactory();
|
||||
return (unwrapedConnectionFactory != null) ? unwrapCaching(unwrapedConnectionFactory) : connectionFactory;
|
||||
ConnectionFactory unwrappedConnectionFactory = cachingConnectionFactory.getTargetConnectionFactory();
|
||||
return (unwrappedConnectionFactory != null) ? unwrapCaching(unwrappedConnectionFactory) : connectionFactory;
|
||||
}
|
||||
return connectionFactory;
|
||||
}
|
||||
|
||||
+1
-1
@@ -231,7 +231,7 @@ class OtlpMetricsPropertiesConfigAdapterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldUseApplicationGroupIfServiceNamspaceIsNotSet() {
|
||||
void shouldUseApplicationGroupIfServiceNamespaceIsNotSet() {
|
||||
this.environment.setProperty("spring.application.group", "alpha");
|
||||
assertThat(createAdapter().resourceAttributes()).containsEntry("service.namespace", "alpha");
|
||||
}
|
||||
|
||||
+3
-3
@@ -55,9 +55,9 @@ class StartupTimeMetricsListenerAutoConfigurationTests {
|
||||
SimpleMeterRegistry registry = context.getBean(SimpleMeterRegistry.class);
|
||||
context.publishEvent(new ApplicationStartedEvent(new SpringApplication(), new String[0],
|
||||
context.getSourceApplicationContext(), Duration.ofMillis(1500)));
|
||||
TimeGauge startedTimeGage = registry.find("application.started.time").timeGauge();
|
||||
assertThat(startedTimeGage).isNotNull();
|
||||
assertThat(startedTimeGage.value(TimeUnit.MILLISECONDS)).isEqualTo(1500L);
|
||||
TimeGauge startedTimeGauge = registry.find("application.started.time").timeGauge();
|
||||
assertThat(startedTimeGauge).isNotNull();
|
||||
assertThat(startedTimeGauge.value(TimeUnit.MILLISECONDS)).isEqualTo(1500L);
|
||||
context.publishEvent(new ApplicationReadyEvent(new SpringApplication(), new String[0],
|
||||
context.getSourceApplicationContext(), Duration.ofMillis(2000)));
|
||||
TimeGauge readyTimeGage = registry.find("application.ready.time").timeGauge();
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ class JwtDecoderConfiguration {
|
||||
|
||||
private JwtDecoder supplyJwtDecoderByIssuerUri() {
|
||||
String issuerUri = this.properties.getIssuerUri();
|
||||
Assert.state(issuerUri != null, "No JWT issuer URI propery specified");
|
||||
Assert.state(issuerUri != null, "No JWT issuer URI property specified");
|
||||
JwkSetUriJwtDecoderBuilder builder = NimbusJwtDecoder.withIssuerLocation(issuerUri);
|
||||
return buildJwkSetUriJwtDecoder(builder);
|
||||
}
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ class ReactiveJwtDecoderConfiguration {
|
||||
|
||||
private ReactiveJwtDecoder supplyJwtDecoderByIssuerUri() {
|
||||
String issuerUri = this.properties.getIssuerUri();
|
||||
Assert.state(issuerUri != null, "No JWT issuer URI propery specified");
|
||||
Assert.state(issuerUri != null, "No JWT issuer URI property specified");
|
||||
JwkSetUriReactiveJwtDecoderBuilder builder = NimbusReactiveJwtDecoder.withIssuerLocation(issuerUri);
|
||||
return buildJwkSetUriJwtDecoder(builder);
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ bom {
|
||||
library("GraphQL Java", "25.0") {
|
||||
prohibit {
|
||||
startsWith(["2018-", "2019-", "2020-", "2021-", "230521-"])
|
||||
because "we don't want thses snapshots"
|
||||
because "we don't want these snapshots"
|
||||
}
|
||||
alignWith {
|
||||
version {
|
||||
|
||||
Reference in New Issue
Block a user