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
4c23afdc
Commit
4c23afdc
authored
Jan 25, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
e2cb7a75
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
55 deletions
+43
-55
WebEndpointAutoConfigurationTests.java
...igure/endpoint/web/WebEndpointAutoConfigurationTests.java
+6
-8
ServletEndpointRegistrar.java
...k/boot/actuate/endpoint/web/ServletEndpointRegistrar.java
+2
-3
RedisAutoConfigurationTests.java
...autoconfigure/data/redis/RedisAutoConfigurationTests.java
+10
-15
JestAutoConfigurationTests.java
...figure/elasticsearch/jest/JestAutoConfigurationTests.java
+8
-11
ProjectInfoAutoConfigurationTests.java
...autoconfigure/info/ProjectInfoAutoConfigurationTests.java
+5
-6
JooqAutoConfigurationTests.java
...k/boot/autoconfigure/jooq/JooqAutoConfigurationTests.java
+7
-7
LdapAutoConfigurationTests.java
...k/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java
+4
-4
PropertiesMigrationReport.java
...ontext/properties/migrator/PropertiesMigrationReport.java
+1
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfigurationTests.java
View file @
4c23afdc
...
@@ -80,18 +80,16 @@ public class WebEndpointAutoConfigurationTests {
...
@@ -80,18 +80,16 @@ public class WebEndpointAutoConfigurationTests {
@Test
@Test
public
void
webApplicationConfiguresExposeExcludePropertyEndpointFilter
()
{
public
void
webApplicationConfiguresExposeExcludePropertyEndpointFilter
()
{
this
.
contextRunner
.
run
((
context
)
->
{
this
.
contextRunner
.
run
((
context
)
->
assertThat
(
context
)
assertThat
(
context
).
getBeans
(
ExposeExcludePropertyEndpointFilter
.
class
)
.
getBeans
(
ExposeExcludePropertyEndpointFilter
.
class
)
.
containsKeys
(
"webIncludeExcludePropertyEndpointFilter"
,
.
containsKeys
(
"webIncludeExcludePropertyEndpointFilter"
,
"controllerIncludeExcludePropertyEndpointFilter"
);
"controllerIncludeExcludePropertyEndpointFilter"
));
});
}
}
@Test
@Test
public
void
contextShouldConfigureServletEndpointDiscoverer
()
{
public
void
contextShouldConfigureServletEndpointDiscoverer
()
{
this
.
contextRunner
.
run
((
context
)
->
{
this
.
contextRunner
.
run
((
context
)
->
assertThat
(
context
)
assertThat
(
context
).
hasSingleBean
(
ServletEndpointDiscoverer
.
class
);
.
hasSingleBean
(
ServletEndpointDiscoverer
.
class
));
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java
View file @
4c23afdc
...
@@ -52,9 +52,8 @@ public class ServletEndpointRegistrar implements ServletContextInitializer {
...
@@ -52,9 +52,8 @@ public class ServletEndpointRegistrar implements ServletContextInitializer {
@Override
@Override
public
void
onStartup
(
ServletContext
servletContext
)
throws
ServletException
{
public
void
onStartup
(
ServletContext
servletContext
)
throws
ServletException
{
this
.
servletEndpoints
.
forEach
((
servletEndpoint
)
->
{
this
.
servletEndpoints
register
(
servletContext
,
servletEndpoint
);
.
forEach
((
servletEndpoint
)
->
register
(
servletContext
,
servletEndpoint
));
});
}
}
private
void
register
(
ServletContext
servletContext
,
private
void
register
(
ServletContext
servletContext
,
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java
View file @
4c23afdc
...
@@ -160,11 +160,9 @@ public class RedisAutoConfigurationTests {
...
@@ -160,11 +160,9 @@ public class RedisAutoConfigurationTests {
.
withPropertyValues
(
"spring.redis.sentinel.master:mymaster"
,
.
withPropertyValues
(
"spring.redis.sentinel.master:mymaster"
,
"spring.redis.sentinel.nodes:"
"spring.redis.sentinel.nodes:"
+
StringUtils
.
collectionToCommaDelimitedString
(
sentinels
))
+
StringUtils
.
collectionToCommaDelimitedString
(
sentinels
))
.
run
((
context
)
->
{
.
run
((
context
)
->
assertThat
(
context
assertThat
(
context
.
getBean
(
LettuceConnectionFactory
.
class
)
.
getBean
(
LettuceConnectionFactory
.
class
).
isRedisSentinelAware
())
.
isRedisSentinelAware
()).
isTrue
();
.
isTrue
());
});
}
}
@Test
@Test
...
@@ -192,11 +190,9 @@ public class RedisAutoConfigurationTests {
...
@@ -192,11 +190,9 @@ public class RedisAutoConfigurationTests {
.
withPropertyValues
(
.
withPropertyValues
(
"spring.redis.cluster.nodes[0]:"
+
clusterNodes
.
get
(
0
),
"spring.redis.cluster.nodes[0]:"
+
clusterNodes
.
get
(
0
),
"spring.redis.cluster.nodes[1]:"
+
clusterNodes
.
get
(
1
))
"spring.redis.cluster.nodes[1]:"
+
clusterNodes
.
get
(
1
))
.
run
((
context
)
->
{
.
run
((
context
)
->
assertThat
(
context
assertThat
(
context
.
getBean
(
LettuceConnectionFactory
.
class
)
.
getBean
(
LettuceConnectionFactory
.
class
).
getClusterConnection
())
.
getClusterConnection
()).
isNotNull
();
.
isNotNull
());
});
}
}
@Test
@Test
...
@@ -206,12 +202,11 @@ public class RedisAutoConfigurationTests {
...
@@ -206,12 +202,11 @@ public class RedisAutoConfigurationTests {
.
withPropertyValues
(
"spring.redis.password=password"
,
.
withPropertyValues
(
"spring.redis.password=password"
,
"spring.redis.cluster.nodes[0]:"
+
clusterNodes
.
get
(
0
),
"spring.redis.cluster.nodes[0]:"
+
clusterNodes
.
get
(
0
),
"spring.redis.cluster.nodes[1]:"
+
clusterNodes
.
get
(
1
))
"spring.redis.cluster.nodes[1]:"
+
clusterNodes
.
get
(
1
))
.
run
((
context
)
->
{
.
run
((
context
)
->
assertThat
(
assertThat
(
context
.
getBean
(
LettuceConnectionFactory
.
class
).
getPassword
())
context
.
getBean
(
LettuceConnectionFactory
.
class
).
getPassword
())
.
isEqualTo
(
"password"
)
.
isEqualTo
(
"password"
);
}
);
);
}
}
private
LettucePoolingClientConfiguration
getPoolingClientConfiguration
(
private
LettucePoolingClientConfiguration
getPoolingClientConfiguration
(
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestAutoConfigurationTests.java
View file @
4c23afdc
...
@@ -74,9 +74,9 @@ public class JestAutoConfigurationTests {
...
@@ -74,9 +74,9 @@ public class JestAutoConfigurationTests {
@Test
@Test
public
void
jestClientOnLocalhostByDefault
()
{
public
void
jestClientOnLocalhostByDefault
()
{
this
.
contextRunner
.
run
((
context
)
->
{
this
.
contextRunner
assertThat
(
context
.
getBeansOfType
(
JestClient
.
class
)).
hasSize
(
1
);
.
run
((
context
)
->
assertThat
(
context
.
getBeansOfType
(
JestClient
.
class
))
}
);
.
hasSize
(
1
)
);
}
}
@Test
@Test
...
@@ -84,9 +84,8 @@ public class JestAutoConfigurationTests {
...
@@ -84,9 +84,8 @@ public class JestAutoConfigurationTests {
this
.
contextRunner
.
withUserConfiguration
(
CustomJestClient
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
CustomJestClient
.
class
)
.
withPropertyValues
(
.
withPropertyValues
(
"spring.elasticsearch.jest.uris[0]=http://localhost:9200"
)
"spring.elasticsearch.jest.uris[0]=http://localhost:9200"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
assertThat
(
context
.
getBeansOfType
(
JestClient
.
class
))
assertThat
(
context
.
getBeansOfType
(
JestClient
.
class
)).
hasSize
(
1
);
.
hasSize
(
1
));
});
}
}
@Test
@Test
...
@@ -120,11 +119,9 @@ public class JestAutoConfigurationTests {
...
@@ -120,11 +119,9 @@ public class JestAutoConfigurationTests {
.
withPropertyValues
(
.
withPropertyValues
(
"spring.elasticsearch.jest.uris=http://localhost:9200"
,
"spring.elasticsearch.jest.uris=http://localhost:9200"
,
"spring.elasticsearch.jest.proxy.host=proxy.example.com"
)
"spring.elasticsearch.jest.proxy.host=proxy.example.com"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
assertThat
(
context
.
getStartupFailure
())
assertThat
(
context
.
getStartupFailure
())
.
isInstanceOf
(
BeanCreationException
.
class
)
.
isInstanceOf
(
BeanCreationException
.
class
)
.
hasMessageContaining
(
"Proxy port must not be null"
));
.
hasMessageContaining
(
"Proxy port must not be null"
);
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfigurationTests.java
View file @
4c23afdc
...
@@ -44,9 +44,9 @@ public class ProjectInfoAutoConfigurationTests {
...
@@ -44,9 +44,9 @@ public class ProjectInfoAutoConfigurationTests {
@Test
@Test
public
void
gitPropertiesUnavailableIfResourceNotAvailable
()
{
public
void
gitPropertiesUnavailableIfResourceNotAvailable
()
{
this
.
contextRunner
.
run
((
context
)
->
{
this
.
contextRunner
assertThat
(
context
.
getBeansOfType
(
GitProperties
.
class
)).
isEmpty
();
.
run
((
context
)
->
assertThat
(
context
.
getBeansOfType
(
GitProperties
.
class
))
}
);
.
isEmpty
()
);
}
}
@Test
@Test
...
@@ -107,9 +107,8 @@ public class ProjectInfoAutoConfigurationTests {
...
@@ -107,9 +107,8 @@ public class ProjectInfoAutoConfigurationTests {
this
.
contextRunner
this
.
contextRunner
.
withPropertyValues
(
"spring.info.build.location="
.
withPropertyValues
(
"spring.info.build.location="
+
"classpath:/org/acme/no-build-info.properties"
)
+
"classpath:/org/acme/no-build-info.properties"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
assertThat
(
assertThat
(
context
.
getBeansOfType
(
BuildProperties
.
class
)).
hasSize
(
0
);
context
.
getBeansOfType
(
BuildProperties
.
class
)).
hasSize
(
0
));
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfigurationTests.java
View file @
4c23afdc
...
@@ -66,9 +66,9 @@ public class JooqAutoConfigurationTests {
...
@@ -66,9 +66,9 @@ public class JooqAutoConfigurationTests {
@Test
@Test
public
void
noDataSource
()
{
public
void
noDataSource
()
{
this
.
contextRunner
.
run
((
context
)
->
{
this
.
contextRunner
assertThat
(
context
.
getBeansOfType
(
DSLContext
.
class
)).
isEmpty
();
.
run
((
context
)
->
assertThat
(
context
.
getBeansOfType
(
DSLContext
.
class
))
}
);
.
isEmpty
()
);
}
}
@Test
@Test
...
@@ -151,10 +151,10 @@ public class JooqAutoConfigurationTests {
...
@@ -151,10 +151,10 @@ public class JooqAutoConfigurationTests {
@Test
@Test
public
void
relaxedBindingOfSqlDialect
()
{
public
void
relaxedBindingOfSqlDialect
()
{
this
.
contextRunner
.
withUserConfiguration
(
JooqDataSourceConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
JooqDataSourceConfiguration
.
class
)
.
withPropertyValues
(
"spring.jooq.sql-dialect:PoSTGrES"
)
.
run
((
context
)
->
{
.
withPropertyValues
(
"spring.jooq.sql-dialect:PoSTGrES"
)
assertThat
(
context
.
getBean
(
org
.
jooq
.
Configuration
.
class
).
dialect
())
.
run
((
context
)
->
assertThat
(
.
isEqualTo
(
SQLDialect
.
POSTGRES
);
context
.
getBean
(
org
.
jooq
.
Configuration
.
class
).
dialect
())
}
);
.
isEqualTo
(
SQLDialect
.
POSTGRES
)
);
}
}
private
static
class
AssertFetch
implements
TransactionalRunnable
{
private
static
class
AssertFetch
implements
TransactionalRunnable
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java
View file @
4c23afdc
...
@@ -39,7 +39,7 @@ public class LdapAutoConfigurationTests {
...
@@ -39,7 +39,7 @@ public class LdapAutoConfigurationTests {
@Test
@Test
public
void
contextSourceWithDefaultUrl
()
{
public
void
contextSourceWithDefaultUrl
()
{
this
.
contextRunner
.
run
(
context
->
{
this
.
contextRunner
.
run
(
(
context
)
->
{
LdapContextSource
contextSource
=
context
.
getBean
(
LdapContextSource
.
class
);
LdapContextSource
contextSource
=
context
.
getBean
(
LdapContextSource
.
class
);
String
[]
urls
=
(
String
[])
ReflectionTestUtils
.
getField
(
contextSource
,
String
[]
urls
=
(
String
[])
ReflectionTestUtils
.
getField
(
contextSource
,
"urls"
);
"urls"
);
...
@@ -51,7 +51,7 @@ public class LdapAutoConfigurationTests {
...
@@ -51,7 +51,7 @@ public class LdapAutoConfigurationTests {
@Test
@Test
public
void
contextSourceWithSingleUrl
()
{
public
void
contextSourceWithSingleUrl
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.ldap.urls:ldap://localhost:123"
)
this
.
contextRunner
.
withPropertyValues
(
"spring.ldap.urls:ldap://localhost:123"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
ContextSource
contextSource
=
context
.
getBean
(
ContextSource
.
class
);
ContextSource
contextSource
=
context
.
getBean
(
ContextSource
.
class
);
String
[]
urls
=
(
String
[])
ReflectionTestUtils
.
getField
(
contextSource
,
String
[]
urls
=
(
String
[])
ReflectionTestUtils
.
getField
(
contextSource
,
"urls"
);
"urls"
);
...
@@ -64,7 +64,7 @@ public class LdapAutoConfigurationTests {
...
@@ -64,7 +64,7 @@ public class LdapAutoConfigurationTests {
this
.
contextRunner
this
.
contextRunner
.
withPropertyValues
(
.
withPropertyValues
(
"spring.ldap.urls:ldap://localhost:123,ldap://mycompany:123"
)
"spring.ldap.urls:ldap://localhost:123,ldap://mycompany:123"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
ContextSource
contextSource
=
context
.
getBean
(
ContextSource
.
class
);
ContextSource
contextSource
=
context
.
getBean
(
ContextSource
.
class
);
LdapProperties
ldapProperties
=
context
.
getBean
(
LdapProperties
.
class
);
LdapProperties
ldapProperties
=
context
.
getBean
(
LdapProperties
.
class
);
String
[]
urls
=
(
String
[])
ReflectionTestUtils
.
getField
(
contextSource
,
String
[]
urls
=
(
String
[])
ReflectionTestUtils
.
getField
(
contextSource
,
...
@@ -83,7 +83,7 @@ public class LdapAutoConfigurationTests {
...
@@ -83,7 +83,7 @@ public class LdapAutoConfigurationTests {
"spring.ldap.anonymous-read-only:true"
,
"spring.ldap.anonymous-read-only:true"
,
"spring.ldap.base:cn=SpringDevelopers"
,
"spring.ldap.base:cn=SpringDevelopers"
,
"spring.ldap.baseEnvironment.java.naming.security.authentication:DIGEST-MD5"
)
"spring.ldap.baseEnvironment.java.naming.security.authentication:DIGEST-MD5"
)
.
run
(
context
->
{
.
run
(
(
context
)
->
{
LdapContextSource
contextSource
=
context
LdapContextSource
contextSource
=
context
.
getBean
(
LdapContextSource
.
class
);
.
getBean
(
LdapContextSource
.
class
);
assertThat
(
contextSource
.
getUserDn
()).
isEqualTo
(
"root"
);
assertThat
(
contextSource
.
getUserDn
()).
isEqualTo
(
"root"
);
...
...
spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReport.java
View file @
4c23afdc
...
@@ -75,7 +75,7 @@ class PropertiesMigrationReport {
...
@@ -75,7 +75,7 @@ class PropertiesMigrationReport {
report
.
append
(
String
.
format
(
"%nThe use of configuration keys that are no longer "
report
.
append
(
String
.
format
(
"%nThe use of configuration keys that are no longer "
+
"supported was found in the environment:%n%n"
));
+
"supported was found in the environment:%n%n"
));
append
(
report
,
content
,
append
(
report
,
content
,
metadata
->
"Reason: "
(
metadata
)
->
"Reason: "
+
(
StringUtils
.
hasText
(
metadata
.
getDeprecation
().
getReason
())
+
(
StringUtils
.
hasText
(
metadata
.
getDeprecation
().
getReason
())
?
metadata
.
getDeprecation
().
getReason
()
:
"none"
));
?
metadata
.
getDeprecation
().
getReason
()
:
"none"
));
report
.
append
(
String
.
format
(
"%n"
));
report
.
append
(
String
.
format
(
"%n"
));
...
...
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