mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '2.7.x' into 3.0.x
Closes gh-37828
This commit is contained in:
commit
781ac2ece2
@ -192,7 +192,7 @@ public class BraveAutoConfiguration {
|
|||||||
// There's a chicken-and-egg problem here: to create a builder, we need a
|
// There's a chicken-and-egg problem here: to create a builder, we need a
|
||||||
// factory. But the CompositePropagationFactory needs data from the builder.
|
// factory. But the CompositePropagationFactory needs data from the builder.
|
||||||
// We create a throw-away builder with a throw-away factory, and then copy the
|
// We create a throw-away builder with a throw-away factory, and then copy the
|
||||||
// config to the real builder
|
// config to the real builder.
|
||||||
FactoryBuilder throwAwayBuilder = BaggagePropagation.newFactoryBuilder(createThrowAwayFactory());
|
FactoryBuilder throwAwayBuilder = BaggagePropagation.newFactoryBuilder(createThrowAwayFactory());
|
||||||
baggagePropagationCustomizers.orderedStream()
|
baggagePropagationCustomizers.orderedStream()
|
||||||
.forEach((customizer) -> customizer.customize(throwAwayBuilder));
|
.forEach((customizer) -> customizer.customize(throwAwayBuilder));
|
||||||
|
@ -85,8 +85,7 @@ class CompositePropagationFactory extends Propagation.Factory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link CompositePropagationFactory}, which uses the given
|
* Creates a new {@link CompositePropagationFactory}.
|
||||||
* {@code injectionTypes} for injection and {@code extractionTypes} for extraction.
|
|
||||||
* @param properties the propagation properties
|
* @param properties the propagation properties
|
||||||
* @return the {@link CompositePropagationFactory}
|
* @return the {@link CompositePropagationFactory}
|
||||||
*/
|
*/
|
||||||
@ -95,8 +94,7 @@ class CompositePropagationFactory extends Propagation.Factory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link CompositePropagationFactory}, which uses the given
|
* Creates a new {@link CompositePropagationFactory}.
|
||||||
* {@code injectionTypes} for injection and {@code extractionTypes} for extraction.
|
|
||||||
* @param properties the propagation properties
|
* @param properties the propagation properties
|
||||||
* @param baggageManager the baggage manager to use, or {@code null}
|
* @param baggageManager the baggage manager to use, or {@code null}
|
||||||
* @param localFields the local fields, or {@code null}
|
* @param localFields the local fields, or {@code null}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -20,7 +20,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
import org.springframework.util.unit.DataSize;
|
import org.springframework.util.unit.DataSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link ConfigurationProperties properties} for reactive codecs.
|
* {@link ConfigurationProperties Properties} for reactive codecs.
|
||||||
*
|
*
|
||||||
* @author Brian Clozel
|
* @author Brian Clozel
|
||||||
* @since 2.2.1
|
* @since 2.2.1
|
||||||
|
@ -22,7 +22,7 @@ import java.util.Arrays;
|
|||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link ConfigurationProperties properties} for Spring GraphQL.
|
* {@link ConfigurationProperties Properties} for Spring GraphQL.
|
||||||
*
|
*
|
||||||
* @author Brian Clozel
|
* @author Brian Clozel
|
||||||
* @since 2.7.0
|
* @since 2.7.0
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -19,7 +19,7 @@ package org.springframework.boot.autoconfigure.hateoas;
|
|||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link ConfigurationProperties properties} for Spring HATEOAS.
|
* {@link ConfigurationProperties Properties} for Spring HATEOAS.
|
||||||
*
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -25,7 +25,7 @@ import org.springframework.boot.web.server.Ssl;
|
|||||||
import org.springframework.util.unit.DataSize;
|
import org.springframework.util.unit.DataSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link ConfigurationProperties properties} for RSocket support.
|
* {@link ConfigurationProperties Properties} for RSocket support.
|
||||||
*
|
*
|
||||||
* @author Brian Clozel
|
* @author Brian Clozel
|
||||||
* @author Chris Bono
|
* @author Chris Bono
|
||||||
|
@ -20,7 +20,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link ConfigurationProperties properties} for Spring WebFlux.
|
* {@link ConfigurationProperties Properties} for Spring WebFlux.
|
||||||
*
|
*
|
||||||
* @author Brian Clozel
|
* @author Brian Clozel
|
||||||
* @author Vedran Pavic
|
* @author Vedran Pavic
|
||||||
|
@ -27,7 +27,7 @@ import org.springframework.util.Assert;
|
|||||||
import org.springframework.validation.DefaultMessageCodesResolver;
|
import org.springframework.validation.DefaultMessageCodesResolver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link ConfigurationProperties properties} for Spring MVC.
|
* {@link ConfigurationProperties Properties} for Spring MVC.
|
||||||
*
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
* @author Sébastien Deleuze
|
* @author Sébastien Deleuze
|
||||||
|
@ -592,7 +592,7 @@ If that is not what you want, you can disable transaction management for a test
|
|||||||
|
|
||||||
include::code:MyTransactionalTests[]
|
include::code:MyTransactionalTests[]
|
||||||
|
|
||||||
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `DataJpaTest`.
|
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `@DataJpaTest`.
|
||||||
(See "<<features#features.testing.spring-boot-applications.autoconfigured-spring-data-jpa>>".)
|
(See "<<features#features.testing.spring-boot-applications.autoconfigured-spring-data-jpa>>".)
|
||||||
|
|
||||||
|
|
||||||
@ -610,7 +610,7 @@ By default, Data JDBC tests are transactional and roll back at the end of each t
|
|||||||
See the {spring-framework-docs}/testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
|
See the {spring-framework-docs}/testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
|
||||||
If that is not what you want, you can disable transaction management for a test or for the whole test class as <<features#features.testing.spring-boot-applications.autoconfigured-jdbc,shown in the JDBC example>>.
|
If that is not what you want, you can disable transaction management for a test or for the whole test class as <<features#features.testing.spring-boot-applications.autoconfigured-jdbc,shown in the JDBC example>>.
|
||||||
|
|
||||||
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `DataJpaTest`.
|
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `@DataJpaTest`.
|
||||||
(See "<<features#features.testing.spring-boot-applications.autoconfigured-spring-data-jpa>>".)
|
(See "<<features#features.testing.spring-boot-applications.autoconfigured-spring-data-jpa>>".)
|
||||||
|
|
||||||
|
|
||||||
@ -618,7 +618,7 @@ If you prefer your test to run against a real database, you can use the `@AutoCo
|
|||||||
[[features.testing.spring-boot-applications.autoconfigured-spring-data-r2dbc]]
|
[[features.testing.spring-boot-applications.autoconfigured-spring-data-r2dbc]]
|
||||||
==== Auto-configured Data R2DBC Tests
|
==== Auto-configured Data R2DBC Tests
|
||||||
`@DataR2dbcTest` is similar to `@DataJdbcTest` but is for tests that use Spring Data R2DBC repositories.
|
`@DataR2dbcTest` is similar to `@DataJdbcTest` but is for tests that use Spring Data R2DBC repositories.
|
||||||
By default, it configures an in-memory embedded database, a `R2dbcEntityTemplate`, and Spring Data R2DBC repositories.
|
By default, it configures an in-memory embedded database, an `R2dbcEntityTemplate`, and Spring Data R2DBC repositories.
|
||||||
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataR2dbcTest` annotation is used.
|
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataR2dbcTest` annotation is used.
|
||||||
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
|
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ TIP: A list of the auto-configurations that are enabled by `@DataR2dbcTest` can
|
|||||||
|
|
||||||
By default, Data R2DBC tests are not transactional.
|
By default, Data R2DBC tests are not transactional.
|
||||||
|
|
||||||
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `DataJpaTest`.
|
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `@DataJpaTest`.
|
||||||
(See "<<features#features.testing.spring-boot-applications.autoconfigured-spring-data-jpa>>".)
|
(See "<<features#features.testing.spring-boot-applications.autoconfigured-spring-data-jpa>>".)
|
||||||
|
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ Most standard media types are supported out-of-the-box, but you can also define
|
|||||||
As of Spring Framework 5.3, Spring MVC supports two strategies for matching request paths to controllers.
|
As of Spring Framework 5.3, Spring MVC supports two strategies for matching request paths to controllers.
|
||||||
By default, Spring Boot uses the `PathPatternParser` strategy.
|
By default, Spring Boot uses the `PathPatternParser` strategy.
|
||||||
`PathPatternParser` is an https://spring.io/blog/2020/06/30/url-matching-with-pathpattern-in-spring-mvc[optimized implementation] but comes with some restrictions compared to the `AntPathMatcher` strategy.
|
`PathPatternParser` is an https://spring.io/blog/2020/06/30/url-matching-with-pathpattern-in-spring-mvc[optimized implementation] but comes with some restrictions compared to the `AntPathMatcher` strategy.
|
||||||
`PathPatternParser` restricts usage of {spring-framework-docs}/web.html#mvc-ann-requestmapping-uri-templates[some path patterns variants].
|
`PathPatternParser` restricts usage of {spring-framework-docs}/web.html#mvc-ann-requestmapping-uri-templates[some path pattern variants].
|
||||||
It is also incompatible with configuring the `DispatcherServlet` with a path prefix (configprop:spring.mvc.servlet.path[]).
|
It is also incompatible with configuring the `DispatcherServlet` with a path prefix (configprop:spring.mvc.servlet.path[]).
|
||||||
|
|
||||||
The strategy can be configured using the configprop:spring.mvc.pathmatch.matching-strategy[] configuration property, as shown in the following example:
|
The strategy can be configured using the configprop:spring.mvc.pathmatch.matching-strategy[] configuration property, as shown in the following example:
|
||||||
|
@ -82,7 +82,7 @@ class InitCommandTests extends AbstractHttpClientMockTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void generateProject() throws Exception {
|
void generateProject() throws Exception {
|
||||||
String fileName = UUID.randomUUID().toString() + ".zip";
|
String fileName = UUID.randomUUID() + ".zip";
|
||||||
File file = new File(fileName);
|
File file = new File(fileName);
|
||||||
assertThat(file).as("file should not exist").doesNotExist();
|
assertThat(file).as("file should not exist").doesNotExist();
|
||||||
MockHttpProjectGenerationRequest request = new MockHttpProjectGenerationRequest("application/zip", fileName);
|
MockHttpProjectGenerationRequest request = new MockHttpProjectGenerationRequest("application/zip", fileName);
|
||||||
@ -177,7 +177,7 @@ class InitCommandTests extends AbstractHttpClientMockTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void generateProjectAndExtractUnsupportedArchive(@TempDir File tempDir) throws Exception {
|
void generateProjectAndExtractUnsupportedArchive(@TempDir File tempDir) throws Exception {
|
||||||
String fileName = UUID.randomUUID().toString() + ".zip";
|
String fileName = UUID.randomUUID() + ".zip";
|
||||||
File file = new File(fileName);
|
File file = new File(fileName);
|
||||||
assertThat(file).as("file should not exist").doesNotExist();
|
assertThat(file).as("file should not exist").doesNotExist();
|
||||||
try {
|
try {
|
||||||
@ -195,7 +195,7 @@ class InitCommandTests extends AbstractHttpClientMockTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void generateProjectAndExtractUnknownContentType(@TempDir File tempDir) throws Exception {
|
void generateProjectAndExtractUnknownContentType(@TempDir File tempDir) throws Exception {
|
||||||
String fileName = UUID.randomUUID().toString() + ".zip";
|
String fileName = UUID.randomUUID() + ".zip";
|
||||||
File file = new File(fileName);
|
File file = new File(fileName);
|
||||||
assertThat(file).as("file should not exist").doesNotExist();
|
assertThat(file).as("file should not exist").doesNotExist();
|
||||||
try {
|
try {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2022 the original author or authors.
|
* Copyright 2012-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -137,7 +137,7 @@ class DependencyFilterMojoTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static File createArtifactFile(String jarType) {
|
private static File createArtifactFile(String jarType) {
|
||||||
Path jarPath = temp.resolve(UUID.randomUUID().toString() + ".jar");
|
Path jarPath = temp.resolve(UUID.randomUUID() + ".jar");
|
||||||
Manifest manifest = new Manifest();
|
Manifest manifest = new Manifest();
|
||||||
manifest.getMainAttributes().putValue("Manifest-Version", "1.0");
|
manifest.getMainAttributes().putValue("Manifest-Version", "1.0");
|
||||||
if (jarType != null) {
|
if (jarType != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user