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
3326841a
Commit
3326841a
authored
Oct 04, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formatting
parent
39ed0d4d
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
82 additions
and
77 deletions
+82
-77
EndpointWebMvcManagementContextConfiguration.java
...nfigure/EndpointWebMvcManagementContextConfiguration.java
+5
-4
HealthIndicatorAutoConfiguration.java
...tuate/autoconfigure/HealthIndicatorAutoConfiguration.java
+2
-1
InfoContributorProperties.java
...boot/actuate/autoconfigure/InfoContributorProperties.java
+0
-1
JolokiaAutoConfiguration.java
.../boot/actuate/autoconfigure/JolokiaAutoConfiguration.java
+1
-2
HealthIndicatorAutoConfigurationTests.java
.../autoconfigure/HealthIndicatorAutoConfigurationTests.java
+8
-9
AuthorizationAuditListenerTests.java
...oot/actuate/security/AuthorizationAuditListenerTests.java
+2
-2
JCacheCacheConfiguration.java
...rk/boot/autoconfigure/cache/JCacheCacheConfiguration.java
+1
-2
ConditionMessage.java
...mework/boot/autoconfigure/condition/ConditionMessage.java
+2
-2
SpringBootRepositoryRestConfigurer.java
...nfigure/data/rest/SpringBootRepositoryRestConfigurer.java
+2
-2
ProjectInfoAutoConfiguration.java
...boot/autoconfigure/info/ProjectInfoAutoConfiguration.java
+2
-1
DataSourceAutoConfiguration.java
.../boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
+2
-2
OAuth2ResourceServerConfiguration.java
...ty/oauth2/resource/OAuth2ResourceServerConfiguration.java
+2
-2
SessionCondition.java
...ramework/boot/autoconfigure/session/SessionCondition.java
+2
-2
OnEnabledResourceChainCondition.java
...ot/autoconfigure/web/OnEnabledResourceChainCondition.java
+1
-2
BatchAutoConfigurationTests.java
...boot/autoconfigure/batch/BatchAutoConfigurationTests.java
+15
-11
IntegrationAutoConfigurationTests.java
...figure/integration/IntegrationAutoConfigurationTests.java
+2
-2
SessionAutoConfigurationJdbcTests.java
...oconfigure/session/SessionAutoConfigurationJdbcTests.java
+8
-8
SessionAutoConfigurationRedisTests.java
...configure/session/SessionAutoConfigurationRedisTests.java
+4
-2
SpringBootTestContextBootstrapperExampleConfig.java
...strap/SpringBootTestContextBootstrapperExampleConfig.java
+2
-1
EventPublishingRunListener.java
...mework/boot/context/event/EventPublishingRunListener.java
+7
-7
EnvironmentPostProcessor.java
...rg/springframework/boot/env/EnvironmentPostProcessor.java
+9
-9
SpringPhysicalNamingStrategy.java
.../boot/orm/jpa/hibernate/SpringPhysicalNamingStrategy.java
+2
-1
ConfigFileApplicationListenerTests.java
...ot/context/config/ConfigFileApplicationListenerTests.java
+1
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.java
View file @
3326841a
...
...
@@ -183,14 +183,15 @@ public class EndpointWebMvcManagementContextConfiguration {
AnnotatedTypeMetadata
metadata
)
{
Environment
environment
=
context
.
getEnvironment
();
String
config
=
environment
.
resolvePlaceholders
(
"${logging.file:}"
);
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
"Log File"
);
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
"Log File"
);
if
(
StringUtils
.
hasText
(
config
))
{
return
ConditionOutcome
.
match
(
message
.
found
(
"logging.file"
).
items
(
config
));
return
ConditionOutcome
.
match
(
message
.
found
(
"logging.file"
).
items
(
config
));
}
config
=
environment
.
resolvePlaceholders
(
"${logging.path:}"
);
if
(
StringUtils
.
hasText
(
config
))
{
return
ConditionOutcome
.
match
(
message
.
found
(
"logging.path"
).
items
(
config
));
return
ConditionOutcome
.
match
(
message
.
found
(
"logging.path"
).
items
(
config
));
}
config
=
new
RelaxedPropertyResolver
(
environment
,
"endpoints.logfile."
)
.
getProperty
(
"external-file"
);
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java
View file @
3326841a
...
...
@@ -98,7 +98,8 @@ import org.springframework.mail.javamail.JavaMailSenderImpl;
MongoDataAutoConfiguration
.
class
,
RabbitAutoConfiguration
.
class
,
RedisAutoConfiguration
.
class
,
SolrAutoConfiguration
.
class
})
@EnableConfigurationProperties
({
HealthIndicatorProperties
.
class
})
@Import
({
ElasticsearchHealthIndicatorConfiguration
.
ElasticsearchClientHealthIndicatorConfiguration
.
class
,
@Import
({
ElasticsearchHealthIndicatorConfiguration
.
ElasticsearchClientHealthIndicatorConfiguration
.
class
,
ElasticsearchHealthIndicatorConfiguration
.
ElasticsearchJestHealthIndicatorConfiguration
.
class
})
public
class
HealthIndicatorAutoConfiguration
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/InfoContributorProperties.java
View file @
3326841a
...
...
@@ -34,7 +34,6 @@ public class InfoContributorProperties {
return
this
.
git
;
}
public
static
class
Git
{
/**
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfiguration.java
View file @
3326841a
...
...
@@ -98,8 +98,7 @@ public class JolokiaAutoConfiguration {
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
boolean
endpointsEnabled
=
isEnabled
(
context
,
"endpoints."
,
true
);
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
"Jolokia"
);
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
"Jolokia"
);
if
(
isEnabled
(
context
,
"endpoints.jolokia."
,
endpointsEnabled
))
{
return
ConditionOutcome
.
match
(
message
.
because
(
"enabled"
));
}
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java
View file @
3326841a
...
...
@@ -398,9 +398,9 @@ public class HealthIndicatorAutoConfigurationTests {
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"spring.data.elasticsearch.properties.path.home:target"
,
"management.health.diskspace.enabled:false"
);
this
.
context
.
register
(
JestClientConfiguration
.
class
,
JestAutoConfiguration
.
class
,
ElasticsearchAutoConfiguration
.
class
,
ManagementServerProperties
.
class
,
HealthIndicatorAutoConfiguration
.
class
);
this
.
context
.
register
(
JestClientConfiguration
.
class
,
JestAutoConfiguration
.
class
,
ElasticsearchAutoConfiguration
.
class
,
ManagementServerProperties
.
class
,
HealthIndicatorAutoConfiguration
.
class
);
this
.
context
.
refresh
();
Map
<
String
,
HealthIndicator
>
beans
=
this
.
context
...
...
@@ -414,9 +414,8 @@ public class HealthIndicatorAutoConfigurationTests {
public
void
elasticsearchJestHealthIndicator
()
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"management.health.diskspace.enabled:false"
);
this
.
context
.
register
(
JestClientConfiguration
.
class
,
JestAutoConfiguration
.
class
,
ManagementServerProperties
.
class
,
HealthIndicatorAutoConfiguration
.
class
);
this
.
context
.
register
(
JestClientConfiguration
.
class
,
JestAutoConfiguration
.
class
,
ManagementServerProperties
.
class
,
HealthIndicatorAutoConfiguration
.
class
);
this
.
context
.
refresh
();
Map
<
String
,
HealthIndicator
>
beans
=
this
.
context
...
...
@@ -432,9 +431,9 @@ public class HealthIndicatorAutoConfigurationTests {
"management.health.elasticsearch.enabled:false"
,
"spring.data.elasticsearch.properties.path.home:target"
,
"management.health.diskspace.enabled:false"
);
this
.
context
.
register
(
JestClientConfiguration
.
class
,
JestAutoConfiguration
.
class
,
ElasticsearchAutoConfiguration
.
class
,
ManagementServerProperties
.
class
,
HealthIndicatorAutoConfiguration
.
class
);
this
.
context
.
register
(
JestClientConfiguration
.
class
,
JestAutoConfiguration
.
class
,
ElasticsearchAutoConfiguration
.
class
,
ManagementServerProperties
.
class
,
HealthIndicatorAutoConfiguration
.
class
);
this
.
context
.
refresh
();
Map
<
String
,
HealthIndicator
>
beans
=
this
.
context
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java
View file @
3326841a
...
...
@@ -73,8 +73,8 @@ public class AuthorizationAuditListenerTests {
@Test
public
void
testDetailsAreIncludedInAuditEvent
()
throws
Exception
{
Object
details
=
new
Object
();
UsernamePasswordAuthenticationToken
authentication
=
new
UsernamePasswordAuthenticationToken
(
"user"
,
"password"
);
UsernamePasswordAuthenticationToken
authentication
=
new
UsernamePasswordAuthenticationToken
(
"user"
,
"password"
);
authentication
.
setDetails
(
details
);
this
.
listener
.
onApplicationEvent
(
new
AuthorizationFailureEvent
(
this
,
Arrays
.<
ConfigAttribute
>
asList
(
new
SecurityConfig
(
"USER"
)),
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java
View file @
3326841a
...
...
@@ -178,8 +178,7 @@ class JCacheCacheConfiguration {
@Override
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
"JCache"
);
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
"JCache"
);
RelaxedPropertyResolver
resolver
=
new
RelaxedPropertyResolver
(
context
.
getEnvironment
(),
"spring.cache.jcache."
);
if
(
resolver
.
containsProperty
(
"provider"
))
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java
View file @
3326841a
...
...
@@ -375,8 +375,8 @@ public final class ConditionMessage {
/**
* Indicate the items with a {@link Style}. For example
* {@code didNotFind("bean", "beans").items(Style.QUOTE, Collections.singleton("x")}
results in
* the message "did not find bean 'x'".
* {@code didNotFind("bean", "beans").items(Style.QUOTE, Collections.singleton("x")}
*
results in
the message "did not find bean 'x'".
* @param style the render style
* @param items the source of the items (may be {@code null})
* @return a built {@link ConditionMessage}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/SpringBootRepositoryRestConfigurer.java
View file @
3326841a
...
...
@@ -24,8 +24,8 @@ import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapt
import
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder
;
/**
* A {@code RepositoryRestConfigurer} that applies configuration items from
*
the
{@code spring.data.rest} namespace to Spring Data REST. Also, if a
* A {@code RepositoryRestConfigurer} that applies configuration items from
the
* {@code spring.data.rest} namespace to Spring Data REST. Also, if a
* {@link Jackson2ObjectMapperBuilder} is available, it is used to configure Spring Data
* REST's {@link ObjectMapper ObjectMappers}.
*
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java
View file @
3326841a
...
...
@@ -108,7 +108,8 @@ public class ProjectInfoAutoConfiguration {
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
"GitResource"
);
if
(
loader
.
getResource
(
location
).
exists
())
{
return
ConditionOutcome
.
match
(
message
.
found
(
"git info at"
).
items
(
location
));
return
ConditionOutcome
.
match
(
message
.
found
(
"git info at"
).
items
(
location
));
}
return
ConditionOutcome
.
noMatch
(
message
.
didNotFind
(
"git info at"
).
items
(
location
));
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
View file @
3326841a
...
...
@@ -232,8 +232,8 @@ public class DataSourceAutoConfiguration {
}
if
(
anyMatches
(
context
,
metadata
,
this
.
pooledCondition
,
this
.
embeddedCondition
))
{
return
ConditionOutcome
.
match
(
message
.
foundExactly
(
"existing auto-configured data source bean"
));
return
ConditionOutcome
.
match
(
message
.
foundExactly
(
"existing auto-configured data source bean"
));
}
return
ConditionOutcome
.
noMatch
(
message
.
didNotFind
(
"any existing data source bean"
).
atAll
());
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerConfiguration.java
View file @
3326841a
...
...
@@ -132,8 +132,8 @@ public class OAuth2ResourceServerConfiguration {
if
(
ClassUtils
.
isPresent
(
AUTHORIZATION_ANNOTATION
,
null
))
{
if
(
AuthorizationServerEndpointsConfigurationBeanCondition
.
matches
(
context
))
{
return
ConditionOutcome
.
match
(
message
.
found
(
"class"
).
items
(
AUTHORIZATION_ANNOTATION
));
return
ConditionOutcome
.
match
(
message
.
found
(
"class"
).
items
(
AUTHORIZATION_ANNOTATION
));
}
}
return
ConditionOutcome
.
noMatch
(
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionCondition.java
View file @
3326841a
...
...
@@ -58,8 +58,8 @@ class SessionCondition extends SpringBootCondition {
return
ConditionOutcome
.
match
(
message
.
found
(
"spring.session.store-type property"
).
items
(
sessionStoreType
));
}
return
ConditionOutcome
.
noMatch
(
message
.
found
(
"spring.session.store-type property"
).
items
(
value
));
return
ConditionOutcome
.
noMatch
(
message
.
found
(
"spring.session.store-type property"
).
items
(
value
));
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/OnEnabledResourceChainCondition.java
View file @
3326841a
...
...
@@ -50,8 +50,7 @@ class OnEnabledResourceChainCondition extends SpringBootCondition {
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
ConditionalOnEnabledResourceChain
.
class
);
if
(
match
==
null
)
{
if
(
ClassUtils
.
isPresent
(
WEBJAR_ASSET_LOCATOR
,
getClass
().
getClassLoader
()))
{
if
(
ClassUtils
.
isPresent
(
WEBJAR_ASSET_LOCATOR
,
getClass
().
getClassLoader
()))
{
return
ConditionOutcome
.
match
(
message
.
found
(
"class"
).
items
(
WEBJAR_ASSET_LOCATOR
));
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java
View file @
3326841a
...
...
@@ -92,8 +92,9 @@ public class BatchAutoConfigurationTests {
this
.
context
.
refresh
();
assertThat
(
this
.
context
.
getBean
(
JobLauncher
.
class
)).
isNotNull
();
assertThat
(
this
.
context
.
getBean
(
JobExplorer
.
class
)).
isNotNull
();
assertThat
(
this
.
context
.
getBean
(
BatchProperties
.
class
)
.
getInitializer
().
isEnabled
()).
isTrue
();
assertThat
(
this
.
context
.
getBean
(
BatchProperties
.
class
).
getInitializer
().
isEnabled
())
.
isTrue
();
assertThat
(
new
JdbcTemplate
(
this
.
context
.
getBean
(
DataSource
.
class
))
.
queryForList
(
"select * from BATCH_JOB_EXECUTION"
)).
isEmpty
();
}
...
...
@@ -193,8 +194,9 @@ public class BatchAutoConfigurationTests {
PropertyPlaceholderAutoConfiguration
.
class
);
this
.
context
.
refresh
();
assertThat
(
this
.
context
.
getBean
(
JobLauncher
.
class
)).
isNotNull
();
assertThat
(
this
.
context
.
getBean
(
BatchProperties
.
class
)
.
getInitializer
().
isEnabled
()).
isFalse
();
assertThat
(
this
.
context
.
getBean
(
BatchProperties
.
class
).
getInitializer
().
isEnabled
())
.
isFalse
();
this
.
expected
.
expect
(
BadSqlGrammarException
.
class
);
new
JdbcTemplate
(
this
.
context
.
getBean
(
DataSource
.
class
))
.
queryForList
(
"select * from BATCH_JOB_EXECUTION"
);
...
...
@@ -233,8 +235,9 @@ public class BatchAutoConfigurationTests {
PropertyPlaceholderAutoConfiguration
.
class
);
this
.
context
.
refresh
();
assertThat
(
this
.
context
.
getBean
(
JobLauncher
.
class
)).
isNotNull
();
assertThat
(
this
.
context
.
getBean
(
BatchProperties
.
class
)
.
getInitializer
().
isEnabled
()).
isTrue
();
assertThat
(
this
.
context
.
getBean
(
BatchProperties
.
class
).
getInitializer
().
isEnabled
())
.
isTrue
();
assertThat
(
new
JdbcTemplate
(
this
.
context
.
getBean
(
DataSource
.
class
))
.
queryForList
(
"select * from PREFIX_JOB_EXECUTION"
)).
isEmpty
();
JobExplorer
jobExplorer
=
this
.
context
.
getBean
(
JobExplorer
.
class
);
...
...
@@ -245,19 +248,20 @@ public class BatchAutoConfigurationTests {
}
@Test
public
void
testCustomTablePrefixWithDefaultSchemaDisablesInitializer
()
throws
Exception
{
public
void
testCustomTablePrefixWithDefaultSchemaDisablesInitializer
()
throws
Exception
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"spring.datasource.name:batchtest"
,
"spring.batch.tablePrefix:PREFIX_"
);
"spring.datasource.name:batchtest"
,
"spring.batch.tablePrefix:PREFIX_"
);
this
.
context
.
register
(
TestConfiguration
.
class
,
EmbeddedDataSourceConfiguration
.
class
,
HibernateJpaAutoConfiguration
.
class
,
BatchAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
);
this
.
context
.
refresh
();
assertThat
(
this
.
context
.
getBean
(
JobLauncher
.
class
)).
isNotNull
();
assertThat
(
this
.
context
.
getBean
(
BatchProperties
.
class
)
.
getInitializer
().
isEnabled
()).
isFalse
();
assertThat
(
this
.
context
.
getBean
(
BatchProperties
.
class
).
getInitializer
().
isEnabled
())
.
isFalse
();
this
.
expected
.
expect
(
BadSqlGrammarException
.
class
);
new
JdbcTemplate
(
this
.
context
.
getBean
(
DataSource
.
class
))
.
queryForList
(
"select * from BATCH_JOB_EXECUTION"
);
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java
View file @
3326841a
...
...
@@ -107,8 +107,8 @@ public class IntegrationAutoConfigurationTests {
public
void
primaryExporterIsAllowed
()
{
load
(
CustomMBeanExporter
.
class
);
assertThat
(
this
.
context
.
getBeansOfType
(
MBeanExporter
.
class
)).
hasSize
(
2
);
assertThat
(
this
.
context
.
getBean
(
MBeanExporter
.
class
))
.
isSameAs
(
this
.
context
.
getBean
(
"myMBeanExporter"
));
assertThat
(
this
.
context
.
getBean
(
MBeanExporter
.
class
))
.
isSameAs
(
this
.
context
.
getBean
(
"myMBeanExporter"
));
}
private
static
void
assertDomains
(
MBeanServer
mBeanServer
,
boolean
expected
,
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java
View file @
3326841a
...
...
@@ -54,8 +54,8 @@ public class SessionAutoConfigurationJdbcTests
JdbcOperationsSessionRepository
.
class
);
assertThat
(
new
DirectFieldAccessor
(
repository
).
getPropertyValue
(
"tableName"
))
.
isEqualTo
(
"SPRING_SESSION"
);
assertThat
(
this
.
context
.
getBean
(
SessionProperties
.
class
)
.
get
Jdbc
().
get
Initializer
().
isEnabled
()).
isTrue
();
assertThat
(
this
.
context
.
getBean
(
SessionProperties
.
class
)
.
getJdbc
()
.
getInitializer
().
isEnabled
()).
isTrue
();
assertThat
(
this
.
context
.
getBean
(
JdbcOperations
.
class
)
.
queryForList
(
"select * from SPRING_SESSION"
)).
isEmpty
();
}
...
...
@@ -70,8 +70,8 @@ public class SessionAutoConfigurationJdbcTests
JdbcOperationsSessionRepository
.
class
);
assertThat
(
new
DirectFieldAccessor
(
repository
).
getPropertyValue
(
"tableName"
))
.
isEqualTo
(
"SPRING_SESSION"
);
assertThat
(
this
.
context
.
getBean
(
SessionProperties
.
class
)
.
get
Jdbc
().
get
Initializer
().
isEnabled
()).
isFalse
();
assertThat
(
this
.
context
.
getBean
(
SessionProperties
.
class
)
.
getJdbc
()
.
getInitializer
().
isEnabled
()).
isFalse
();
this
.
thrown
.
expect
(
BadSqlGrammarException
.
class
);
assertThat
(
this
.
context
.
getBean
(
JdbcOperations
.
class
)
.
queryForList
(
"select * from SPRING_SESSION"
)).
isEmpty
();
...
...
@@ -88,8 +88,8 @@ public class SessionAutoConfigurationJdbcTests
JdbcOperationsSessionRepository
.
class
);
assertThat
(
new
DirectFieldAccessor
(
repository
).
getPropertyValue
(
"tableName"
))
.
isEqualTo
(
"FOO_BAR"
);
assertThat
(
this
.
context
.
getBean
(
SessionProperties
.
class
)
.
get
Jdbc
().
get
Initializer
().
isEnabled
()).
isTrue
();
assertThat
(
this
.
context
.
getBean
(
SessionProperties
.
class
)
.
getJdbc
()
.
getInitializer
().
isEnabled
()).
isTrue
();
assertThat
(
this
.
context
.
getBean
(
JdbcOperations
.
class
)
.
queryForList
(
"select * from FOO_BAR"
)).
isEmpty
();
}
...
...
@@ -104,8 +104,8 @@ public class SessionAutoConfigurationJdbcTests
JdbcOperationsSessionRepository
.
class
);
assertThat
(
new
DirectFieldAccessor
(
repository
).
getPropertyValue
(
"tableName"
))
.
isEqualTo
(
"FOO_BAR"
);
assertThat
(
this
.
context
.
getBean
(
SessionProperties
.
class
)
.
get
Jdbc
().
get
Initializer
().
isEnabled
()).
isFalse
();
assertThat
(
this
.
context
.
getBean
(
SessionProperties
.
class
)
.
getJdbc
()
.
getInitializer
().
isEnabled
()).
isFalse
();
this
.
thrown
.
expect
(
BadSqlGrammarException
.
class
);
assertThat
(
this
.
context
.
getBean
(
JdbcOperations
.
class
)
.
queryForList
(
"select * from SPRING_SESSION"
)).
isEmpty
();
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java
View file @
3326841a
...
...
@@ -50,7 +50,8 @@ public class SessionAutoConfigurationRedisTests
public
void
redisSessionStoreIsTheDefault
()
{
load
(
Collections
.<
Class
<?>>
singletonList
(
RedisAutoConfiguration
.
class
));
validateSpringSessionUsesRedis
();
this
.
output
.
expect
(
containsString
(
"Spring Session store type is mandatory: set 'spring.session.store-type=redis' in your configuration"
));
this
.
output
.
expect
(
containsString
(
"Spring Session store type is mandatory: set 'spring.session.store-type=redis' in your configuration"
));
}
@Test
...
...
@@ -58,7 +59,8 @@ public class SessionAutoConfigurationRedisTests
load
(
Collections
.<
Class
<?>>
singletonList
(
RedisAutoConfiguration
.
class
),
"spring.session.store-type=redis"
);
validateSpringSessionUsesRedis
();
this
.
output
.
expect
(
not
(
containsString
(
"Spring Session store type is mandatory: set 'spring.session.store-type=redis' in your configuration"
)));
this
.
output
.
expect
(
not
(
containsString
(
"Spring Session store type is mandatory: set 'spring.session.store-type=redis' in your configuration"
)));
}
private
void
validateSpringSessionUsesRedis
()
{
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperExampleConfig.java
View file @
3326841a
...
...
@@ -19,7 +19,8 @@ package org.springframework.boot.test.context.bootstrap;
import
org.springframework.boot.SpringBootConfiguration
;
/**
* Example configuration used in {@link SpringBootTestContextBootstrapperIntegrationTests}.
* Example configuration used in
* {@link SpringBootTestContextBootstrapperIntegrationTests}.
*
* @author Phillip Webb
*/
...
...
spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java
View file @
3326841a
...
...
@@ -28,9 +28,9 @@ import org.springframework.core.env.ConfigurableEnvironment;
/**
* {@link SpringApplicationRunListener} to publish {@link SpringApplicationEvent}s.
*
*
<p>Uses an internal {@link ApplicationEventMulticaster} for the events that are
*
fired
before the context is actually refreshed.
*
<p>
*
Uses an internal {@link ApplicationEventMulticaster} for the events that are fired
* before the context is actually refreshed.
*
* @author Phillip Webb
* @author Stephane Nicoll
...
...
@@ -59,8 +59,8 @@ public class EventPublishingRunListener implements SpringApplicationRunListener,
@Override
public
void
started
()
{
this
.
initialMulticaster
.
multicastEvent
(
new
ApplicationStartedEvent
(
this
.
application
,
this
.
args
));
this
.
initialMulticaster
.
multicastEvent
(
new
ApplicationStartedEvent
(
this
.
application
,
this
.
args
));
}
@Override
...
...
@@ -82,8 +82,8 @@ public class EventPublishingRunListener implements SpringApplicationRunListener,
}
context
.
addApplicationListener
(
listener
);
}
this
.
initialMulticaster
.
multicastEvent
(
new
ApplicationPreparedEvent
(
this
.
application
,
this
.
args
,
context
));
this
.
initialMulticaster
.
multicastEvent
(
new
ApplicationPreparedEvent
(
this
.
application
,
this
.
args
,
context
));
}
@Override
...
...
spring-boot/src/main/java/org/springframework/boot/env/EnvironmentPostProcessor.java
View file @
3326841a
...
...
@@ -23,15 +23,15 @@ import org.springframework.core.env.Environment;
/**
* Allows for customization of the application's {@link Environment} prior to the
* application context being refreshed.
*
*
<p>
EnvironmentPostProcessor implementations have to be registered in
* {@code META-INF/spring.factories}, using the fully qualified name of this
*
class as the
key.
*
*
<p>{@code EnvironmentPostProcessor} processors are encouraged to detect
*
whether Spring's {@link org.springframework.core.Ordered Ordered} interface has been
*
implemented or if the @{@link org.springframework.core.annotation.Order Order}
*
annotation is present and
to sort instances accordingly if so prior to invocation.
*
<p>
* EnvironmentPostProcessor implementations have to be registered in
* {@code META-INF/spring.factories}, using the fully qualified name of this
class as the
* key.
*
<p>
*
{@code EnvironmentPostProcessor} processors are encouraged to detect whether Spring's
*
{@link org.springframework.core.Ordered Ordered} interface has been implemented or if
*
the @{@link org.springframework.core.annotation.Order Order} annotation is present and
* to sort instances accordingly if so prior to invocation.
*
* @author Andy Wilkinson
* @author Stephane Nicoll
...
...
spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringPhysicalNamingStrategy.java
View file @
3326841a
...
...
@@ -67,7 +67,8 @@ public class SpringPhysicalNamingStrategy implements PhysicalNamingStrategy {
}
StringBuilder
text
=
new
StringBuilder
(
name
.
getText
().
replace
(
'.'
,
'_'
));
for
(
int
i
=
1
;
i
<
text
.
length
()
-
1
;
i
++)
{
if
(
isUnderscoreRequired
(
text
.
charAt
(
i
-
1
),
text
.
charAt
(
i
),
text
.
charAt
(
i
+
1
)))
{
if
(
isUnderscoreRequired
(
text
.
charAt
(
i
-
1
),
text
.
charAt
(
i
),
text
.
charAt
(
i
+
1
)))
{
text
.
insert
(
i
++,
'_'
);
}
}
...
...
spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java
View file @
3326841a
...
...
@@ -826,8 +826,7 @@ public class ConfigFileApplicationListenerTests {
assertThat
(
environment
.
containsProperty
(
"customprofile"
)).
isTrue
();
assertThat
(
environment
.
containsProperty
(
"customprofile-specific"
)).
isTrue
();
assertThat
(
environment
.
containsProperty
(
"customprofile-customdefault"
)).
isTrue
();
assertThat
(
environment
.
acceptsProfiles
(
"customdefault"
))
.
isTrue
();
assertThat
(
environment
.
acceptsProfiles
(
"customdefault"
)).
isTrue
();
}
private
Condition
<
ConfigurableEnvironment
>
matchingPropertySource
(
...
...
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