diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java index 3c3273f52b3..bc8a2735fcb 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java @@ -158,7 +158,7 @@ public class EndpointWebMvcChildContextConfiguration { * configures the security filter. */ @Configuration - @ConditionalOnMissingClass(name = "org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter") + @ConditionalOnMissingClass("org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter") protected static class EndpointHandlerMappingConfiguration { @Autowired(required = false) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/VanillaPublicMetrics.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/VanillaPublicMetrics.java deleted file mode 100644 index 0bee3eb244c..00000000000 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/VanillaPublicMetrics.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2012-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.actuate.endpoint; - -import java.util.Collection; -import java.util.LinkedHashSet; - -import org.springframework.boot.actuate.metrics.Metric; -import org.springframework.boot.actuate.metrics.reader.MetricReader; -import org.springframework.util.Assert; - -/** - * Default implementation of {@link PublicMetrics} that exposes all metrics from a - * {@link MetricReader} along with memory information. - * - * @author Dave Syer - * @author Christian Dupuis - * @deprecated since 1.2 in favor of {@link SystemPublicMetrics}, - * {@code MetricReaderPublicMetrics} - */ -@Deprecated -public class VanillaPublicMetrics extends SystemPublicMetrics { - - private final MetricReader reader; - - public VanillaPublicMetrics(MetricReader reader) { - Assert.notNull(reader, "MetricReader must not be null"); - this.reader = reader; - } - - @Override - public Collection> metrics() { - Collection> result = new LinkedHashSet>(); - for (Metric metric : this.reader.findAll()) { - result.add(metric); - } - result.addAll(super.metrics()); - return result; - } - -} diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/system/ApplicationPidListener.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/system/ApplicationPidListener.java deleted file mode 100644 index 4c3b2d66d9b..00000000000 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/system/ApplicationPidListener.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2010-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.actuate.system; - -import java.io.File; - -import org.springframework.boot.context.event.ApplicationStartedEvent; - -/** - * An {@link org.springframework.context.ApplicationListener} that saves application PID - * into file. This application listener will be triggered exactly once per JVM, and the - * file name can be overridden at runtime with a System property or environment variable - * named "PIDFILE" (or "pidfile"). - * - * @author Jakub Kubrynski - * @author Dave Syer - * @author Phillip Webb - * @since 1.0.2 - * @deprecated since 1.2.0 in favor of {@link ApplicationPidFileWriter} - */ -@Deprecated -public class ApplicationPidListener extends ApplicationPidFileWriter { - - public ApplicationPidListener() { - super(); - setTriggerEventType(ApplicationStartedEvent.class); - } - - public ApplicationPidListener(File file) { - super(file); - setTriggerEventType(ApplicationStartedEvent.class); - } - - public ApplicationPidListener(String filename) { - super(filename); - setTriggerEventType(ApplicationStartedEvent.class); - } - -} diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/VanillaPublicMetricsTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/VanillaPublicMetricsTests.java deleted file mode 100644 index 221e6f1852d..00000000000 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/VanillaPublicMetricsTests.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2012-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.actuate.endpoint; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import org.junit.Test; -import org.springframework.boot.actuate.metrics.Metric; -import org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository; - -import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - -/** - * Tests for {@link VanillaPublicMetrics}. - * - * @author Phillip Webb - * @author Christian Dupuis - */ -@Deprecated -public class VanillaPublicMetricsTests { - - @Test - public void testMetrics() throws Exception { - InMemoryMetricRepository repository = new InMemoryMetricRepository(); - repository.set(new Metric("a", 0.5, new Date())); - VanillaPublicMetrics publicMetrics = new VanillaPublicMetrics(repository); - Map> results = new HashMap>(); - for (Metric metric : publicMetrics.metrics()) { - results.put(metric.getName(), metric); - } - assertTrue(results.containsKey("mem")); - assertTrue(results.containsKey("mem.free")); - assertThat(results.get("a").getValue().doubleValue(), equalTo(0.5)); - } - - @Test - public void testSystemMetrics() throws Exception { - InMemoryMetricRepository repository = new InMemoryMetricRepository(); - repository.set(new Metric("a", 0.5, new Date())); - VanillaPublicMetrics publicMetrics = new VanillaPublicMetrics(repository); - Map> results = new HashMap>(); - for (Metric metric : publicMetrics.metrics()) { - results.put(metric.getName(), metric); - } - assertTrue(results.containsKey("mem")); - assertTrue(results.containsKey("mem.free")); - assertTrue(results.containsKey("processors")); - assertTrue(results.containsKey("uptime")); - - assertTrue(results.containsKey("heap.committed")); - assertTrue(results.containsKey("heap.init")); - assertTrue(results.containsKey("heap.used")); - assertTrue(results.containsKey("heap")); - - assertTrue(results.containsKey("threads.peak")); - assertTrue(results.containsKey("threads.daemon")); - assertTrue(results.containsKey("threads")); - - assertTrue(results.containsKey("classes.loaded")); - assertTrue(results.containsKey("classes.unloaded")); - assertTrue(results.containsKey("classes")); - } -} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClass.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClass.java index a20640e0c3d..4bfeb7ea6cd 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClass.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClass.java @@ -37,19 +37,16 @@ import org.springframework.context.annotation.Conditional; public @interface ConditionalOnMissingClass { /** - * The classes that must not be present. Since this annotation parsed by loading class - * bytecode it is safe to specify classes here that may ultimately not be on the - * classpath. - * @return the classes that must be present - * @deprecated Since 1.1.0 due to the fact that the reflection errors can occur when - * beans containing the annotation remain in the context. Use {@link #name()} instead. + * The names of the classes that must not be present. + * @return the names of the classes that must not be present */ - @Deprecated - public Class[] value() default {}; + public String[] value() default {}; /** - * The classes names that must not be present. - * @return the class names that must be present. + * An alias for {@link #value} specifying the names of the classes that must not be + * present. + * @return the class names that must not be present. + * @deprecated since 1.3.0 in favor of {@link #value}. */ public String[] name() default {}; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateResolver.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateResolver.java deleted file mode 100644 index a724063860c..00000000000 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateResolver.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2012-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.boot.autoconfigure.groovy.template; - -import groovy.text.markup.MarkupTemplateEngine; -import groovy.text.markup.TemplateConfiguration; -import groovy.text.markup.TemplateResolver; - -import java.io.IOException; -import java.net.URL; - -import org.springframework.context.i18n.LocaleContextHolder; -import org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer; -import org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver; - -/** - * A custom {@link groovy.text.markup.TemplateResolver template resolver} which resolves - * templates using the locale found in the thread locale. This resolver ignores the - * template engine configuration locale. - * - * @author Cédric Champeau - * @since 1.1.0 - * @deprecated since 1.2 in favor of Spring 4.1's {@link GroovyMarkupViewResolver} and - * {@link GroovyMarkupConfigurer}. - */ -@Deprecated -public class GroovyTemplateResolver implements TemplateResolver { - - private ClassLoader templateClassLoader; - - @Override - public void configure(final ClassLoader templateClassLoader, - final TemplateConfiguration configuration) { - this.templateClassLoader = templateClassLoader; - } - - @Override - public URL resolveTemplate(final String templatePath) throws IOException { - MarkupTemplateEngine.TemplateResource templateResource = MarkupTemplateEngine.TemplateResource - .parse(templatePath); - URL resource = this.templateClassLoader.getResource(templateResource.withLocale( - LocaleContextHolder.getLocale().toString().replace("-", "_")).toString()); - if (resource == null) { - // no resource found with the default locale, try without any locale - resource = this.templateClassLoader.getResource(templateResource.withLocale( - null).toString()); - } - if (resource == null) { - throw new IOException("Unable to load template:" + templatePath); - } - return resource; - } - -} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java index f42e493681e..51b03c85a61 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java @@ -35,7 +35,6 @@ import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.web.HttpMapperProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; @@ -50,7 +49,6 @@ import org.springframework.util.ReflectionUtils; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.datatype.joda.cfg.JacksonJodaDateFormat; import com.fasterxml.jackson.datatype.joda.ser.DateTimeSerializer; @@ -72,7 +70,6 @@ import com.fasterxml.jackson.datatype.joda.ser.DateTimeSerializer; */ @Configuration @ConditionalOnClass(ObjectMapper.class) -@SuppressWarnings("deprecation") public class JacksonAutoConfiguration { @Autowired @@ -151,7 +148,7 @@ public class JacksonAutoConfiguration { @Configuration @ConditionalOnClass({ ObjectMapper.class, Jackson2ObjectMapperBuilder.class }) - @EnableConfigurationProperties({ HttpMapperProperties.class, JacksonProperties.class }) + @EnableConfigurationProperties(JacksonProperties.class) static class JacksonObjectMapperBuilderConfiguration implements ApplicationContextAware { @@ -160,22 +157,11 @@ public class JacksonAutoConfiguration { @Autowired private JacksonProperties jacksonProperties; - @Autowired - private HttpMapperProperties httpMapperProperties; - @Bean @ConditionalOnMissingBean(Jackson2ObjectMapperBuilder.class) public Jackson2ObjectMapperBuilder jacksonObjectMapperBuilder() { Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder(); builder.applicationContext(this.applicationContext); - Boolean isJsonSortKeys = this.httpMapperProperties.isJsonSortKeys(); - if (isJsonSortKeys != null && isJsonSortKeys) { - builder.featuresToEnable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS); - } - Boolean isJsonPrettyPrint = this.httpMapperProperties.isJsonPrettyPrint(); - if (isJsonPrettyPrint != null && isJsonPrettyPrint) { - builder.featuresToEnable(SerializationFeature.INDENT_OUTPUT); - } if (this.jacksonProperties.getSerializationInclusion() != null) { builder.serializationInclusion(this.jacksonProperties .getSerializationInclusion()); diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java index 72d479f4977..63f255fc9e8 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java @@ -21,8 +21,6 @@ import java.util.Map; import javax.sql.DataSource; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.jdbc.EmbeddedDatabaseConnection; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.orm.jpa.vendor.Database; @@ -38,8 +36,6 @@ import org.springframework.util.StringUtils; @ConfigurationProperties(prefix = "spring.jpa") public class JpaProperties { - private static final Log logger = LogFactory.getLog(JpaProperties.class); - /** * Additional native properties to set on the JPA provider. */ @@ -151,13 +147,6 @@ public class JpaProperties { this.namingStrategy = namingStrategy; } - @Deprecated - public void setNamingstrategy(Class namingStrategy) { - logger.warn("The property spring.jpa.namingstrategy has been renamed, " - + "please update your configuration to use namingStrategy or naming-strategy or naming_strategy"); - this.setNamingStrategy(namingStrategy); - } - public String getDdlAuto() { return this.ddlAuto; } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration.java index b0d64fbf357..2469a61c9f9 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration.java @@ -123,7 +123,7 @@ public class RedisAutoConfiguration { * Redis connection configuration. */ @Configuration - @ConditionalOnMissingClass(name = "org.apache.commons.pool2.impl.GenericObjectPool") + @ConditionalOnMissingClass("org.apache.commons.pool2.impl.GenericObjectPool") protected static class RedisConnectionConfiguration extends AbstractRedisConfiguration { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java index 8081866b908..ef0dded0646 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java @@ -202,7 +202,7 @@ public class SpringBootWebSecurityConfiguration { // Pull in a plain @EnableWebSecurity if Spring MVC is not available @ConditionalOnMissingBean(WebMvcSecurityConfigurationConditions.class) - @ConditionalOnMissingClass(name = "org.springframework.web.servlet.support.RequestDataValueProcessor") + @ConditionalOnMissingClass("org.springframework.web.servlet.support.RequestDataValueProcessor") @Configuration @EnableWebSecurity protected static class DefaultWebSecurityConfiguration { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialWebAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialWebAutoConfiguration.java index a46a2a80ec5..d91ae49c2f2 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialWebAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialWebAutoConfiguration.java @@ -125,7 +125,7 @@ public class SocialWebAutoConfiguration { @Configuration @EnableSocial @ConditionalOnWebApplication - @ConditionalOnMissingClass(name = "org.springframework.security.core.context.SecurityContextHolder") + @ConditionalOnMissingClass("org.springframework.security.core.context.SecurityContextHolder") protected static class AnonymousUserIdSourceConfig extends SocialConfigurerAdapter { @Override diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractViewResolverProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractViewResolverProperties.java index defb3cb4afb..4dc33ee6c2f 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractViewResolverProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractViewResolverProperties.java @@ -101,24 +101,6 @@ public abstract class AbstractViewResolverProperties { this.contentType = contentType; } - /** - * @deprecated since 1.2.0 in favor of {@link #getCharset()} - * @return the charset - */ - @Deprecated - public String getCharSet() { - return getCharset(); - } - - /** - * @deprecated since 1.2.0 in favor of {@link #setCharset(String)} - * @param charSet the charset - */ - @Deprecated - public void setCharSet(String charSet) { - setCharset(charSet); - } - public String getCharset() { return this.charset; } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMapperProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMapperProperties.java deleted file mode 100644 index a4282023836..00000000000 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMapperProperties.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2012-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.autoconfigure.web; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.jackson.JacksonProperties; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.http.converter.HttpMessageConverter; - -import com.fasterxml.jackson.databind.SerializationFeature; - -/** - * Configuration properties to configure {@link HttpMessageConverter}s. - * - * @author Dave Syer - * @author Piotr Maj - * @author Sebastien Deleuze - * @deprecated in 1.2.0 favor of {@link JacksonProperties} - */ -@ConfigurationProperties(prefix = "http.mappers", ignoreUnknownFields = false) -@Deprecated -public class HttpMapperProperties { - - private final Log logger = LogFactory.getLog(HttpMapperProperties.class); - - /** - * Enable json pretty print. - */ - private Boolean jsonPrettyPrint; - - /** - * Enable key sorting. - */ - private Boolean jsonSortKeys; - - public void setJsonPrettyPrint(Boolean jsonPrettyPrint) { - this.logger.warn(getDeprecationMessage("http.mappers.json-pretty-print", - SerializationFeature.INDENT_OUTPUT)); - this.jsonPrettyPrint = jsonPrettyPrint; - } - - public Boolean isJsonPrettyPrint() { - return this.jsonPrettyPrint; - } - - public void setJsonSortKeys(Boolean jsonSortKeys) { - this.logger.warn(getDeprecationMessage("http.mappers.json-sort-keys", - SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS)); - this.jsonSortKeys = jsonSortKeys; - } - - public Boolean isJsonSortKeys() { - return this.jsonSortKeys; - } - - private String getDeprecationMessage(String property, - SerializationFeature alternativeFeature) { - return String.format("%s is deprecated. If you are using Jackson," - + " spring.jackson.serialization.%s=true should be used instead.", - property, alternativeFeature.name()); - } - -} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JacksonHttpMessageConvertersConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JacksonHttpMessageConvertersConfiguration.java index 9e315c65157..316c43cb07c 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JacksonHttpMessageConvertersConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JacksonHttpMessageConvertersConfiguration.java @@ -16,12 +16,10 @@ package org.springframework.boot.autoconfigure.web; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; @@ -43,26 +41,14 @@ class JacksonHttpMessageConvertersConfiguration { @Configuration @ConditionalOnClass(ObjectMapper.class) @ConditionalOnBean(ObjectMapper.class) - @EnableConfigurationProperties(HttpMapperProperties.class) @ConditionalOnProperty(name = HttpMessageConvertersAutoConfiguration.PREFERRED_MAPPER_PROPERTY, havingValue = "jackson", matchIfMissing = true) - @SuppressWarnings("deprecation") protected static class MappingJackson2HttpMessageConverterConfiguration { - // This can be removed when the deprecated class is removed (the ObjectMapper will - // already have all the correct properties). - @Autowired - private HttpMapperProperties properties = new HttpMapperProperties(); - @Bean @ConditionalOnMissingBean public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter( ObjectMapper objectMapper) { - MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter( - objectMapper); - if (this.properties.isJsonPrettyPrint() != null) { - converter.setPrettyPrint(this.properties.isJsonPrettyPrint()); - } - return converter; + return new MappingJackson2HttpMessageConverter(objectMapper); } } @@ -70,23 +56,14 @@ class JacksonHttpMessageConvertersConfiguration { @Configuration @ConditionalOnClass(XmlMapper.class) @ConditionalOnBean(Jackson2ObjectMapperBuilder.class) - @EnableConfigurationProperties(HttpMapperProperties.class) - @SuppressWarnings("deprecation") protected static class MappingJackson2XmlHttpMessageConverterConfiguration { - @Autowired - private HttpMapperProperties properties = new HttpMapperProperties(); - @Bean @ConditionalOnMissingBean public MappingJackson2XmlHttpMessageConverter mappingJackson2XmlHttpMessageConverter( Jackson2ObjectMapperBuilder builder) { - MappingJackson2XmlHttpMessageConverter converter = new MappingJackson2XmlHttpMessageConverter(); - converter.setObjectMapper(builder.createXmlMapper(true).build()); - if (this.properties.isJsonPrettyPrint() != null) { - converter.setPrettyPrint(this.properties.isJsonPrettyPrint()); - } - return converter; + return new MappingJackson2XmlHttpMessageConverter(builder.createXmlMapper( + true).build()); } } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClassTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClassTests.java index 280c4857a81..5c800ae0297 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClassTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClassTests.java @@ -51,7 +51,7 @@ public class ConditionalOnMissingClassTests { } @Configuration - @ConditionalOnMissingClass(ConditionalOnMissingClassTests.class) + @ConditionalOnMissingClass("org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClassTests") protected static class BasicConfiguration { @Bean public String bar() { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java index 481854c9c2c..c5d3e935f43 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java @@ -355,28 +355,6 @@ public class JacksonAutoConfigurationTests { DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)); } - @Test - public void httpMappersJsonPrettyPrintIsApplied() { - this.context.register(JacksonAutoConfiguration.class); - EnvironmentTestUtils.addEnvironment(this.context, - "http.mappers.json-pretty-print:true"); - this.context.refresh(); - ObjectMapper objectMapper = this.context.getBean(ObjectMapper.class); - assertTrue(objectMapper.getSerializationConfig().isEnabled( - SerializationFeature.INDENT_OUTPUT)); - } - - @Test - public void httpMappersJsonSortKeysIsApplied() { - this.context.register(JacksonAutoConfiguration.class); - EnvironmentTestUtils.addEnvironment(this.context, - "http.mappers.json-sort-keys:true"); - this.context.refresh(); - ObjectMapper objectMapper = this.context.getBean(ObjectMapper.class); - assertTrue(objectMapper.getSerializationConfig().isEnabled( - SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS)); - } - @Test public void moduleBeansAndWellKnownModulesAreRegisteredWithTheObjectMapperBuilder() { this.context.register(ModuleConfig.class, JacksonAutoConfiguration.class); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java index 41370efcf1e..85b03ce7115 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java @@ -97,21 +97,6 @@ public class HibernateJpaAutoConfigurationTests extends AbstractJpaAutoConfigura assertThat(actual, equalTo("org.hibernate.cfg.EJB3NamingStrategy")); } - @Test - public void testNamingStrategyThatWorkedInOneDotOhContinuesToWork() { - EnvironmentTestUtils.addEnvironment(this.context, - "spring.jpa.hibernate.namingstrategy:" - + "org.hibernate.cfg.EJB3NamingStrategy"); - setupTestConfiguration(); - - this.context.refresh(); - LocalContainerEntityManagerFactoryBean bean = this.context - .getBean(LocalContainerEntityManagerFactoryBean.class); - String actual = (String) bean.getJpaPropertyMap().get( - "hibernate.ejb.naming_strategy"); - assertThat(actual, equalTo("org.hibernate.cfg.EJB3NamingStrategy")); - } - @Test public void testCustomNamingStrategyViaJpaProperties() throws Exception { EnvironmentTestUtils.addEnvironment(this.context, diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/HttpMessageConvertersAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/HttpMessageConvertersAutoConfigurationTests.java index f5e02e19686..7e8d952df4d 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/HttpMessageConvertersAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/HttpMessageConvertersAutoConfigurationTests.java @@ -21,7 +21,6 @@ import java.util.List; import org.junit.After; import org.junit.Test; -import org.springframework.beans.DirectFieldAccessor; import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration; import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.boot.test.EnvironmentTestUtils; @@ -38,7 +37,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; /** @@ -189,29 +187,6 @@ public class HttpMessageConvertersAutoConfigurationTests { assertConverterBeanRegisteredWithHttpMessageConverters(StringHttpMessageConverter.class); } - @Test - public void httpMapperPropertiesAreNotAppliedWhenNotConfigured() throws Exception { - this.context.register(JacksonObjectMapperConfig.class, - HttpMessageConvertersAutoConfiguration.class); - this.context.refresh(); - MappingJackson2HttpMessageConverter converter = this.context - .getBean(MappingJackson2HttpMessageConverter.class); - assertNull(new DirectFieldAccessor(converter).getPropertyValue("prettyPrint")); - } - - @Test - public void httpMapperPropertiesAreAppliedWhenConfigured() throws Exception { - this.context.register(JacksonObjectMapperConfig.class, - HttpMessageConvertersAutoConfiguration.class); - EnvironmentTestUtils.addEnvironment(this.context, - "http.mappers.jsonPrettyPrint:true"); - this.context.refresh(); - MappingJackson2HttpMessageConverter converter = this.context - .getBean(MappingJackson2HttpMessageConverter.class); - assertTrue((Boolean) new DirectFieldAccessor(converter) - .getPropertyValue("prettyPrint")); - } - private void assertConverterBeanExists(Class type, String beanName) { assertEquals(1, this.context.getBeansOfType(type).size()); List beanNames = Arrays.asList(this.context.getBeanDefinitionNames()); diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/JmsCompilerAutoConfiguration.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/JmsCompilerAutoConfiguration.java index 8fdb271470f..6407cb6f423 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/JmsCompilerAutoConfiguration.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/JmsCompilerAutoConfiguration.java @@ -44,14 +44,10 @@ public class JmsCompilerAutoConfiguration extends CompilerAutoConfiguration { } @Override - @SuppressWarnings("deprecation") public void applyImports(ImportCustomizer imports) throws CompilationFailedException { imports.addStarImports("javax.jms", "org.springframework.jms.annotation", "org.springframework.jms.config", "org.springframework.jms.core", "org.springframework.jms.listener", - "org.springframework.jms.listener.adapter").addImports( - org.springframework.boot.groovy.EnableJmsMessaging.class - .getCanonicalName()); + "org.springframework.jms.listener.adapter"); } - } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/RabbitCompilerAutoConfiguration.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/RabbitCompilerAutoConfiguration.java index 686fc76b247..fb1c243b770 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/RabbitCompilerAutoConfiguration.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/RabbitCompilerAutoConfiguration.java @@ -45,7 +45,6 @@ public class RabbitCompilerAutoConfiguration extends CompilerAutoConfiguration { } @Override - @SuppressWarnings("deprecation") public void applyImports(ImportCustomizer imports) throws CompilationFailedException { imports.addStarImports("org.springframework.amqp.rabbit.annotation", "org.springframework.amqp.rabbit.core", @@ -53,8 +52,6 @@ public class RabbitCompilerAutoConfiguration extends CompilerAutoConfiguration { "org.springframework.amqp.rabbit.connection", "org.springframework.amqp.rabbit.listener", "org.springframework.amqp.rabbit.listener.adapter", - "org.springframework.amqp.core").addImports( - org.springframework.boot.groovy.EnableRabbitMessaging.class.getName()); + "org.springframework.amqp.core"); } - } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableJmsMessaging.java b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableJmsMessaging.java deleted file mode 100644 index c24c4dc9223..00000000000 --- a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableJmsMessaging.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2012-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.groovy; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.springframework.boot.cli.compiler.autoconfigure.JmsCompilerAutoConfiguration; - -/** - * Pseudo annotation used to trigger {@link JmsCompilerAutoConfiguration}. - * - * @deprecated since 1.2.0 in favor of {@code EnableJms} - */ -@Target(ElementType.TYPE) -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Deprecated -public @interface EnableJmsMessaging { - -} diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableRabbitMessaging.java b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableRabbitMessaging.java deleted file mode 100644 index a5a7d737e2b..00000000000 --- a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableRabbitMessaging.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2012-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.groovy; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.springframework.boot.cli.compiler.autoconfigure.RabbitCompilerAutoConfiguration; - -/** - * Pseudo annotation used to trigger {@link RabbitCompilerAutoConfiguration}. - * - * @deprecated since 1.2.0 in favor of {@code EnableRabbit} - */ -@Target(ElementType.TYPE) -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Deprecated -public @interface EnableRabbitMessaging { - -} diff --git a/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index 598b07c83ff..4d2825b9303 100644 --- a/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -469,7 +469,6 @@ public class SpringApplication { * not exist or cannot be printed, a simple default is created. * @param environment the environment * @see #setShowBanner(boolean) - * @see #printBanner() */ protected void printBanner(Environment environment) { String location = environment.getProperty("banner.location", "banner.txt"); @@ -485,18 +484,10 @@ public class SpringApplication { this.banner.printBanner(environment, this.mainApplicationClass, System.out); return; } - printBanner(); + printDefaultBanner(); } - /** - * Print a simple banner message to the console. Subclasses can override this method - * to provide additional or alternative banners. - * @see #setShowBanner(boolean) - * @see #printBanner(Environment) - * @deprecated since 1.2.0 in favor of {@link #setBanner(Banner)} - */ - @Deprecated - protected void printBanner() { + private void printDefaultBanner() { DEFAULT_BANNER.printBanner(null, this.mainApplicationClass, System.out); } @@ -759,7 +750,7 @@ public class SpringApplication { * Sets if the Spring banner should be displayed when the application runs. Defaults * to {@code true}. * @param showBanner if the banner should be shown - * @see #printBanner() + * @see #printDefaultBanner() */ public void setShowBanner(boolean showBanner) { this.showBanner = showBanner; diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/ServletContextInitializerConfiguration.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/ServletContextInitializerConfiguration.java index 526c8ba7a13..28d333f985c 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/ServletContextInitializerConfiguration.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/ServletContextInitializerConfiguration.java @@ -18,7 +18,6 @@ package org.springframework.boot.context.embedded.jetty; import javax.servlet.ServletException; -import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.webapp.AbstractConfiguration; import org.eclipse.jetty.webapp.Configuration; @@ -36,19 +35,6 @@ public class ServletContextInitializerConfiguration extends AbstractConfiguratio private final ServletContextInitializer[] initializers; - /** - * Create a new {@link ServletContextInitializerConfiguration}. - * @param contextHandler the Jetty ContextHandler - * @param initializers the initializers that should be invoked - * @deprecated since 1.2.1 in favor of - * {@link #ServletContextInitializerConfiguration(ServletContextInitializer...)} - */ - @Deprecated - public ServletContextInitializerConfiguration(ContextHandler contextHandler, - ServletContextInitializer... initializers) { - this(initializers); - } - /** * Create a new {@link ServletContextInitializerConfiguration}. * @param initializers the initializers that should be invoked diff --git a/spring-boot/src/main/java/org/springframework/boot/json/SimpleJsonParser.java b/spring-boot/src/main/java/org/springframework/boot/json/SimpleJsonParser.java deleted file mode 100644 index f21703861ca..00000000000 --- a/spring-boot/src/main/java/org/springframework/boot/json/SimpleJsonParser.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2012-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.json; - -/** - * Really basic JSON parser for when you have nothing else available. Comes with some - * limitations with respect to the JSON specification (e.g. only supports String values), - * so users will probably prefer to have a library handle things instead (Jackson or Snake - * YAML are supported). - * - * @author Dave Syer - * @see JsonParserFactory - * @deprecated since 1.2.0 in favor of {@link BasicJsonParser}. - */ -@Deprecated -public class SimpleJsonParser extends BasicJsonParser { - -} diff --git a/spring-boot/src/main/java/org/springframework/boot/orm/jpa/SpringNamingStrategy.java b/spring-boot/src/main/java/org/springframework/boot/orm/jpa/SpringNamingStrategy.java deleted file mode 100644 index ec0b9a6d7b4..00000000000 --- a/spring-boot/src/main/java/org/springframework/boot/orm/jpa/SpringNamingStrategy.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.orm.jpa; - -import org.hibernate.cfg.NamingStrategy; - -/** - * Hibernate {@link NamingStrategy} that follows Spring recommended naming conventions. - * - * @author Phillip Webb - * @deprecated Since 1.2.0 in favor of - * {@link org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy} - */ -@Deprecated -@SuppressWarnings("serial") -public class SpringNamingStrategy extends - org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy { - -} diff --git a/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index 53781d18a4d..d85af62ac46 100644 --- a/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -39,6 +39,7 @@ import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEven import org.springframework.boot.context.event.ApplicationPreparedEvent; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.boot.context.event.ApplicationStartedEvent; +import org.springframework.boot.test.OutputCapture; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextInitializer; @@ -99,6 +100,9 @@ public class SpringApplicationTests { @Rule public ExpectedException thrown = ExpectedException.none(); + @Rule + public OutputCapture output = new OutputCapture(); + private ConfigurableApplicationContext context; private Environment getEnvironment() { @@ -171,22 +175,20 @@ public class SpringApplicationTests { } @Test - @SuppressWarnings("deprecation") public void customBanner() throws Exception { SpringApplication application = spy(new SpringApplication(ExampleConfig.class)); application.setWebEnvironment(false); application.run("--banner.location=classpath:test-banner.txt"); - verify(application, never()).printBanner(); + assertThat(this.output.toString(), startsWith("Running a Test!")); } @Test - @SuppressWarnings("deprecation") public void customBannerWithProperties() throws Exception { SpringApplication application = spy(new SpringApplication(ExampleConfig.class)); application.setWebEnvironment(false); application.run("--banner.location=classpath:test-banner-with-placeholder.txt", "--test.property=123456"); - verify(application, never()).printBanner(); + assertThat(this.output.toString(), startsWith("Running a Test!\n\n123456")); } @Test