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
7fc12bc8
Commit
7fc12bc8
authored
Aug 30, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
afda0ec1
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
80 additions
and
96 deletions
+80
-96
CloudFoundrySecurityService.java
...oot/actuate/cloudfoundry/CloudFoundrySecurityService.java
+1
-1
CloudFoundryWebEndpointServletHandlerMapping.java
...foundry/CloudFoundryWebEndpointServletHandlerMapping.java
+1
-1
Neo4jHealthIndicator.java
...ngframework/boot/actuate/health/Neo4jHealthIndicator.java
+2
-2
WebMvcEndpointInfrastructureAutoConfigurationTests.java
...e/WebMvcEndpointInfrastructureAutoConfigurationTests.java
+2
-2
CloudFoundryMvcWebEndpointIntegrationTests.java
...udfoundry/CloudFoundryMvcWebEndpointIntegrationTests.java
+10
-10
RequestMappingEndpointTests.java
...rk/boot/actuate/endpoint/RequestMappingEndpointTests.java
+2
-3
BackgroundPreinitializer.java
...ramework/boot/autoconfigure/BackgroundPreinitializer.java
+2
-1
AopAutoConfiguration.java
...ramework/boot/autoconfigure/aop/AopAutoConfiguration.java
+2
-1
DataSourceInitializedPublisher.java
...autoconfigure/orm/jpa/DataSourceInitializedPublisher.java
+2
-2
HibernateJpaAutoConfiguration.java
.../autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java
+2
-2
AuthenticationManagerConfiguration.java
...onfigure/security/AuthenticationManagerConfiguration.java
+3
-20
SpringBootSecurity.java
...ework/boot/autoconfigure/security/SpringBootSecurity.java
+1
-1
OAuth2SsoDefaultConfiguration.java
...security/oauth2/client/OAuth2SsoDefaultConfiguration.java
+1
-5
FlywayAutoConfigurationTests.java
...ot/autoconfigure/flyway/FlywayAutoConfigurationTests.java
+8
-6
H2ConsoleAutoConfigurationIntegrationTests.java
...figure/h2/H2ConsoleAutoConfigurationIntegrationTests.java
+4
-3
CustomHibernateJpaAutoConfigurationTests.java
...ure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java
+2
-1
HibernateDefaultDdlAutoProviderTests.java
...nfigure/orm/jpa/HibernateDefaultDdlAutoProviderTests.java
+13
-13
ConfigurationMetadata.java
...onfigurationprocessor/metadata/ConfigurationMetadata.java
+2
-3
EndpointPathResolver.java
...g/springframework/boot/endpoint/EndpointPathResolver.java
+1
-0
Operation.java
...ain/java/org/springframework/boot/endpoint/Operation.java
+2
-2
EndpointLinksResolver.java
...ingframework/boot/endpoint/web/EndpointLinksResolver.java
+1
-1
WebEndpointReactiveHandlerMapping.java
...point/web/reactive/WebEndpointReactiveHandlerMapping.java
+3
-3
DatabaseDriver.java
...in/java/org/springframework/boot/jdbc/DatabaseDriver.java
+1
-2
SchemaManagementProvider.java
...g/springframework/boot/jdbc/SchemaManagementProvider.java
+1
-0
SpringPhysicalNamingStrategy.java
.../boot/orm/jpa/hibernate/SpringPhysicalNamingStrategy.java
+2
-2
JettyServletWebServerFactory.java
...boot/web/embedded/jetty/JettyServletWebServerFactory.java
+4
-4
TomcatServletWebServerFactory.java
...ot/web/embedded/tomcat/TomcatServletWebServerFactory.java
+2
-2
AbstractWebEndpointIntegrationTests.java
...oot/endpoint/web/AbstractWebEndpointIntegrationTests.java
+1
-1
JerseyWebEndpointIntegrationTests.java
...ndpoint/web/jersey/JerseyWebEndpointIntegrationTests.java
+2
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cloudfoundry/CloudFoundrySecurityService.java
View file @
7fc12bc8
...
...
@@ -116,7 +116,7 @@ class CloudFoundrySecurityService {
}
private
Map
<
String
,
String
>
extractTokenKeys
(
Map
<?,
?>
response
)
{
Map
<
String
,
String
>
tokenKeys
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
tokenKeys
=
new
HashMap
<>();
for
(
Object
key
:
(
List
<?>)
response
.
get
(
"keys"
))
{
Map
<?,
?>
tokenKey
=
(
Map
<?,
?>)
key
;
tokenKeys
.
put
((
String
)
tokenKey
.
get
(
"kid"
),
(
String
)
tokenKey
.
get
(
"value"
));
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cloudfoundry/CloudFoundryWebEndpointServletHandlerMapping.java
View file @
7fc12bc8
...
...
@@ -101,7 +101,7 @@ class CloudFoundryWebEndpointServletHandlerMapping
return
Collections
.
singletonMap
(
"_links"
,
filteredLinks
);
}
filteredLinks
=
links
.
entrySet
().
stream
()
.
filter
(
e
->
e
.
getKey
().
equals
(
"self"
)
.
filter
(
(
e
)
->
e
.
getKey
().
equals
(
"self"
)
||
accessLevel
.
isAccessAllowed
(
e
.
getKey
()))
.
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
));
return
Collections
.
singletonMap
(
"_links"
,
filteredLinks
);
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Neo4jHealthIndicator.java
View file @
7fc12bc8
...
...
@@ -52,8 +52,8 @@ public class Neo4jHealthIndicator extends AbstractHealthIndicator {
protected
void
doHealthCheck
(
Health
.
Builder
builder
)
throws
Exception
{
Session
session
=
this
.
sessionFactory
.
openSession
();
Result
result
=
session
.
query
(
CYPHER
,
Collections
.
emptyMap
());
builder
.
up
().
withDetail
(
"nodes"
,
result
.
queryResults
()
.
iterator
().
next
().
get
(
"nodes"
));
builder
.
up
().
withDetail
(
"nodes"
,
result
.
queryResults
()
.
iterator
().
next
().
get
(
"nodes"
));
}
}
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/infrastructure/WebMvcEndpointInfrastructureAutoConfigurationTests.java
View file @
7fc12bc8
...
...
@@ -56,7 +56,7 @@ public class WebMvcEndpointInfrastructureAutoConfigurationTests {
@Test
public
void
webEndpointsAreDisabledByDefault
()
{
this
.
contextRunner
.
run
(
context
->
{
this
.
contextRunner
.
run
(
(
context
)
->
{
MockMvc
mvc
=
MockMvcBuilders
.
webAppContextSetup
(
context
).
build
();
assertThat
(
isExposed
(
mvc
,
HttpMethod
.
GET
,
"autoconfig"
)).
isFalse
();
assertThat
(
isExposed
(
mvc
,
HttpMethod
.
GET
,
"beans"
)).
isFalse
();
...
...
@@ -76,7 +76,7 @@ public class WebMvcEndpointInfrastructureAutoConfigurationTests {
public
void
webEndpointsCanBeEnabled
()
{
WebApplicationContextRunner
contextRunner
=
this
.
contextRunner
.
withPropertyValues
(
"endpoints.default.web.enabled=true"
);
contextRunner
.
run
(
context
->
{
contextRunner
.
run
(
(
context
)
->
{
MockMvc
mvc
=
MockMvcBuilders
.
webAppContextSetup
(
context
).
build
();
assertThat
(
isExposed
(
mvc
,
HttpMethod
.
GET
,
"autoconfig"
)).
isTrue
();
assertThat
(
isExposed
(
mvc
,
HttpMethod
.
GET
,
"beans"
)).
isTrue
();
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/cloudfoundry/CloudFoundryMvcWebEndpointIntegrationTests.java
View file @
7fc12bc8
...
...
@@ -69,22 +69,22 @@ public class CloudFoundryMvcWebEndpointIntegrationTests {
public
void
operationWithSecurityInterceptorForbidden
()
throws
Exception
{
given
(
securityService
.
getAccessLevel
(
any
(),
eq
(
"app-id"
)))
.
willReturn
(
AccessLevel
.
RESTRICTED
);
load
(
TestEndpointConfiguration
.
class
,
(
client
)
->
{
client
.
get
().
uri
(
"/cfApplication/test"
).
accept
(
MediaType
.
APPLICATION_JSON
)
.
header
(
"Authorization"
,
"bearer "
+
mockAccessToken
()).
exchange
(
)
.
expectStatus
().
isEqualTo
(
HttpStatus
.
FORBIDDEN
);
}
);
load
(
TestEndpointConfiguration
.
class
,
(
client
)
->
client
.
get
().
uri
(
"/cfApplication/test"
)
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
header
(
"Authorization"
,
"bearer "
+
mockAccessToken
()).
exchange
()
.
expectStatus
().
isEqualTo
(
HttpStatus
.
FORBIDDEN
)
);
}
@Test
public
void
operationWithSecurityInterceptorSuccess
()
throws
Exception
{
given
(
securityService
.
getAccessLevel
(
any
(),
eq
(
"app-id"
)))
.
willReturn
(
AccessLevel
.
FULL
);
load
(
TestEndpointConfiguration
.
class
,
(
client
)
->
{
client
.
get
().
uri
(
"/cfApplication/test"
).
accept
(
MediaType
.
APPLICATION_JSON
)
.
header
(
"Authorization"
,
"bearer "
+
mockAccessToken
()).
exchange
(
)
.
expectStatus
().
isEqualTo
(
HttpStatus
.
OK
);
}
);
load
(
TestEndpointConfiguration
.
class
,
(
client
)
->
client
.
get
().
uri
(
"/cfApplication/test"
)
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
header
(
"Authorization"
,
"bearer "
+
mockAccessToken
()).
exchange
()
.
expectStatus
().
isEqualTo
(
HttpStatus
.
OK
)
);
}
@Test
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/RequestMappingEndpointTests.java
View file @
7fc12bc8
...
...
@@ -135,9 +135,8 @@ public class RequestMappingEndpointTests {
OperationRequestPredicate
requestPredicate
=
new
OperationRequestPredicate
(
"test"
,
WebEndpointHttpMethod
.
GET
,
Collections
.
singletonList
(
"application/json"
),
Collections
.
singletonList
(
"application/json"
));
WebEndpointOperation
operation
=
new
WebEndpointOperation
(
OperationType
.
READ
,
(
arguments
)
->
"Invoked"
,
true
,
requestPredicate
,
"test"
);
WebEndpointOperation
operation
=
new
WebEndpointOperation
(
OperationType
.
READ
,
(
arguments
)
->
"Invoked"
,
true
,
requestPredicate
,
"test"
);
WebEndpointServletHandlerMapping
mapping
=
new
WebEndpointServletHandlerMapping
(
"application"
,
Collections
.
singleton
(
new
EndpointInfo
<>(
"test"
,
true
,
Collections
.
singleton
(
operation
))));
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java
View file @
7fc12bc8
...
...
@@ -46,7 +46,8 @@ import org.springframework.http.converter.support.AllEncompassingFormHttpMessage
public
class
BackgroundPreinitializer
implements
ApplicationListener
<
SpringApplicationEvent
>
{
private
static
final
AtomicBoolean
preinitializationStarted
=
new
AtomicBoolean
(
false
);
private
static
final
AtomicBoolean
preinitializationStarted
=
new
AtomicBoolean
(
false
);
private
static
final
CountDownLatch
preinitializationComplete
=
new
CountDownLatch
(
1
);
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/aop/AopAutoConfiguration.java
View file @
7fc12bc8
...
...
@@ -40,7 +40,8 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
* @see EnableAspectJAutoProxy
*/
@Configuration
@ConditionalOnClass
({
EnableAspectJAutoProxy
.
class
,
Aspect
.
class
,
Advice
.
class
,
AnnotatedElement
.
class
})
@ConditionalOnClass
({
EnableAspectJAutoProxy
.
class
,
Aspect
.
class
,
Advice
.
class
,
AnnotatedElement
.
class
})
@ConditionalOnProperty
(
prefix
=
"spring.aop"
,
name
=
"auto"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
public
class
AopAutoConfiguration
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DataSourceInitializedPublisher.java
View file @
7fc12bc8
...
...
@@ -92,8 +92,8 @@ class DataSourceInitializedPublisher implements BeanPostProcessor {
}
String
defaultDdlAuto
=
(
EmbeddedDatabaseConnection
.
isEmbedded
(
dataSource
)
?
"create-drop"
:
"none"
);
Map
<
String
,
String
>
hibernate
=
this
.
properties
.
getHibernateProperties
(
defaultDdlAuto
);
Map
<
String
,
String
>
hibernate
=
this
.
properties
.
getHibernateProperties
(
defaultDdlAuto
);
if
(
hibernate
.
containsKey
(
"hibernate.hbm2ddl.auto"
))
{
return
true
;
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java
View file @
7fc12bc8
...
...
@@ -109,8 +109,8 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration {
@Override
protected
Map
<
String
,
Object
>
getVendorProperties
()
{
Map
<
String
,
Object
>
vendorProperties
=
new
LinkedHashMap
<>();
String
defaultDdlMode
=
this
.
defaultDdlAutoProvider
.
getDefaultDdlAuto
(
getDataSource
());
String
defaultDdlMode
=
this
.
defaultDdlAutoProvider
.
getDefaultDdlAuto
(
getDataSource
());
vendorProperties
.
putAll
(
getProperties
().
getHibernateProperties
(
defaultDdlMode
));
return
vendorProperties
;
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/AuthenticationManagerConfiguration.java
View file @
7fc12bc8
...
...
@@ -17,7 +17,6 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
security
;
import
java.lang.reflect.Field
;
import
java.util.List
;
import
java.util.UUID
;
import
org.apache.commons.logging.Log
;
...
...
@@ -79,10 +78,8 @@ public class AuthenticationManagerConfiguration {
}
@Bean
public
static
SpringBootAuthenticationConfigurerAdapter
springBootAuthenticationConfigurerAdapter
(
SecurityProperties
securityProperties
,
List
<
SecurityPrerequisite
>
dependencies
)
{
return
new
SpringBootAuthenticationConfigurerAdapter
(
securityProperties
);
public
static
SpringBootAuthenticationConfigurerAdapter
springBootAuthenticationConfigurerAdapter
()
{
return
new
SpringBootAuthenticationConfigurerAdapter
();
}
@Bean
...
...
@@ -118,16 +115,9 @@ public class AuthenticationManagerConfiguration {
private
static
class
SpringBootAuthenticationConfigurerAdapter
extends
GlobalAuthenticationConfigurerAdapter
{
private
final
SecurityProperties
securityProperties
;
SpringBootAuthenticationConfigurerAdapter
(
SecurityProperties
securityProperties
)
{
this
.
securityProperties
=
securityProperties
;
}
@Override
public
void
init
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
auth
.
apply
(
new
DefaultInMemoryUserDetailsManagerConfigurer
(
this
.
securityProperties
));
auth
.
apply
(
new
DefaultInMemoryUserDetailsManagerConfigurer
());
}
}
...
...
@@ -156,13 +146,6 @@ public class AuthenticationManagerConfiguration {
private
static
class
DefaultInMemoryUserDetailsManagerConfigurer
extends
InMemoryUserDetailsManagerConfigurer
<
AuthenticationManagerBuilder
>
{
private
final
SecurityProperties
securityProperties
;
DefaultInMemoryUserDetailsManagerConfigurer
(
SecurityProperties
securityProperties
)
{
this
.
securityProperties
=
securityProperties
;
}
@Override
public
void
configure
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
if
(
auth
.
isConfigured
())
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootSecurity.java
View file @
7fc12bc8
...
...
@@ -81,7 +81,7 @@ public final class SpringBootSecurity {
*/
public
RequestMatcher
endpoints
(
Class
<?>...
endpoints
)
{
Assert
.
notEmpty
(
endpoints
,
"At least one endpoint must be specified."
);
List
<
String
>
paths
=
Arrays
.
stream
(
endpoints
).
map
(
e
->
{
List
<
String
>
paths
=
Arrays
.
stream
(
endpoints
).
map
(
(
e
)
->
{
if
(
e
.
isAnnotationPresent
(
Endpoint
.
class
))
{
return
e
.
getAnnotation
(
Endpoint
.
class
).
id
();
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2SsoDefaultConfiguration.java
View file @
7fc12bc8
...
...
@@ -40,12 +40,8 @@ public class OAuth2SsoDefaultConfiguration extends WebSecurityConfigurerAdapter
private
final
ApplicationContext
applicationContext
;
private
final
OAuth2SsoProperties
sso
;
public
OAuth2SsoDefaultConfiguration
(
ApplicationContext
applicationContext
,
OAuth2SsoProperties
sso
)
{
public
OAuth2SsoDefaultConfiguration
(
ApplicationContext
applicationContext
)
{
this
.
applicationContext
=
applicationContext
;
this
.
sso
=
sso
;
}
@Override
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java
View file @
7fc12bc8
...
...
@@ -120,12 +120,14 @@ public class FlywayAutoConfigurationTests {
registerAndRefresh
(
FlywayDataSourceConfiguration
.
class
,
EmbeddedDataSourceConfiguration
.
class
,
FlywayAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
);
FlywaySchemaManagementProvider
schemaManagementProvider
=
this
.
context
.
getBean
(
FlywaySchemaManagementProvider
.
class
);
assertThat
(
schemaManagementProvider
.
getSchemaManagement
(
this
.
context
.
getBean
(
DataSource
.
class
))).
isEqualTo
(
SchemaManagement
.
UNMANAGED
);
assertThat
(
schemaManagementProvider
.
getSchemaManagement
(
this
.
context
.
getBean
(
"flywayDataSource"
,
DataSource
.
class
))).
isEqualTo
(
SchemaManagement
.
MANAGED
);
FlywaySchemaManagementProvider
schemaManagementProvider
=
this
.
context
.
getBean
(
FlywaySchemaManagementProvider
.
class
);
assertThat
(
schemaManagementProvider
.
getSchemaManagement
(
this
.
context
.
getBean
(
DataSource
.
class
)))
.
isEqualTo
(
SchemaManagement
.
UNMANAGED
);
assertThat
(
schemaManagementProvider
.
getSchemaManagement
(
this
.
context
.
getBean
(
"flywayDataSource"
,
DataSource
.
class
)))
.
isEqualTo
(
SchemaManagement
.
MANAGED
);
}
@Test
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/h2/H2ConsoleAutoConfigurationIntegrationTests.java
View file @
7fc12bc8
...
...
@@ -61,15 +61,16 @@ public class H2ConsoleAutoConfigurationIntegrationTests {
public
void
noPrincipal
()
throws
Exception
{
MockMvc
mockMvc
=
MockMvcBuilders
.
webAppContextSetup
(
this
.
context
)
.
apply
(
springSecurity
()).
build
();
mockMvc
.
perform
(
get
(
"/h2-console/"
).
accept
(
MediaType
.
APPLICATION_JSON
)).
andExpect
(
status
().
isUnauthorized
());
mockMvc
.
perform
(
get
(
"/h2-console/"
).
accept
(
MediaType
.
APPLICATION_JSON
))
.
andExpect
(
status
().
isUnauthorized
());
}
@Test
public
void
userPrincipal
()
throws
Exception
{
MockMvc
mockMvc
=
MockMvcBuilders
.
webAppContextSetup
(
this
.
context
)
.
apply
(
springSecurity
()).
build
();
mockMvc
.
perform
(
get
(
"/h2-console/"
).
accept
(
MediaType
.
APPLICATION_JSON
)
.
with
(
user
(
"test"
).
roles
(
"USER"
)))
.
andExpect
(
status
().
isOk
())
mockMvc
.
perform
(
get
(
"/h2-console/"
).
accept
(
MediaType
.
APPLICATION_JSON
)
.
with
(
user
(
"test"
).
roles
(
"USER"
))).
andExpect
(
status
().
isOk
())
.
andExpect
(
header
().
string
(
"X-Frame-Options"
,
"SAMEORIGIN"
));
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java
View file @
7fc12bc8
...
...
@@ -70,7 +70,8 @@ public class CustomHibernateJpaAutoConfigurationTests {
HibernateJpaAutoConfiguration
.
class
);
this
.
context
.
refresh
();
JpaProperties
bean
=
this
.
context
.
getBean
(
JpaProperties
.
class
);
Map
<
String
,
String
>
hibernateProperties
=
bean
.
getHibernateProperties
(
"create-drop"
);
Map
<
String
,
String
>
hibernateProperties
=
bean
.
getHibernateProperties
(
"create-drop"
);
assertThat
(
hibernateProperties
.
get
(
"hibernate.ejb.naming_strategy"
)).
isNull
();
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateDefaultDdlAutoProviderTests.java
View file @
7fc12bc8
...
...
@@ -53,14 +53,14 @@ public class HibernateDefaultDdlAutoProviderTests {
+
org
.
apache
.
tomcat
.
jdbc
.
pool
.
DataSource
.
class
.
getName
(),
"spring.datasource.database:mysql"
,
"spring.datasource.url:jdbc:mysql://localhost/nonexistent"
,
"spring.jpa.database:MYSQL"
).
run
((
context
)
->
{
HibernateDefaultDdlAutoProvider
ddlAutoProvider
=
new
HibernateDefaultDdlAutoProvider
(
Collections
.
emptyList
());
assertThat
(
ddlAutoProvider
.
getDefaultDdlAuto
(
context
.
getBean
(
DataSource
.
class
)))
.
isEqualTo
(
"none"
);
"spring.jpa.database:MYSQL"
).
run
((
context
)
->
{
HibernateDefaultDdlAutoProvider
ddlAutoProvider
=
new
HibernateDefaultDdlAutoProvider
(
Collections
.
emptyList
());
assertThat
(
ddlAutoProvider
.
getDefaultDdlAuto
(
context
.
getBean
(
DataSource
.
class
)))
.
isEqualTo
(
"none"
);
});
});
}
@Test
...
...
@@ -68,8 +68,9 @@ public class HibernateDefaultDdlAutoProviderTests {
this
.
contextRunner
.
run
((
context
)
->
{
HibernateDefaultDdlAutoProvider
ddlAutoProvider
=
new
HibernateDefaultDdlAutoProvider
(
Collections
.
emptyList
());
assertThat
(
ddlAutoProvider
.
getDefaultDdlAuto
(
context
.
getBean
(
DataSource
.
class
))).
isEqualTo
(
"create-drop"
);
assertThat
(
ddlAutoProvider
.
getDefaultDdlAuto
(
context
.
getBean
(
DataSource
.
class
)))
.
isEqualTo
(
"create-drop"
);
});
}
...
...
@@ -82,8 +83,7 @@ public class HibernateDefaultDdlAutoProviderTests {
.
willReturn
(
SchemaManagement
.
MANAGED
);
HibernateDefaultDdlAutoProvider
ddlAutoProvider
=
new
HibernateDefaultDdlAutoProvider
(
Collections
.
singletonList
(
provider
));
assertThat
(
ddlAutoProvider
.
getDefaultDdlAuto
(
dataSource
)).
isEqualTo
(
"none"
);
assertThat
(
ddlAutoProvider
.
getDefaultDdlAuto
(
dataSource
)).
isEqualTo
(
"none"
);
});
}
...
...
@@ -96,8 +96,8 @@ public class HibernateDefaultDdlAutoProviderTests {
.
willReturn
(
SchemaManagement
.
UNMANAGED
);
HibernateDefaultDdlAutoProvider
ddlAutoProvider
=
new
HibernateDefaultDdlAutoProvider
(
Collections
.
singletonList
(
provider
));
assertThat
(
ddlAutoProvider
.
getDefaultDdlAuto
(
dataSource
))
.
isEqualTo
(
"create-drop"
);
assertThat
(
ddlAutoProvider
.
getDefaultDdlAuto
(
dataSource
))
.
isEqualTo
(
"create-drop"
);
});
}
...
...
spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java
View file @
7fc12bc8
...
...
@@ -213,9 +213,8 @@ public class ConfigurationMetadata {
public
String
toString
()
{
StringBuilder
result
=
new
StringBuilder
();
result
.
append
(
String
.
format
(
"items: %n"
));
this
.
items
.
values
().
forEach
(
itemMetadata
->
{
result
.
append
(
"\t"
).
append
(
String
.
format
(
"%s%n"
,
itemMetadata
));
});
this
.
items
.
values
().
forEach
((
itemMetadata
)
->
result
.
append
(
"\t"
)
.
append
(
String
.
format
(
"%s%n"
,
itemMetadata
)));
return
result
.
toString
();
}
...
...
spring-boot/src/main/java/org/springframework/boot/endpoint/EndpointPathResolver.java
View file @
7fc12bc8
...
...
@@ -22,6 +22,7 @@ package org.springframework.boot.endpoint;
* @author Madhura Bhave
* @since 2.0.0
*/
@FunctionalInterface
public
interface
EndpointPathResolver
{
/**
...
...
spring-boot/src/main/java/org/springframework/boot/endpoint/Operation.java
View file @
7fc12bc8
...
...
@@ -37,8 +37,8 @@ public class Operation {
* @param operationInvoker used to perform the operation
* @param blocking whether or not this is a blocking operation
*/
public
Operation
(
OperationType
type
,
OperationInvoker
operationInvoker
,
boolean
blocking
)
{
public
Operation
(
OperationType
type
,
OperationInvoker
operationInvoker
,
boolean
blocking
)
{
this
.
type
=
type
;
this
.
invoker
=
operationInvoker
;
this
.
blocking
=
blocking
;
...
...
spring-boot/src/main/java/org/springframework/boot/endpoint/web/EndpointLinksResolver.java
View file @
7fc12bc8
...
...
@@ -41,7 +41,7 @@ public class EndpointLinksResolver {
Collection
<
EndpointInfo
<
WebEndpointOperation
>>
webEndpoints
,
String
requestUrl
)
{
String
normalizedUrl
=
normalizeRequestUrl
(
requestUrl
);
Map
<
String
,
Link
>
links
=
new
LinkedHashMap
<
String
,
Link
>();
Map
<
String
,
Link
>
links
=
new
LinkedHashMap
<>();
links
.
put
(
"self"
,
new
Link
(
normalizedUrl
));
for
(
EndpointInfo
<
WebEndpointOperation
>
endpoint
:
webEndpoints
)
{
for
(
WebEndpointOperation
operation
:
endpoint
.
getOperations
())
{
...
...
spring-boot/src/main/java/org/springframework/boot/endpoint/web/reactive/WebEndpointReactiveHandlerMapping.java
View file @
7fc12bc8
...
...
@@ -213,16 +213,16 @@ public class WebEndpointReactiveHandlerMapping extends RequestMappingInfoHandler
.
onErrorReturn
(
ParameterMappingException
.
class
,
new
ResponseEntity
<>(
HttpStatus
.
BAD_REQUEST
))
.
defaultIfEmpty
(
new
ResponseEntity
<
Object
>(
httpMethod
==
HttpMethod
.
GET
new
ResponseEntity
<>(
httpMethod
==
HttpMethod
.
GET
?
HttpStatus
.
NOT_FOUND
:
HttpStatus
.
NO_CONTENT
));
}
private
ResponseEntity
<
Object
>
toResponseEntity
(
Object
response
)
{
if
(!(
response
instanceof
WebEndpointResponse
))
{
return
new
ResponseEntity
<
Object
>(
response
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
response
,
HttpStatus
.
OK
);
}
WebEndpointResponse
<?>
webEndpointResponse
=
(
WebEndpointResponse
<?>)
response
;
return
new
ResponseEntity
<
Object
>(
webEndpointResponse
.
getBody
(),
return
new
ResponseEntity
<>(
webEndpointResponse
.
getBody
(),
HttpStatus
.
valueOf
(
webEndpointResponse
.
getStatus
()));
}
...
...
spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java
View file @
7fc12bc8
...
...
@@ -123,8 +123,7 @@ public enum DatabaseDriver {
* Firebird.
*/
FIREBIRD
(
"Firebird"
,
"org.firebirdsql.jdbc.FBDriver"
,
"org.firebirdsql.ds.FBXADataSource"
,
"SELECT 1 FROM RDB$DATABASE"
)
{
"org.firebirdsql.ds.FBXADataSource"
,
"SELECT 1 FROM RDB$DATABASE"
)
{
@Override
protected
Collection
<
String
>
getUrlPrefixes
()
{
...
...
spring-boot/src/main/java/org/springframework/boot/jdbc/SchemaManagementProvider.java
View file @
7fc12bc8
...
...
@@ -24,6 +24,7 @@ import javax.sql.DataSource;
* @author Stephane Nicoll
* @since 2.0.0
*/
@FunctionalInterface
public
interface
SchemaManagementProvider
{
/**
...
...
spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringPhysicalNamingStrategy.java
View file @
7fc12bc8
...
...
@@ -77,8 +77,8 @@ public class SpringPhysicalNamingStrategy implements PhysicalNamingStrategy {
}
/**
* Get an identifier for the specified details. By default this method will return
*
an
identifier with the name adapted based on the result of
* Get an identifier for the specified details. By default this method will return
an
* identifier with the name adapted based on the result of
* {@link #isCaseInsensitive(JdbcEnvironment)}
* @param name the name of the identifier
* @param quoted if the identifier is quoted
...
...
spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java
View file @
7fc12bc8
...
...
@@ -90,8 +90,8 @@ import org.springframework.util.StringUtils;
* Can be initialized using Spring's {@link ServletContextInitializer}s or Jetty
* {@link Configuration}s.
* <p>
* Unless explicitly configured otherwise this factory will create servers that listen
*
for
HTTP requests on port 8080.
* Unless explicitly configured otherwise this factory will create servers that listen
for
* HTTP requests on port 8080.
*
* @author Phillip Webb
* @author Dave Syer
...
...
@@ -527,8 +527,8 @@ public class JettyServletWebServerFactory extends AbstractServletWebServerFactor
}
/**
* Post process the Jetty {@link WebAppContext} before it's used with the Jetty
Server.
* Subclasses can override this method to apply additional processing to the
* Post process the Jetty {@link WebAppContext} before it's used with the Jetty
* S
erver. S
ubclasses can override this method to apply additional processing to the
* {@link WebAppContext}.
* @param webAppContext the Jetty {@link WebAppContext}
*/
...
...
spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java
View file @
7fc12bc8
...
...
@@ -89,8 +89,8 @@ import org.springframework.util.StringUtils;
* {@link TomcatWebServer}s. Can be initialized using Spring's
* {@link ServletContextInitializer}s or Tomcat {@link LifecycleListener}s.
* <p>
* Unless explicitly configured otherwise this factory will create containers that
*
listen
for HTTP requests on port 8080.
* Unless explicitly configured otherwise this factory will create containers that
listen
* for HTTP requests on port 8080.
*
* @author Phillip Webb
* @author Dave Syer
...
...
spring-boot/src/test/java/org/springframework/boot/endpoint/web/AbstractWebEndpointIntegrationTests.java
View file @
7fc12bc8
...
...
@@ -563,7 +563,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
@ReadOperation
public
WebEndpointResponse
<
Resource
>
read
()
{
return
new
WebEndpointResponse
<
Resource
>(
return
new
WebEndpointResponse
<>(
new
ByteArrayResource
(
new
byte
[]
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
}),
200
);
}
...
...
spring-boot/src/test/java/org/springframework/boot/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java
View file @
7fc12bc8
...
...
@@ -69,7 +69,7 @@ public class JerseyWebEndpointIntegrationTests extends
@Bean
public
ServletRegistrationBean
<
ServletContainer
>
servletContainer
(
ResourceConfig
resourceConfig
)
{
return
new
ServletRegistrationBean
<
ServletContainer
>(
return
new
ServletRegistrationBean
<>(
new
ServletContainer
(
resourceConfig
),
"/*"
);
}
...
...
@@ -80,7 +80,7 @@ public class JerseyWebEndpointIntegrationTests extends
Collection
<
Resource
>
resources
=
new
JerseyEndpointResourceFactory
()
.
createEndpointResources
(
"endpoints"
,
endpointDiscoverer
.
discoverEndpoints
());
resourceConfig
.
registerResources
(
new
HashSet
<
Resource
>(
resources
));
resourceConfig
.
registerResources
(
new
HashSet
<>(
resources
));
resourceConfig
.
register
(
JacksonFeature
.
class
);
resourceConfig
.
register
(
new
ObjectMapperContextResolver
(
new
ObjectMapper
()),
ContextResolver
.
class
);
...
...
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