Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye authored and mhalbritter committed Sep 13, 2023
1 parent a9f26e0 commit c2b7883
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ dependencies {
optional("io.opentelemetry:opentelemetry-exporter-otlp")
optional("io.projectreactor.netty:reactor-netty-http")
optional("io.r2dbc:r2dbc-pool")
optional("io.r2dbc:r2dbc-spi")
optional("io.r2dbc:r2dbc-proxy")
optional("io.r2dbc:r2dbc-spi")
optional("jakarta.jms:jakarta.jms-api")
optional("jakarta.persistence:jakarta.persistence-api")
optional("jakarta.servlet:jakarta.servlet-api")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ void whenPropertiesSourceIsSetAdapterSourceReturnsIt() {
}

@Test
void whenPropertiesPublishHistogramTypeIsCumulativePublishCumulativeHistogramReturnsIt() {
void whenPropertiesPublishHistogramTypeIsCumulativeAdapterPublishCumulativeHistogramReturnsIt() {
SignalFxProperties properties = createProperties();
properties.setPublishedHistogramType(HistogramType.CUMULATIVE);
assertThat(createConfigAdapter(properties).publishCumulativeHistogram()).isTrue();
assertThat(createConfigAdapter(properties).publishDeltaHistogram()).isFalse();
}

@Test
void whenPropertiesPublishHistogramTypeIsDeltaPublishDeltaHistogramReturnsIt() {
void whenPropertiesPublishHistogramTypeIsDeltaAdapterPublishDeltaHistogramReturnsIt() {
SignalFxProperties properties = createProperties();
properties.setPublishedHistogramType(HistogramType.DELTA);
assertThat(createConfigAdapter(properties).publishDeltaHistogram()).isTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
class ObservationHandlerGroupingTests {

@Test
void shouldGroupCategoriesIntoFirstMatchingHandlerAndRespectsCategoryOrder() {
void shouldGroupCategoriesIntoFirstMatchingHandlerAndRespectCategoryOrder() {
ObservationHandlerGrouping grouping = new ObservationHandlerGrouping(
List.of(ObservationHandlerA.class, ObservationHandlerB.class));
ObservationConfig config = new ObservationConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,7 @@ void shouldConfigureVirtualThreads() {
this.contextRunner.withPropertyValues("spring.threads.virtual.enabled=true").run((context) -> {
SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory = context
.getBean("rabbitListenerContainerFactory", SimpleRabbitListenerContainerFactory.class);
Object executor = ReflectionTestUtils.getField(rabbitListenerContainerFactory, "taskExecutor");
assertThat(executor).as("rabbitListenerContainerFactory.taskExecutor")
assertThat(rabbitListenerContainerFactory).extracting("taskExecutor")
.isInstanceOf(VirtualThreadTaskExecutor.class);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ class JdbcClientAutoConfigurationTests {

@Test
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));
}

Expand Down Expand Up @@ -79,7 +81,7 @@ void jdbcClientIsOrderedAfterFlywayMigration() {
@Test
void jdbcClientIsOrderedAfterLiquibaseMigration() {
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))
.run((context) -> {
assertThat(context).hasNotFailed().hasSingleBean(JdbcClient.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void testDependencyToFlywayWithJdbcTemplateMixed() {
@Test
void testDependencyToLiquibase() {
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))
.run((context) -> {
assertThat(context).hasNotFailed();
Expand All @@ -195,7 +195,7 @@ void testDependencyToLiquibase() {
@Test
void testDependencyToLiquibaseWithJdbcTemplateMixed() {
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))
.run((context) -> {
assertThat(context).hasNotFailed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ void testOverrideParameters() {
void rollbackFile(@TempDir Path temp) throws IOException {
File file = Files.createTempFile(temp, "rollback-file", "sql").toFile();
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.liquibase.rollbackFile:" + file.getAbsolutePath())
.withPropertyValues("spring.liquibase.rollback-file:" + file.getAbsolutePath())
.run((context) -> {
SpringLiquibase liquibase = context.getBean(SpringLiquibase.class);
File actualFile = (File) ReflectionTestUtils.getField(liquibase, "rollbackFile");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void testFlywayPlusValidation() {
@Test
void testLiquibasePlusValidation() {
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")
.withConfiguration(AutoConfigurations.of(LiquibaseAutoConfiguration.class))
.run((context) -> assertThat(context).hasNotFailed());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1032,8 +1032,7 @@ static class CustomExceptionHandler extends ResponseEntityExceptionHandler {
}

@Configuration(proxyBeanMethods = false)
@Import({ OrderedControllerAdviceBeansConfiguration.LowestOrderedControllerAdvice.class,
OrderedControllerAdviceBeansConfiguration.HighestOrderedControllerAdvice.class })
@Import({ LowestOrderedControllerAdvice.class, HighestOrderedControllerAdvice.class })
static class OrderedControllerAdviceBeansConfiguration {

@ControllerAdvice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ You can inject it directly in your own beans as well, as shown in the following

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.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void testCompression() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
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.
}

Expand Down

0 comments on commit c2b7883

Please sign in to comment.