Merge branch '2.7.x'
Closes gh-31178
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.springframework.boot.autoconfigure.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.hazelcast.core.HazelcastInstance;
|
||||
import com.hazelcast.spring.cache.HazelcastCacheManager;
|
||||
|
||||
@@ -50,8 +48,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
class HazelcastCacheConfiguration {
|
||||
|
||||
@Bean
|
||||
HazelcastCacheManager cacheManager(CacheManagerCustomizers customizers, HazelcastInstance existingHazelcastInstance)
|
||||
throws IOException {
|
||||
HazelcastCacheManager cacheManager(CacheManagerCustomizers customizers,
|
||||
HazelcastInstance existingHazelcastInstance) {
|
||||
HazelcastCacheManager cacheManager = new HazelcastCacheManager(existingHazelcastInstance);
|
||||
return customizers.customize(cacheManager);
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ class ArtemisEmbeddedServerConfiguration {
|
||||
@Bean(initMethod = "start", destroyMethod = "stop")
|
||||
@ConditionalOnMissingBean
|
||||
EmbeddedActiveMQ embeddedActiveMq(org.apache.activemq.artemis.core.config.Configuration configuration,
|
||||
JMSConfiguration jmsConfiguration, ObjectProvider<ArtemisConfigurationCustomizer> configurationCustomizers)
|
||||
throws Exception {
|
||||
JMSConfiguration jmsConfiguration,
|
||||
ObjectProvider<ArtemisConfigurationCustomizer> configurationCustomizers) {
|
||||
for (JMSQueueConfiguration queueConfiguration : jmsConfiguration.getQueueConfigurations()) {
|
||||
String queueName = queueConfiguration.getName();
|
||||
configuration.addAddressConfiguration(
|
||||
|
||||
@@ -125,7 +125,7 @@ public class EmbeddedLdapAutoConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
private void importLdif(ApplicationContext applicationContext) throws LDAPException {
|
||||
private void importLdif(ApplicationContext applicationContext) {
|
||||
String location = this.embeddedProperties.getLdif();
|
||||
if (StringUtils.hasText(location)) {
|
||||
try {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user