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
bfd62aba
Commit
bfd62aba
authored
Sep 28, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7030 from izeye:polish-20160927
* pr/7030: Polish
parents
73f153da
30a67764
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
16 deletions
+11
-16
DataSourceAutoConfiguration.java
.../boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
+3
-3
OAuth2ResourceServerConfiguration.java
...ty/oauth2/resource/OAuth2ResourceServerConfiguration.java
+1
-1
OnEnabledResourceChainCondition.java
...ot/autoconfigure/web/OnEnabledResourceChainCondition.java
+4
-4
ConditionMessageTests.java
...k/boot/autoconfigure/condition/ConditionMessageTests.java
+2
-2
QualifierDefinitionTests.java
...work/boot/test/mock/mockito/QualifierDefinitionTests.java
+0
-5
verify.groovy
...pring-boot-maven-plugin/src/it/run-devtools/verify.groovy
+1
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
View file @
bfd62aba
...
@@ -224,16 +224,16 @@ public class DataSourceAutoConfiguration {
...
@@ -224,16 +224,16 @@ public class DataSourceAutoConfiguration {
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
AnnotatedTypeMetadata
metadata
)
{
ConditionMessage
.
Builder
message
=
ConditionMessage
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
"
EmbeddedData
Available"
);
.
forCondition
(
"
DataSource
Available"
);
if
(
hasBean
(
context
,
DataSource
.
class
)
if
(
hasBean
(
context
,
DataSource
.
class
)
||
hasBean
(
context
,
XADataSource
.
class
))
{
||
hasBean
(
context
,
XADataSource
.
class
))
{
return
ConditionOutcome
return
ConditionOutcome
.
match
(
message
.
foundExactly
(
"existing data
bas
e bean"
));
.
match
(
message
.
foundExactly
(
"existing data
sourc
e bean"
));
}
}
if
(
anyMatches
(
context
,
metadata
,
this
.
pooledCondition
,
if
(
anyMatches
(
context
,
metadata
,
this
.
pooledCondition
,
this
.
embeddedCondition
))
{
this
.
embeddedCondition
))
{
return
ConditionOutcome
return
ConditionOutcome
.
match
(
message
.
foundExactly
(
"existing auto-configured data
base
"
));
.
match
(
message
.
foundExactly
(
"existing auto-configured data
source bean
"
));
}
}
return
ConditionOutcome
return
ConditionOutcome
.
noMatch
(
message
.
didNotFind
(
"any existing data source bean"
).
atAll
());
.
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 @
bfd62aba
...
@@ -127,7 +127,7 @@ public class OAuth2ResourceServerConfiguration {
...
@@ -127,7 +127,7 @@ public class OAuth2ResourceServerConfiguration {
}
}
if
(
StringUtils
.
hasText
(
resolver
.
getProperty
(
"user-info-uri"
)))
{
if
(
StringUtils
.
hasText
(
resolver
.
getProperty
(
"user-info-uri"
)))
{
return
ConditionOutcome
return
ConditionOutcome
.
match
(
message
.
foundExactly
(
"user-info-ur
l
property"
));
.
match
(
message
.
foundExactly
(
"user-info-ur
i
property"
));
}
}
if
(
ClassUtils
.
isPresent
(
AUTHORIZATION_ANNOTATION
,
null
))
{
if
(
ClassUtils
.
isPresent
(
AUTHORIZATION_ANNOTATION
,
null
))
{
if
(
AuthorizationServerEndpointsConfigurationBeanCondition
if
(
AuthorizationServerEndpointsConfigurationBeanCondition
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/OnEnabledResourceChainCondition.java
View file @
bfd62aba
...
@@ -36,7 +36,7 @@ import org.springframework.util.ClassUtils;
...
@@ -36,7 +36,7 @@ import org.springframework.util.ClassUtils;
*/
*/
class
OnEnabledResourceChainCondition
extends
SpringBootCondition
{
class
OnEnabledResourceChainCondition
extends
SpringBootCondition
{
private
static
final
String
WEBJAR_ASSE
R
T_LOCATOR
=
"org.webjars.WebJarAssetLocator"
;
private
static
final
String
WEBJAR_ASSET_LOCATOR
=
"org.webjars.WebJarAssetLocator"
;
@Override
@Override
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
...
@@ -50,13 +50,13 @@ class OnEnabledResourceChainCondition extends SpringBootCondition {
...
@@ -50,13 +50,13 @@ class OnEnabledResourceChainCondition extends SpringBootCondition {
ConditionMessage
.
Builder
message
=
ConditionMessage
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
ConditionalOnEnabledResourceChain
.
class
);
.
forCondition
(
ConditionalOnEnabledResourceChain
.
class
);
if
(
match
==
null
)
{
if
(
match
==
null
)
{
if
(
ClassUtils
.
isPresent
(
WEBJAR_ASSE
R
T_LOCATOR
,
if
(
ClassUtils
.
isPresent
(
WEBJAR_ASSET_LOCATOR
,
getClass
().
getClassLoader
()))
{
getClass
().
getClassLoader
()))
{
return
ConditionOutcome
return
ConditionOutcome
.
match
(
message
.
found
(
"class"
).
items
(
WEBJAR_ASSE
R
T_LOCATOR
));
.
match
(
message
.
found
(
"class"
).
items
(
WEBJAR_ASSET_LOCATOR
));
}
}
return
ConditionOutcome
return
ConditionOutcome
.
noMatch
(
message
.
didNotFind
(
"class"
).
items
(
WEBJAR_ASSE
R
T_LOCATOR
));
.
noMatch
(
message
.
didNotFind
(
"class"
).
items
(
WEBJAR_ASSET_LOCATOR
));
}
}
if
(
match
)
{
if
(
match
)
{
return
ConditionOutcome
.
match
(
message
.
because
(
"enabled"
));
return
ConditionOutcome
.
match
(
message
.
because
(
"enabled"
));
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionMessageTests.java
View file @
bfd62aba
...
@@ -45,13 +45,13 @@ public class ConditionMessageTests {
...
@@ -45,13 +45,13 @@ public class ConditionMessageTests {
}
}
@Test
@Test
public
void
toStringWhen
HasMessageShouldReturnMessage
()
throws
Exception
{
public
void
toStringWhen
EmptyShouldReturnEmptyString
()
throws
Exception
{
ConditionMessage
message
=
ConditionMessage
.
empty
();
ConditionMessage
message
=
ConditionMessage
.
empty
();
assertThat
(
message
.
toString
()).
isEqualTo
(
""
);
assertThat
(
message
.
toString
()).
isEqualTo
(
""
);
}
}
@Test
@Test
public
void
toStringWhen
EmptyShouldReturnEmptyString
()
throws
Exception
{
public
void
toStringWhen
HasMessageShouldReturnMessage
()
throws
Exception
{
ConditionMessage
message
=
ConditionMessage
.
of
(
"Test"
);
ConditionMessage
message
=
ConditionMessage
.
of
(
"Test"
);
assertThat
(
message
.
toString
()).
isEqualTo
(
"Test"
);
assertThat
(
message
.
toString
()).
isEqualTo
(
"Test"
);
}
}
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/QualifierDefinitionTests.java
View file @
bfd62aba
...
@@ -21,9 +21,7 @@ import java.lang.annotation.RetentionPolicy;
...
@@ -21,9 +21,7 @@ import java.lang.annotation.RetentionPolicy;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.rules.ExpectedException
;
import
org.mockito.ArgumentCaptor
;
import
org.mockito.ArgumentCaptor
;
import
org.mockito.Captor
;
import
org.mockito.Captor
;
import
org.mockito.Mock
;
import
org.mockito.Mock
;
...
@@ -47,9 +45,6 @@ import static org.mockito.Mockito.verify;
...
@@ -47,9 +45,6 @@ import static org.mockito.Mockito.verify;
*/
*/
public
class
QualifierDefinitionTests
{
public
class
QualifierDefinitionTests
{
@Rule
public
ExpectedException
thrown
=
ExpectedException
.
none
();
@Mock
@Mock
private
ConfigurableListableBeanFactory
beanFactory
;
private
ConfigurableListableBeanFactory
beanFactory
;
...
...
spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/verify.groovy
View file @
bfd62aba
...
@@ -2,5 +2,5 @@ import static org.junit.Assert.assertTrue
...
@@ -2,5 +2,5 @@ import static org.junit.Assert.assertTrue
def
file
=
new
File
(
basedir
,
"build.log"
)
def
file
=
new
File
(
basedir
,
"build.log"
)
assertTrue
'Devtools should have been detected'
,
file
.
text
.
contains
(
'Fork mode disabled, devtools will be disabled'
)
assertTrue
'Devtools should have been detected'
,
file
.
text
.
contains
(
'Fork mode disabled, devtools will be disabled'
)
assertTrue
'Application should have r
a
n'
,
file
.
text
.
contains
(
"I haz been run"
)
assertTrue
'Application should have r
u
n'
,
file
.
text
.
contains
(
"I haz been run"
)
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