mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish
See gh-37340
This commit is contained in:
parent
a9f26e0f95
commit
c2b78830ff
@ -73,8 +73,8 @@ dependencies {
|
|||||||
optional("io.opentelemetry:opentelemetry-exporter-otlp")
|
optional("io.opentelemetry:opentelemetry-exporter-otlp")
|
||||||
optional("io.projectreactor.netty:reactor-netty-http")
|
optional("io.projectreactor.netty:reactor-netty-http")
|
||||||
optional("io.r2dbc:r2dbc-pool")
|
optional("io.r2dbc:r2dbc-pool")
|
||||||
optional("io.r2dbc:r2dbc-spi")
|
|
||||||
optional("io.r2dbc:r2dbc-proxy")
|
optional("io.r2dbc:r2dbc-proxy")
|
||||||
|
optional("io.r2dbc:r2dbc-spi")
|
||||||
optional("jakarta.jms:jakarta.jms-api")
|
optional("jakarta.jms:jakarta.jms-api")
|
||||||
optional("jakarta.persistence:jakarta.persistence-api")
|
optional("jakarta.persistence:jakarta.persistence-api")
|
||||||
optional("jakarta.servlet:jakarta.servlet-api")
|
optional("jakarta.servlet:jakarta.servlet-api")
|
||||||
|
@ -68,7 +68,7 @@ class SignalFxPropertiesConfigAdapterTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void whenPropertiesPublishHistogramTypeIsCumulativePublishCumulativeHistogramReturnsIt() {
|
void whenPropertiesPublishHistogramTypeIsCumulativeAdapterPublishCumulativeHistogramReturnsIt() {
|
||||||
SignalFxProperties properties = createProperties();
|
SignalFxProperties properties = createProperties();
|
||||||
properties.setPublishedHistogramType(HistogramType.CUMULATIVE);
|
properties.setPublishedHistogramType(HistogramType.CUMULATIVE);
|
||||||
assertThat(createConfigAdapter(properties).publishCumulativeHistogram()).isTrue();
|
assertThat(createConfigAdapter(properties).publishCumulativeHistogram()).isTrue();
|
||||||
@ -76,7 +76,7 @@ class SignalFxPropertiesConfigAdapterTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void whenPropertiesPublishHistogramTypeIsDeltaPublishDeltaHistogramReturnsIt() {
|
void whenPropertiesPublishHistogramTypeIsDeltaAdapterPublishDeltaHistogramReturnsIt() {
|
||||||
SignalFxProperties properties = createProperties();
|
SignalFxProperties properties = createProperties();
|
||||||
properties.setPublishedHistogramType(HistogramType.DELTA);
|
properties.setPublishedHistogramType(HistogramType.DELTA);
|
||||||
assertThat(createConfigAdapter(properties).publishDeltaHistogram()).isTrue();
|
assertThat(createConfigAdapter(properties).publishDeltaHistogram()).isTrue();
|
||||||
|
@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class ObservationHandlerGroupingTests {
|
class ObservationHandlerGroupingTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void shouldGroupCategoriesIntoFirstMatchingHandlerAndRespectsCategoryOrder() {
|
void shouldGroupCategoriesIntoFirstMatchingHandlerAndRespectCategoryOrder() {
|
||||||
ObservationHandlerGrouping grouping = new ObservationHandlerGrouping(
|
ObservationHandlerGrouping grouping = new ObservationHandlerGrouping(
|
||||||
List.of(ObservationHandlerA.class, ObservationHandlerB.class));
|
List.of(ObservationHandlerA.class, ObservationHandlerB.class));
|
||||||
ObservationConfig config = new ObservationConfig();
|
ObservationConfig config = new ObservationConfig();
|
||||||
|
@ -541,8 +541,7 @@ class RabbitAutoConfigurationTests {
|
|||||||
this.contextRunner.withPropertyValues("spring.threads.virtual.enabled=true").run((context) -> {
|
this.contextRunner.withPropertyValues("spring.threads.virtual.enabled=true").run((context) -> {
|
||||||
SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory = context
|
SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory = context
|
||||||
.getBean("rabbitListenerContainerFactory", SimpleRabbitListenerContainerFactory.class);
|
.getBean("rabbitListenerContainerFactory", SimpleRabbitListenerContainerFactory.class);
|
||||||
Object executor = ReflectionTestUtils.getField(rabbitListenerContainerFactory, "taskExecutor");
|
assertThat(rabbitListenerContainerFactory).extracting("taskExecutor")
|
||||||
assertThat(executor).as("rabbitListenerContainerFactory.taskExecutor")
|
|
||||||
.isInstanceOf(VirtualThreadTaskExecutor.class);
|
.isInstanceOf(VirtualThreadTaskExecutor.class);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,9 @@ class JdbcClientAutoConfigurationTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void jdbcClientWhenNoAvailableJdbcTemplateIsNotCreated() {
|
void jdbcClientWhenNoAvailableJdbcTemplateIsNotCreated() {
|
||||||
new ApplicationContextRunner().withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class))
|
new ApplicationContextRunner()
|
||||||
|
.withConfiguration(
|
||||||
|
AutoConfigurations.of(DataSourceAutoConfiguration.class, JdbcClientAutoConfiguration.class))
|
||||||
.run((context) -> assertThat(context).doesNotHaveBean(JdbcClient.class));
|
.run((context) -> assertThat(context).doesNotHaveBean(JdbcClient.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +81,7 @@ class JdbcClientAutoConfigurationTests {
|
|||||||
@Test
|
@Test
|
||||||
void jdbcClientIsOrderedAfterLiquibaseMigration() {
|
void jdbcClientIsOrderedAfterLiquibaseMigration() {
|
||||||
this.contextRunner.withUserConfiguration(JdbcClientDataSourceMigrationValidator.class)
|
this.contextRunner.withUserConfiguration(JdbcClientDataSourceMigrationValidator.class)
|
||||||
.withPropertyValues("spring.liquibase.changeLog:classpath:db/changelog/db.changelog-city.yaml")
|
.withPropertyValues("spring.liquibase.change-log:classpath:db/changelog/db.changelog-city.yaml")
|
||||||
.withConfiguration(AutoConfigurations.of(LiquibaseAutoConfiguration.class))
|
.withConfiguration(AutoConfigurations.of(LiquibaseAutoConfiguration.class))
|
||||||
.run((context) -> {
|
.run((context) -> {
|
||||||
assertThat(context).hasNotFailed().hasSingleBean(JdbcClient.class);
|
assertThat(context).hasNotFailed().hasSingleBean(JdbcClient.class);
|
||||||
|
@ -184,7 +184,7 @@ class JdbcTemplateAutoConfigurationTests {
|
|||||||
@Test
|
@Test
|
||||||
void testDependencyToLiquibase() {
|
void testDependencyToLiquibase() {
|
||||||
this.contextRunner.withUserConfiguration(DataSourceMigrationValidator.class)
|
this.contextRunner.withUserConfiguration(DataSourceMigrationValidator.class)
|
||||||
.withPropertyValues("spring.liquibase.changeLog:classpath:db/changelog/db.changelog-city.yaml")
|
.withPropertyValues("spring.liquibase.change-log:classpath:db/changelog/db.changelog-city.yaml")
|
||||||
.withConfiguration(AutoConfigurations.of(LiquibaseAutoConfiguration.class))
|
.withConfiguration(AutoConfigurations.of(LiquibaseAutoConfiguration.class))
|
||||||
.run((context) -> {
|
.run((context) -> {
|
||||||
assertThat(context).hasNotFailed();
|
assertThat(context).hasNotFailed();
|
||||||
@ -195,7 +195,7 @@ class JdbcTemplateAutoConfigurationTests {
|
|||||||
@Test
|
@Test
|
||||||
void testDependencyToLiquibaseWithJdbcTemplateMixed() {
|
void testDependencyToLiquibaseWithJdbcTemplateMixed() {
|
||||||
this.contextRunner.withUserConfiguration(NamedParameterDataSourceMigrationValidator.class)
|
this.contextRunner.withUserConfiguration(NamedParameterDataSourceMigrationValidator.class)
|
||||||
.withPropertyValues("spring.liquibase.changeLog:classpath:db/changelog/db.changelog-city.yaml")
|
.withPropertyValues("spring.liquibase.change-log:classpath:db/changelog/db.changelog-city.yaml")
|
||||||
.withConfiguration(AutoConfigurations.of(LiquibaseAutoConfiguration.class))
|
.withConfiguration(AutoConfigurations.of(LiquibaseAutoConfiguration.class))
|
||||||
.run((context) -> {
|
.run((context) -> {
|
||||||
assertThat(context).hasNotFailed();
|
assertThat(context).hasNotFailed();
|
||||||
|
@ -396,7 +396,7 @@ class LiquibaseAutoConfigurationTests {
|
|||||||
void rollbackFile(@TempDir Path temp) throws IOException {
|
void rollbackFile(@TempDir Path temp) throws IOException {
|
||||||
File file = Files.createTempFile(temp, "rollback-file", "sql").toFile();
|
File file = Files.createTempFile(temp, "rollback-file", "sql").toFile();
|
||||||
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
||||||
.withPropertyValues("spring.liquibase.rollbackFile:" + file.getAbsolutePath())
|
.withPropertyValues("spring.liquibase.rollback-file:" + file.getAbsolutePath())
|
||||||
.run((context) -> {
|
.run((context) -> {
|
||||||
SpringLiquibase liquibase = context.getBean(SpringLiquibase.class);
|
SpringLiquibase liquibase = context.getBean(SpringLiquibase.class);
|
||||||
File actualFile = (File) ReflectionTestUtils.getField(liquibase, "rollbackFile");
|
File actualFile = (File) ReflectionTestUtils.getField(liquibase, "rollbackFile");
|
||||||
|
@ -153,7 +153,7 @@ class HibernateJpaAutoConfigurationTests extends AbstractJpaAutoConfigurationTes
|
|||||||
@Test
|
@Test
|
||||||
void testLiquibasePlusValidation() {
|
void testLiquibasePlusValidation() {
|
||||||
contextRunner()
|
contextRunner()
|
||||||
.withPropertyValues("spring.liquibase.changeLog:classpath:db/changelog/db.changelog-city.yaml",
|
.withPropertyValues("spring.liquibase.change-log:classpath:db/changelog/db.changelog-city.yaml",
|
||||||
"spring.jpa.hibernate.ddl-auto:validate")
|
"spring.jpa.hibernate.ddl-auto:validate")
|
||||||
.withConfiguration(AutoConfigurations.of(LiquibaseAutoConfiguration.class))
|
.withConfiguration(AutoConfigurations.of(LiquibaseAutoConfiguration.class))
|
||||||
.run((context) -> assertThat(context).hasNotFailed());
|
.run((context) -> assertThat(context).hasNotFailed());
|
||||||
|
@ -1032,8 +1032,7 @@ class WebFluxAutoConfigurationTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@Configuration(proxyBeanMethods = false)
|
||||||
@Import({ OrderedControllerAdviceBeansConfiguration.LowestOrderedControllerAdvice.class,
|
@Import({ LowestOrderedControllerAdvice.class, HighestOrderedControllerAdvice.class })
|
||||||
OrderedControllerAdviceBeansConfiguration.HighestOrderedControllerAdvice.class })
|
|
||||||
static class OrderedControllerAdviceBeansConfiguration {
|
static class OrderedControllerAdviceBeansConfiguration {
|
||||||
|
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
|
@ -183,7 +183,7 @@ You can inject it directly in your own beans as well, as shown in the following
|
|||||||
|
|
||||||
include::code:MyBean[]
|
include::code:MyBean[]
|
||||||
|
|
||||||
If you rely on auto-configuration to create the underlying `JdbcTemplate`, any customization using `spring.jdbc.template.*` properties are taken into account in the client as well.
|
If you rely on auto-configuration to create the underlying `JdbcTemplate`, any customization using `spring.jdbc.template.*` properties is taken into account in the client as well.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class SampleJettyApplicationTests {
|
|||||||
ResponseEntity<String> entity = this.restTemplate.getForEntity("/", String.class);
|
ResponseEntity<String> entity = this.restTemplate.getForEntity("/", String.class);
|
||||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||||
assertThat(entity.getBody()).isEqualTo("Hello World");
|
assertThat(entity.getBody()).isEqualTo("Hello World");
|
||||||
// Jetty HttpClient decodes gzip reponses automatically and removes the
|
// Jetty HttpClient decodes gzip responses automatically and removes the
|
||||||
// Content-Encoding header. We have to assume that the response was gzipped.
|
// Content-Encoding header. We have to assume that the response was gzipped.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user