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
a841a6a1
Commit
a841a6a1
authored
May 04, 2017
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
3abd8d3a
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
54 additions
and
55 deletions
+54
-55
RedisReactiveAutoConfiguration.java
...oconfigure/data/redis/RedisReactiveAutoConfiguration.java
+5
-10
FlywayAutoConfiguration.java
...rk/boot/autoconfigure/flyway/FlywayAutoConfiguration.java
+1
-2
HazelcastClientFactory.java
.../boot/autoconfigure/hazelcast/HazelcastClientFactory.java
+2
-3
HazelcastConfigResourceCondition.java
...configure/hazelcast/HazelcastConfigResourceCondition.java
+2
-2
ThymeleafAutoConfiguration.java
...t/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java
+2
-4
RedisAutoConfigurationJedisTests.java
...onfigure/data/redis/RedisAutoConfigurationJedisTests.java
+1
-1
RedisReactiveAutoConfigurationTests.java
...igure/data/redis/RedisReactiveAutoConfigurationTests.java
+1
-3
HazelcastAutoConfigurationClientTests.java
...gure/hazelcast/HazelcastAutoConfigurationClientTests.java
+4
-3
AbstractFailureAnalyzer.java
...ngframework/boot/diagnostics/AbstractFailureAnalyzer.java
+1
-1
EmbeddedServerPortFileWriterTests.java
...mework/boot/system/EmbeddedServerPortFileWriterTests.java
+31
-22
UndertowServletWebServerFactoryTests.java
...bedded/undertow/UndertowServletWebServerFactoryTests.java
+4
-4
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisReactiveAutoConfiguration.java
View file @
a841a6a1
...
@@ -51,16 +51,11 @@ public class RedisReactiveAutoConfiguration {
...
@@ -51,16 +51,11 @@ public class RedisReactiveAutoConfiguration {
public
ReactiveRedisTemplate
<
Object
,
Object
>
reactiveRedisTemplate
(
public
ReactiveRedisTemplate
<
Object
,
Object
>
reactiveRedisTemplate
(
ReactiveRedisConnectionFactory
reactiveRedisConnectionFactory
,
ReactiveRedisConnectionFactory
reactiveRedisConnectionFactory
,
ResourceLoader
resourceLoader
)
{
ResourceLoader
resourceLoader
)
{
JdkSerializationRedisSerializer
jdkSerializer
=
new
JdkSerializationRedisSerializer
(
JdkSerializationRedisSerializer
jdkSerializer
=
resourceLoader
.
getClassLoader
());
new
JdkSerializationRedisSerializer
(
resourceLoader
.
getClassLoader
());
RedisSerializationContext
<
Object
,
Object
>
serializationContext
=
RedisSerializationContext
.
newSerializationContext
().
key
(
jdkSerializer
).
value
(
jdkSerializer
)
RedisSerializationContext
<
Object
,
Object
>
serializationContext
=
.
hashKey
(
jdkSerializer
).
hashValue
(
jdkSerializer
).
build
();
RedisSerializationContext
.
newSerializationContext
()
.
key
(
jdkSerializer
)
.
value
(
jdkSerializer
)
.
hashKey
(
jdkSerializer
)
.
hashValue
(
jdkSerializer
).
build
();
return
new
ReactiveRedisTemplate
<>(
reactiveRedisConnectionFactory
,
return
new
ReactiveRedisTemplate
<>(
reactiveRedisConnectionFactory
,
serializationContext
);
serializationContext
);
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java
View file @
a841a6a1
...
@@ -107,8 +107,7 @@ public class FlywayAutoConfiguration {
...
@@ -107,8 +107,7 @@ public class FlywayAutoConfiguration {
this
.
dataSource
=
dataSource
.
getIfUnique
();
this
.
dataSource
=
dataSource
.
getIfUnique
();
this
.
flywayDataSource
=
flywayDataSource
.
getIfAvailable
();
this
.
flywayDataSource
=
flywayDataSource
.
getIfAvailable
();
this
.
migrationStrategy
=
migrationStrategy
.
getIfAvailable
();
this
.
migrationStrategy
=
migrationStrategy
.
getIfAvailable
();
this
.
flywayCallbacks
=
flywayCallbacks
this
.
flywayCallbacks
=
flywayCallbacks
.
getIfAvailable
(
Collections:
:
emptyList
);
.
getIfAvailable
(
Collections:
:
emptyList
);
}
}
@PostConstruct
@PostConstruct
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientFactory.java
View file @
a841a6a1
...
@@ -56,7 +56,6 @@ public class HazelcastClientFactory {
...
@@ -56,7 +56,6 @@ public class HazelcastClientFactory {
this
.
clientConfig
=
clientConfig
;
this
.
clientConfig
=
clientConfig
;
}
}
private
ClientConfig
getClientConfig
(
Resource
clientConfigLocation
)
private
ClientConfig
getClientConfig
(
Resource
clientConfigLocation
)
throws
IOException
{
throws
IOException
{
URL
configUrl
=
clientConfigLocation
.
getURL
();
URL
configUrl
=
clientConfigLocation
.
getURL
();
...
@@ -69,8 +68,8 @@ public class HazelcastClientFactory {
...
@@ -69,8 +68,8 @@ public class HazelcastClientFactory {
*/
*/
public
HazelcastInstance
getHazelcastInstance
()
{
public
HazelcastInstance
getHazelcastInstance
()
{
if
(
StringUtils
.
hasText
(
this
.
clientConfig
.
getInstanceName
()))
{
if
(
StringUtils
.
hasText
(
this
.
clientConfig
.
getInstanceName
()))
{
return
HazelcastClient
.
getHazelcastClientByName
(
return
HazelcastClient
this
.
clientConfig
.
getInstanceName
());
.
getHazelcastClientByName
(
this
.
clientConfig
.
getInstanceName
());
}
}
return
HazelcastClient
.
newHazelcastClient
(
this
.
clientConfig
);
return
HazelcastClient
.
newHazelcastClient
(
this
.
clientConfig
);
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigResourceCondition.java
View file @
a841a6a1
...
@@ -48,8 +48,8 @@ public abstract class HazelcastConfigResourceCondition extends ResourceCondition
...
@@ -48,8 +48,8 @@ public abstract class HazelcastConfigResourceCondition extends ResourceCondition
protected
ConditionOutcome
getResourceOutcome
(
ConditionContext
context
,
protected
ConditionOutcome
getResourceOutcome
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
AnnotatedTypeMetadata
metadata
)
{
if
(
System
.
getProperty
(
this
.
configSystemProperty
)
!=
null
)
{
if
(
System
.
getProperty
(
this
.
configSystemProperty
)
!=
null
)
{
return
ConditionOutcome
.
match
(
startConditionMessage
()
return
ConditionOutcome
.
match
(
startConditionMessage
()
.
because
(
.
because
(
"System property '"
+
this
.
configSystemProperty
+
"' is set."
));
"System property '"
+
this
.
configSystemProperty
+
"' is set."
));
}
}
return
super
.
getResourceOutcome
(
context
,
metadata
);
return
super
.
getResourceOutcome
(
context
,
metadata
);
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java
View file @
a841a6a1
...
@@ -137,8 +137,7 @@ public class ThymeleafAutoConfiguration {
...
@@ -137,8 +137,7 @@ public class ThymeleafAutoConfiguration {
Collection
<
ITemplateResolver
>
templateResolvers
,
Collection
<
ITemplateResolver
>
templateResolvers
,
ObjectProvider
<
Collection
<
IDialect
>>
dialectsProvider
)
{
ObjectProvider
<
Collection
<
IDialect
>>
dialectsProvider
)
{
this
.
templateResolvers
=
templateResolvers
;
this
.
templateResolvers
=
templateResolvers
;
this
.
dialects
=
dialectsProvider
this
.
dialects
=
dialectsProvider
.
getIfAvailable
(
Collections:
:
emptyList
);
.
getIfAvailable
(
Collections:
:
emptyList
);
}
}
@Bean
@Bean
...
@@ -221,8 +220,7 @@ public class ThymeleafAutoConfiguration {
...
@@ -221,8 +220,7 @@ public class ThymeleafAutoConfiguration {
ThymeleafReactiveConfiguration
(
Collection
<
ITemplateResolver
>
templateResolvers
,
ThymeleafReactiveConfiguration
(
Collection
<
ITemplateResolver
>
templateResolvers
,
ObjectProvider
<
Collection
<
IDialect
>>
dialectsProvider
)
{
ObjectProvider
<
Collection
<
IDialect
>>
dialectsProvider
)
{
this
.
templateResolvers
=
templateResolvers
;
this
.
templateResolvers
=
templateResolvers
;
this
.
dialects
=
dialectsProvider
this
.
dialects
=
dialectsProvider
.
getIfAvailable
(
Collections:
:
emptyList
);
.
getIfAvailable
(
Collections:
:
emptyList
);
}
}
@Bean
@Bean
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationJedisTests.java
View file @
a841a6a1
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisReactiveAutoConfigurationTests.java
View file @
a841a6a1
...
@@ -46,12 +46,10 @@ public class RedisReactiveAutoConfigurationTests {
...
@@ -46,12 +46,10 @@ public class RedisReactiveAutoConfigurationTests {
@Test
@Test
public
void
testDefaultRedisConfiguration
()
{
public
void
testDefaultRedisConfiguration
()
{
load
();
load
();
Map
<
String
,
ReactiveRedisTemplate
>
beans
=
this
.
context
.
getBeansOfType
(
Map
<
String
,
?>
beans
=
this
.
context
.
getBeansOfType
(
ReactiveRedisTemplate
.
class
);
ReactiveRedisTemplate
.
class
);
assertThat
(
beans
).
containsOnlyKeys
(
"reactiveRedisTemplate"
);
assertThat
(
beans
).
containsOnlyKeys
(
"reactiveRedisTemplate"
);
}
}
private
void
load
(
String
...
environment
)
{
private
void
load
(
String
...
environment
)
{
AnnotationConfigApplicationContext
ctx
=
new
AnnotationConfigApplicationContext
();
AnnotationConfigApplicationContext
ctx
=
new
AnnotationConfigApplicationContext
();
EnvironmentTestUtils
.
addEnvironment
(
ctx
,
environment
);
EnvironmentTestUtils
.
addEnvironment
(
ctx
,
environment
);
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationClientTests.java
View file @
a841a6a1
...
@@ -78,8 +78,8 @@ public class HazelcastAutoConfigurationClientTests {
...
@@ -78,8 +78,8 @@ public class HazelcastAutoConfigurationClientTests {
@Test
@Test
public
void
systemProperty
()
throws
IOException
{
public
void
systemProperty
()
throws
IOException
{
System
.
setProperty
(
HazelcastClientConfiguration
.
CONFIG_SYSTEM_PROPERTY
,
System
.
setProperty
(
HazelcastClientConfiguration
.
CONFIG_SYSTEM_PROPERTY
,
"classpath:org/springframework/boot/autoconfigure/hazelcast/"
+
"classpath:org/springframework/boot/autoconfigure/hazelcast/"
"hazelcast-client-specific.xml"
);
+
"hazelcast-client-specific.xml"
);
try
{
try
{
load
();
load
();
HazelcastInstance
hazelcastInstance
=
this
.
context
HazelcastInstance
hazelcastInstance
=
this
.
context
...
@@ -120,7 +120,8 @@ public class HazelcastAutoConfigurationClientTests {
...
@@ -120,7 +120,8 @@ public class HazelcastAutoConfigurationClientTests {
@Test
@Test
public
void
clientConfigTakesPrecedence
()
{
public
void
clientConfigTakesPrecedence
()
{
load
(
HazelcastServerAndClientConfig
.
class
,
"spring.hazelcast.config=this-is-ignored.xml"
);
load
(
HazelcastServerAndClientConfig
.
class
,
"spring.hazelcast.config=this-is-ignored.xml"
);
HazelcastInstance
hazelcastInstance
=
this
.
context
HazelcastInstance
hazelcastInstance
=
this
.
context
.
getBean
(
HazelcastInstance
.
class
);
.
getBean
(
HazelcastInstance
.
class
);
assertThat
(
hazelcastInstance
).
isInstanceOf
(
HazelcastClientProxy
.
class
);
assertThat
(
hazelcastInstance
).
isInstanceOf
(
HazelcastClientProxy
.
class
);
...
...
spring-boot/src/main/java/org/springframework/boot/diagnostics/AbstractFailureAnalyzer.java
View file @
a841a6a1
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
...
spring-boot/src/test/java/org/springframework/boot/system/EmbeddedServerPortFileWriterTests.java
View file @
a841a6a1
...
@@ -19,6 +19,8 @@ package org.springframework.boot.system;
...
@@ -19,6 +19,8 @@ package org.springframework.boot.system;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.io.FileReader
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.function.BiFunction
;
import
java.util.function.BiFunction
;
...
@@ -59,28 +61,35 @@ public class EmbeddedServerPortFileWriterTests {
...
@@ -59,28 +61,35 @@ public class EmbeddedServerPortFileWriterTests {
@Parameters
(
name
=
"{0}"
)
@Parameters
(
name
=
"{0}"
)
public
static
Object
[]
parameters
()
{
public
static
Object
[]
parameters
()
{
BiFunction
<
String
,
Integer
,
?
extends
WebServerInitializedEvent
>
servletEvent
=
(
Map
<
String
,
BiFunction
<
String
,
Integer
,
WebServerInitializedEvent
>>
parameters
=
new
LinkedHashMap
<>();
String
name
,
Integer
port
)
->
{
parameters
.
put
(
"Servlet"
,
ServletWebServerApplicationContext
applicationContext
=
mock
(
EmbeddedServerPortFileWriterTests:
:
servletEventParameter
);
ServletWebServerApplicationContext
.
class
);
parameters
.
put
(
"Reactive"
,
given
(
applicationContext
.
getNamespace
()).
willReturn
(
name
);
EmbeddedServerPortFileWriterTests:
:
reactiveEventParameter
);
WebServer
source
=
mock
(
WebServer
.
class
);
return
parameters
.
entrySet
().
stream
()
given
(
source
.
getPort
()).
willReturn
(
port
);
.
map
((
e
)
->
new
Object
[]
{
e
.
getKey
(),
e
.
getValue
()
}).
toArray
();
ServletWebServerInitializedEvent
event
=
new
ServletWebServerInitializedEvent
(
}
source
,
applicationContext
);
return
event
;
private
static
WebServerInitializedEvent
servletEventParameter
(
String
name
,
};
Integer
port
)
{
BiFunction
<
String
,
Integer
,
?
extends
WebServerInitializedEvent
>
reactiveEvent
=
(
ServletWebServerApplicationContext
applicationContext
=
mock
(
String
name
,
Integer
port
)
->
{
ServletWebServerApplicationContext
.
class
);
ReactiveWebServerApplicationContext
applicationContext
=
mock
(
given
(
applicationContext
.
getNamespace
()).
willReturn
(
name
);
ReactiveWebServerApplicationContext
.
class
);
WebServer
source
=
mock
(
WebServer
.
class
);
given
(
applicationContext
.
getNamespace
()).
willReturn
(
name
);
given
(
source
.
getPort
()).
willReturn
(
port
);
WebServer
source
=
mock
(
WebServer
.
class
);
ServletWebServerInitializedEvent
event
=
new
ServletWebServerInitializedEvent
(
given
(
source
.
getPort
()).
willReturn
(
port
);
source
,
applicationContext
);
return
new
ReactiveWebServerInitializedEvent
(
source
,
applicationContext
);
return
event
;
};
}
return
new
Object
[]
{
new
Object
[]
{
"Servlet"
,
servletEvent
},
new
Object
[]
{
"Reactive"
,
reactiveEvent
}
};
private
static
WebServerInitializedEvent
reactiveEventParameter
(
String
name
,
Integer
port
)
{
ReactiveWebServerApplicationContext
applicationContext
=
mock
(
ReactiveWebServerApplicationContext
.
class
);
given
(
applicationContext
.
getNamespace
()).
willReturn
(
name
);
WebServer
source
=
mock
(
WebServer
.
class
);
given
(
source
.
getPort
()).
willReturn
(
port
);
return
new
ReactiveWebServerInitializedEvent
(
source
,
applicationContext
);
}
}
private
final
BiFunction
<
String
,
Integer
,
?
extends
WebServerInitializedEvent
>
eventFactory
;
private
final
BiFunction
<
String
,
Integer
,
?
extends
WebServerInitializedEvent
>
eventFactory
;
...
...
spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java
View file @
a841a6a1
...
@@ -261,11 +261,11 @@ public class UndertowServletWebServerFactoryTests
...
@@ -261,11 +261,11 @@ public class UndertowServletWebServerFactoryTests
}
}
private
ServletContainer
getServletContainerFromNewFactory
()
{
private
ServletContainer
getServletContainerFromNewFactory
()
{
UndertowServletWebServer
container
=
(
UndertowServletWebServer
)
UndertowServletWebServer
container
=
(
UndertowServletWebServer
)
getFactory
()
getFactory
()
.
getWebServer
();
.
getWebServer
();
try
{
try
{
return
((
DeploymentManager
)
ReflectionTestUtils
.
getField
(
container
,
"manager"
))
return
((
DeploymentManager
)
ReflectionTestUtils
.
getField
(
container
,
.
getDeployment
().
getServletContainer
();
"manager"
))
.
getDeployment
().
getServletContainer
();
}
}
finally
{
finally
{
container
.
stop
();
container
.
stop
();
...
...
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