Merge branch '2.7.x'

Closes gh-31178
This commit is contained in:
Andy Wilkinson
2022-05-26 15:54:58 +01:00
68 changed files with 137 additions and 166 deletions

View File

@@ -64,7 +64,7 @@ class BatchDataSourceScriptDatabaseInitializerTests {
@ParameterizedTest
@EnumSource(value = DatabaseDriver.class, mode = Mode.EXCLUDE,
names = { "FIREBIRD", "INFORMIX", "JTDS", "PHOENIX", "REDSHIFT", "TERADATA", "TESTCONTAINERS", "UNKNOWN" })
void batchSchemaCanBeLocated(DatabaseDriver driver) throws IOException, SQLException {
void batchSchemaCanBeLocated(DatabaseDriver driver) throws SQLException {
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
BatchProperties properties = new BatchProperties();
DataSource dataSource = mock(DataSource.class);

View File

@@ -108,7 +108,7 @@ class JmsAutoConfigurationTests {
.run(this::testJmsTemplateBackOffEverything);
}
private void testJmsTemplateBackOffEverything(AssertableApplicationContext loaded) throws IOException {
private void testJmsTemplateBackOffEverything(AssertableApplicationContext loaded) {
JmsTemplate jmsTemplate = loaded.getBean(JmsTemplate.class);
assertThat(jmsTemplate.getPriority()).isEqualTo(999);
assertThat(loaded.getBeansOfType(ActiveMQConnectionFactory.class)).containsOnlyKeys("customConnectionFactory");

View File

@@ -16,7 +16,6 @@
package org.springframework.boot.autoconfigure.jmx;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import org.junit.jupiter.api.Test;
@@ -38,7 +37,7 @@ class ParentAwareNamingStrategyTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner();
@Test
void objectNameMatchesManagedResourceByDefault() throws MalformedObjectNameException {
void objectNameMatchesManagedResourceByDefault() {
this.contextRunner.withBean("testManagedResource", TestManagedResource.class).run((context) -> {
ParentAwareNamingStrategy strategy = new ParentAwareNamingStrategy(new AnnotationJmxAttributeSource());
strategy.setApplicationContext(context);
@@ -48,7 +47,7 @@ class ParentAwareNamingStrategyTests {
}
@Test
void uniqueObjectNameAddsIdentityProperty() throws MalformedObjectNameException {
void uniqueObjectNameAddsIdentityProperty() {
this.contextRunner.withBean("testManagedResource", TestManagedResource.class).run((context) -> {
ParentAwareNamingStrategy strategy = new ParentAwareNamingStrategy(new AnnotationJmxAttributeSource());
strategy.setApplicationContext(context);
@@ -62,7 +61,7 @@ class ParentAwareNamingStrategyTests {
}
@Test
void sameBeanInParentContextAddsContextProperty() throws MalformedObjectNameException {
void sameBeanInParentContextAddsContextProperty() {
this.contextRunner.withBean("testManagedResource", TestManagedResource.class).run((parent) -> this.contextRunner
.withBean("testManagedResource", TestManagedResource.class).withParent(parent).run((context) -> {
ParentAwareNamingStrategy strategy = new ParentAwareNamingStrategy(
@@ -77,7 +76,7 @@ class ParentAwareNamingStrategyTests {
}
@Test
void uniqueObjectNameAndSameBeanInParentContextOnlyAddsIdentityProperty() throws MalformedObjectNameException {
void uniqueObjectNameAndSameBeanInParentContextOnlyAddsIdentityProperty() {
this.contextRunner.withBean("testManagedResource", TestManagedResource.class).run((parent) -> this.contextRunner
.withBean("testManagedResource", TestManagedResource.class).withParent(parent).run((context) -> {
ParentAwareNamingStrategy strategy = new ParentAwareNamingStrategy(

View File

@@ -468,7 +468,7 @@ class LiquibaseAutoConfigurationTests {
private String name = UUID.randomUUID().toString();
@Bean
SimpleDriverDataSource dataSource() throws SQLException {
SimpleDriverDataSource dataSource() {
SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
dataSource.setDriverClass(CustomH2Driver.class);
dataSource.setUrl(String.format("jdbc:h2:mem:%s;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false", this.name));

View File

@@ -371,7 +371,7 @@ class ServerPropertiesTests {
}
@Test
void tomcatMaxHttpPostSizeMatchesConnectorDefault() throws Exception {
void tomcatMaxHttpPostSizeMatchesConnectorDefault() {
assertThat(this.properties.getTomcat().getMaxHttpFormPostSize().toBytes())
.isEqualTo(getDefaultConnector().getMaxPostSize());
}
@@ -383,13 +383,13 @@ class ServerPropertiesTests {
}
@Test
void tomcatMaxHttpFormPostSizeMatchesConnectorDefault() throws Exception {
void tomcatMaxHttpFormPostSizeMatchesConnectorDefault() {
assertThat(this.properties.getTomcat().getMaxHttpFormPostSize().toBytes())
.isEqualTo(getDefaultConnector().getMaxPostSize());
}
@Test
void tomcatUriEncodingMatchesConnectorDefault() throws Exception {
void tomcatUriEncodingMatchesConnectorDefault() {
assertThat(this.properties.getTomcat().getUriEncoding().name())
.isEqualTo(getDefaultConnector().getURIEncoding());
}