Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
e3a53cb0
Commit
e3a53cb0
authored
May 14, 2015
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove classes and methods deprecated since 1.2 and earlier
Closes gh-2697
parent
9243faa3
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
27 additions
and
661 deletions
+27
-661
EndpointWebMvcChildContextConfiguration.java
...utoconfigure/EndpointWebMvcChildContextConfiguration.java
+1
-1
VanillaPublicMetrics.java
...framework/boot/actuate/endpoint/VanillaPublicMetrics.java
+0
-55
ApplicationPidListener.java
...framework/boot/actuate/system/ApplicationPidListener.java
+0
-53
VanillaPublicMetricsTests.java
...work/boot/actuate/endpoint/VanillaPublicMetricsTests.java
+0
-81
ConditionalOnMissingClass.java
...ot/autoconfigure/condition/ConditionalOnMissingClass.java
+7
-10
GroovyTemplateResolver.java
...autoconfigure/groovy/template/GroovyTemplateResolver.java
+0
-67
JacksonAutoConfiguration.java
.../boot/autoconfigure/jackson/JacksonAutoConfiguration.java
+1
-15
JpaProperties.java
...ngframework/boot/autoconfigure/orm/jpa/JpaProperties.java
+0
-11
RedisAutoConfiguration.java
...work/boot/autoconfigure/redis/RedisAutoConfiguration.java
+1
-1
SpringBootWebSecurityConfiguration.java
...onfigure/security/SpringBootWebSecurityConfiguration.java
+1
-1
SocialWebAutoConfiguration.java
...boot/autoconfigure/social/SocialWebAutoConfiguration.java
+1
-1
AbstractViewResolverProperties.java
...utoconfigure/template/AbstractViewResolverProperties.java
+0
-18
HttpMapperProperties.java
...ramework/boot/autoconfigure/web/HttpMapperProperties.java
+0
-78
JacksonHttpMessageConvertersConfiguration.java
...figure/web/JacksonHttpMessageConvertersConfiguration.java
+3
-26
ConditionalOnMissingClassTests.java
...toconfigure/condition/ConditionalOnMissingClassTests.java
+1
-1
JacksonAutoConfigurationTests.java
.../autoconfigure/jackson/JacksonAutoConfigurationTests.java
+0
-22
HibernateJpaAutoConfigurationTests.java
...configure/orm/jpa/HibernateJpaAutoConfigurationTests.java
+0
-15
HttpMessageConvertersAutoConfigurationTests.java
...gure/web/HttpMessageConvertersAutoConfigurationTests.java
+0
-25
JmsCompilerAutoConfiguration.java
.../compiler/autoconfigure/JmsCompilerAutoConfiguration.java
+1
-5
RabbitCompilerAutoConfiguration.java
...mpiler/autoconfigure/RabbitCompilerAutoConfiguration.java
+1
-4
EnableJmsMessaging.java
...a/org/springframework/boot/groovy/EnableJmsMessaging.java
+0
-38
EnableRabbitMessaging.java
...rg/springframework/boot/groovy/EnableRabbitMessaging.java
+0
-38
SpringApplication.java
...main/java/org/springframework/boot/SpringApplication.java
+3
-12
ServletContextInitializerConfiguration.java
...mbedded/jetty/ServletContextInitializerConfiguration.java
+0
-14
SimpleJsonParser.java
.../java/org/springframework/boot/json/SimpleJsonParser.java
+0
-32
SpringNamingStrategy.java
...rg/springframework/boot/orm/jpa/SpringNamingStrategy.java
+0
-33
SpringApplicationTests.java
...java/org/springframework/boot/SpringApplicationTests.java
+6
-4
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java
View file @
e3a53cb0
...
...
@@ -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
)
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/VanillaPublicMetrics.java
deleted
100644 → 0
View file @
9243faa3
/*
* 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
<
Metric
<?>>
metrics
()
{
Collection
<
Metric
<?>>
result
=
new
LinkedHashSet
<
Metric
<?>>();
for
(
Metric
<?>
metric
:
this
.
reader
.
findAll
())
{
result
.
add
(
metric
);
}
result
.
addAll
(
super
.
metrics
());
return
result
;
}
}
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/system/ApplicationPidListener.java
deleted
100644 → 0
View file @
9243faa3
/*
* 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
);
}
}
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/VanillaPublicMetricsTests.java
deleted
100644 → 0
View file @
9243faa3
/*
* 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
<
Double
>(
"a"
,
0.5
,
new
Date
()));
VanillaPublicMetrics
publicMetrics
=
new
VanillaPublicMetrics
(
repository
);
Map
<
String
,
Metric
<?>>
results
=
new
HashMap
<
String
,
Metric
<?>>();
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
<
Double
>(
"a"
,
0.5
,
new
Date
()));
VanillaPublicMetrics
publicMetrics
=
new
VanillaPublicMetrics
(
repository
);
Map
<
String
,
Metric
<?>>
results
=
new
HashMap
<
String
,
Metric
<?>>();
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"
));
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClass.java
View file @
e3a53cb0
...
...
@@ -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
{};
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateResolver.java
deleted
100644 → 0
View file @
9243faa3
/*
* 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
;
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java
View file @
e3a53cb0
...
...
@@ -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
());
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java
View file @
e3a53cb0
...
...
@@ -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
;
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration.java
View file @
e3a53cb0
...
...
@@ -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
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java
View file @
e3a53cb0
...
...
@@ -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
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialWebAutoConfiguration.java
View file @
e3a53cb0
...
...
@@ -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
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractViewResolverProperties.java
View file @
e3a53cb0
...
...
@@ -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
;
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMapperProperties.java
deleted
100644 → 0
View file @
9243faa3
/*
* 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
());
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JacksonHttpMessageConvertersConfiguration.java
View file @
e3a53cb0
...
...
@@ -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
());
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClassTests.java
View file @
e3a53cb0
...
...
@@ -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
()
{
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java
View file @
e3a53cb0
...
...
@@ -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
);
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java
View file @
e3a53cb0
...
...
@@ -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
,
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/HttpMessageConvertersAutoConfigurationTests.java
View file @
e3a53cb0
...
...
@@ -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
<
String
>
beanNames
=
Arrays
.
asList
(
this
.
context
.
getBeanDefinitionNames
());
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/JmsCompilerAutoConfiguration.java
View file @
e3a53cb0
...
...
@@ -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"
);
}
}
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/RabbitCompilerAutoConfiguration.java
View file @
e3a53cb0
...
...
@@ -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"
);
}
}
spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableJmsMessaging.java
deleted
100644 → 0
View file @
9243faa3
/*
* 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
{
}
spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableRabbitMessaging.java
deleted
100644 → 0
View file @
9243faa3
/*
* 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
{
}
spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
View file @
e3a53cb0
...
...
@@ -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
();
print
Default
Banner
();
}
/**
* 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 #print
Default
Banner()
*/
public
void
setShowBanner
(
boolean
showBanner
)
{
this
.
showBanner
=
showBanner
;
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/ServletContextInitializerConfiguration.java
View file @
e3a53cb0
...
...
@@ -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
...
...
spring-boot/src/main/java/org/springframework/boot/json/SimpleJsonParser.java
deleted
100644 → 0
View file @
9243faa3
/*
* 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
{
}
spring-boot/src/main/java/org/springframework/boot/orm/jpa/SpringNamingStrategy.java
deleted
100644 → 0
View file @
9243faa3
/*
* 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
{
}
spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java
View file @
e3a53cb0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment