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
93382648
Commit
93382648
authored
Apr 25, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formatting
parent
79922360
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
58 additions
and
57 deletions
+58
-57
SpringApplicationHierarchyTests.java
...ctuate/autoconfigure/SpringApplicationHierarchyTests.java
+2
-4
PrefixMetricGroupExporterTests.java
...ctuate/metrics/export/PrefixMetricGroupExporterTests.java
+2
-1
EnableAutoConfigurationImportSelector.java
.../autoconfigure/EnableAutoConfigurationImportSelector.java
+2
-2
OnBeanCondition.java
...amework/boot/autoconfigure/condition/OnBeanCondition.java
+2
-1
OnClassCondition.java
...mework/boot/autoconfigure/condition/OnClassCondition.java
+3
-2
OnPropertyCondition.java
...ork/boot/autoconfigure/condition/OnPropertyCondition.java
+2
-2
package-info.java
...framework/boot/autoconfigure/data/neo4j/package-info.java
+0
-1
ActiveMQProperties.java
...k/boot/autoconfigure/jms/activemq/ActiveMQProperties.java
+2
-1
EnableAutoConfigurationImportSelectorTests.java
...configure/EnableAutoConfigurationImportSelectorTests.java
+4
-2
IntegrationAutoConfigurationTests.java
...figure/integration/IntegrationAutoConfigurationTests.java
+4
-2
MustacheStandaloneIntegrationTests.java
...onfigure/mustache/MustacheStandaloneIntegrationTests.java
+2
-2
TypeExcludeFilters.java
...rk/boot/test/autoconfigure/filter/TypeExcludeFilters.java
+3
-3
AutoConfigureTestEntityManager.java
...autoconfigure/orm/jpa/AutoConfigureTestEntityManager.java
+2
-2
DataJpaTest.java
...ramework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java
+3
-3
AbstractSpringBootTestEmbeddedWebEnvironmentTests.java
...xt/AbstractSpringBootTestEmbeddedWebEnvironmentTests.java
+2
-2
SpringBootTestWebEnvironmentDefinedPortTests.java
...context/SpringBootTestWebEnvironmentDefinedPortTests.java
+1
-2
SpringBootTestWebEnvironmentRandomPortTests.java
.../context/SpringBootTestWebEnvironmentRandomPortTests.java
+2
-4
JsonContentAssertTests.java
...pringframework/boot/test/json/JsonContentAssertTests.java
+2
-4
MockBeanOnTestFieldForExistingBeanConfig.java
...ock/mockito/MockBeanOnTestFieldForExistingBeanConfig.java
+2
-2
JettyEmbeddedServletContainerFactory.java
.../embedded/jetty/JettyEmbeddedServletContainerFactory.java
+4
-4
JsonObjectDeserializer.java
.../springframework/boot/jackson/JsonObjectDeserializer.java
+2
-2
ImageBannerTests.java
.../test/java/org/springframework/boot/ImageBannerTests.java
+2
-1
SpringBootJoranConfiguratorTests.java
...oot/logging/logback/SpringBootJoranConfiguratorTests.java
+2
-1
NodeEntityScanTests.java
...a/org/springframework/boot/neo4j/NodeEntityScanTests.java
+4
-6
InternalOutputCapture.java
.../springframework/boot/testutil/InternalOutputCapture.java
+2
-1
No files found.
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/SpringApplicationHierarchyTests.java
View file @
93382648
...
@@ -64,8 +64,7 @@ public class SpringApplicationHierarchyTests {
...
@@ -64,8 +64,7 @@ public class SpringApplicationHierarchyTests {
@EnableAutoConfiguration
(
exclude
=
{
ElasticsearchDataAutoConfiguration
.
class
,
@EnableAutoConfiguration
(
exclude
=
{
ElasticsearchDataAutoConfiguration
.
class
,
ElasticsearchRepositoriesAutoConfiguration
.
class
,
ElasticsearchRepositoriesAutoConfiguration
.
class
,
CassandraAutoConfiguration
.
class
,
CassandraDataAutoConfiguration
.
class
,
CassandraAutoConfiguration
.
class
,
CassandraDataAutoConfiguration
.
class
,
Neo4jAutoConfiguration
.
class
,
Neo4jAutoConfiguration
.
class
,
RedisAutoConfiguration
.
class
,
RedisAutoConfiguration
.
class
,
RedisRepositoriesAutoConfiguration
.
class
},
excludeName
=
{
RedisRepositoriesAutoConfiguration
.
class
},
excludeName
=
{
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration"
})
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration"
})
public
static
class
Child
{
public
static
class
Child
{
...
@@ -77,8 +76,7 @@ public class SpringApplicationHierarchyTests {
...
@@ -77,8 +76,7 @@ public class SpringApplicationHierarchyTests {
ElasticsearchDataAutoConfiguration
.
class
,
ElasticsearchDataAutoConfiguration
.
class
,
ElasticsearchRepositoriesAutoConfiguration
.
class
,
ElasticsearchRepositoriesAutoConfiguration
.
class
,
CassandraAutoConfiguration
.
class
,
CassandraDataAutoConfiguration
.
class
,
CassandraAutoConfiguration
.
class
,
CassandraDataAutoConfiguration
.
class
,
Neo4jAutoConfiguration
.
class
,
Neo4jAutoConfiguration
.
class
,
RedisAutoConfiguration
.
class
,
RedisAutoConfiguration
.
class
,
RedisRepositoriesAutoConfiguration
.
class
},
excludeName
=
{
RedisRepositoriesAutoConfiguration
.
class
},
excludeName
=
{
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration"
})
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration"
})
public
static
class
Parent
{
public
static
class
Parent
{
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/PrefixMetricGroupExporterTests.java
View file @
93382648
...
@@ -57,7 +57,8 @@ public class PrefixMetricGroupExporterTests {
...
@@ -57,7 +57,8 @@ public class PrefixMetricGroupExporterTests {
this
.
reader
.
set
(
new
Metric
<
Number
>(
"counter.foo.bar"
,
1
));
this
.
reader
.
set
(
new
Metric
<
Number
>(
"counter.foo.bar"
,
1
));
this
.
exporter
.
setGroups
(
Collections
.
singleton
(
"counter.foo"
));
this
.
exporter
.
setGroups
(
Collections
.
singleton
(
"counter.foo"
));
this
.
exporter
.
export
();
this
.
exporter
.
export
();
assertThat
(
this
.
writer
.
findAll
(
"counter.foo"
).
iterator
().
next
().
getValue
()).
isEqualTo
(
2L
);
assertThat
(
this
.
writer
.
findAll
(
"counter.foo"
).
iterator
().
next
().
getValue
())
.
isEqualTo
(
2L
);
}
}
@Test
@Test
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelector.java
View file @
93382648
...
@@ -143,8 +143,8 @@ public class EnableAutoConfigurationImportSelector
...
@@ -143,8 +143,8 @@ public class EnableAutoConfigurationImportSelector
List
<
String
>
configurations
=
SpringFactoriesLoader
.
loadFactoryNames
(
List
<
String
>
configurations
=
SpringFactoriesLoader
.
loadFactoryNames
(
getSpringFactoriesLoaderFactoryClass
(),
getBeanClassLoader
());
getSpringFactoriesLoaderFactoryClass
(),
getBeanClassLoader
());
Assert
.
notEmpty
(
configurations
,
Assert
.
notEmpty
(
configurations
,
"No auto configuration classes found in META-INF/spring.factories. If you"
+
"No auto configuration classes found in META-INF/spring.factories. If you"
"are using a custom packaging, make sure that file is correct."
);
+
"are using a custom packaging, make sure that file is correct."
);
return
configurations
;
return
configurations
;
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java
View file @
93382648
...
@@ -100,7 +100,8 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
...
@@ -100,7 +100,8 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
+
matching
);
+
matching
);
}
}
matchMessage
.
append
(
"@ConditionalOnSingleCandidate "
).
append
(
spec
)
matchMessage
.
append
(
"@ConditionalOnSingleCandidate "
).
append
(
spec
)
.
append
(
" found a primary candidate amongst the following "
).
append
(
matching
);
.
append
(
" found a primary candidate amongst the following "
)
.
append
(
matching
);
}
}
if
(
metadata
.
isAnnotated
(
ConditionalOnMissingBean
.
class
.
getName
()))
{
if
(
metadata
.
isAnnotated
(
ConditionalOnMissingBean
.
class
.
getName
()))
{
BeanSearchSpec
spec
=
new
BeanSearchSpec
(
context
,
metadata
,
BeanSearchSpec
spec
=
new
BeanSearchSpec
(
context
,
metadata
,
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnClassCondition.java
View file @
93382648
...
@@ -73,8 +73,9 @@ class OnClassCondition extends SpringBootCondition {
...
@@ -73,8 +73,9 @@ class OnClassCondition extends SpringBootCondition {
}
}
matchMessage
.
append
(
matchMessage
.
length
()
==
0
?
""
:
" "
);
matchMessage
.
append
(
matchMessage
.
length
()
==
0
?
""
:
" "
);
matchMessage
.
append
(
"@ConditionalOnMissing classes not found: "
)
matchMessage
.
append
(
"@ConditionalOnMissing classes not found: "
)
.
append
(
StringUtils
.
collectionToCommaDelimitedString
(
getMatchingClasses
(
.
append
(
StringUtils
.
collectionToCommaDelimitedString
(
onMissingClasses
,
MatchType
.
MISSING
,
context
)));
getMatchingClasses
(
onMissingClasses
,
MatchType
.
MISSING
,
context
)));
}
}
return
ConditionOutcome
.
match
(
matchMessage
.
toString
());
return
ConditionOutcome
.
match
(
matchMessage
.
toString
());
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyCondition.java
View file @
93382648
...
@@ -83,8 +83,8 @@ class OnPropertyCondition extends SpringBootCondition {
...
@@ -83,8 +83,8 @@ class OnPropertyCondition extends SpringBootCondition {
StringBuilder
message
=
new
StringBuilder
(
"@ConditionalOnProperty "
);
StringBuilder
message
=
new
StringBuilder
(
"@ConditionalOnProperty "
);
if
(!
missingProperties
.
isEmpty
())
{
if
(!
missingProperties
.
isEmpty
())
{
message
.
append
(
"missing required properties "
)
.
append
(
expandNames
(
prefix
,
missingProperties
))
message
.
append
(
"missing required properties "
)
.
append
(
" "
);
.
append
(
expandNames
(
prefix
,
missingProperties
)).
append
(
" "
);
}
}
if
(!
nonMatchingProperties
.
isEmpty
())
{
if
(!
nonMatchingProperties
.
isEmpty
())
{
String
expected
=
StringUtils
.
hasLength
(
havingValue
)
?
havingValue
:
"!false"
;
String
expected
=
StringUtils
.
hasLength
(
havingValue
)
?
havingValue
:
"!false"
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/package-info.java
View file @
93382648
...
@@ -18,4 +18,3 @@
...
@@ -18,4 +18,3 @@
* Auto-configuration for Spring Data Neo4j.
* Auto-configuration for Spring Data Neo4j.
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
data
.
neo4j
;
package
org
.
springframework
.
boot
.
autoconfigure
.
data
.
neo4j
;
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java
View file @
93382648
...
@@ -188,7 +188,8 @@ public class ActiveMQProperties {
...
@@ -188,7 +188,8 @@ public class ActiveMQProperties {
private
Boolean
trustAll
;
private
Boolean
trustAll
;
/**
/**
* Comma-separated list of specific packages to trust (when not trusting all packages).
* Comma-separated list of specific packages to trust (when not trusting all
* packages).
*/
*/
private
List
<
String
>
trusted
=
new
ArrayList
<
String
>();
private
List
<
String
>
trusted
=
new
ArrayList
<
String
>();
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelectorTests.java
View file @
93382648
...
@@ -153,7 +153,8 @@ public class EnableAutoConfigurationImportSelectorTests {
...
@@ -153,7 +153,8 @@ public class EnableAutoConfigurationImportSelectorTests {
@Test
@Test
public
void
propertyOverrideSetToTrue
()
throws
Exception
{
public
void
propertyOverrideSetToTrue
()
throws
Exception
{
configureExclusions
(
new
String
[
0
],
new
String
[
0
],
new
String
[
0
]);
configureExclusions
(
new
String
[
0
],
new
String
[
0
],
new
String
[
0
]);
this
.
environment
.
setProperty
(
EnableAutoConfiguration
.
ENABLED_OVERRIDE_PROPERTY
,
"true"
);
this
.
environment
.
setProperty
(
EnableAutoConfiguration
.
ENABLED_OVERRIDE_PROPERTY
,
"true"
);
String
[]
imports
=
this
.
importSelector
.
selectImports
(
this
.
annotationMetadata
);
String
[]
imports
=
this
.
importSelector
.
selectImports
(
this
.
annotationMetadata
);
assertThat
(
imports
).
isNotEmpty
();
assertThat
(
imports
).
isNotEmpty
();
}
}
...
@@ -161,7 +162,8 @@ public class EnableAutoConfigurationImportSelectorTests {
...
@@ -161,7 +162,8 @@ public class EnableAutoConfigurationImportSelectorTests {
@Test
@Test
public
void
propertyOverrideSetToFalse
()
throws
Exception
{
public
void
propertyOverrideSetToFalse
()
throws
Exception
{
configureExclusions
(
new
String
[
0
],
new
String
[
0
],
new
String
[
0
]);
configureExclusions
(
new
String
[
0
],
new
String
[
0
],
new
String
[
0
]);
this
.
environment
.
setProperty
(
EnableAutoConfiguration
.
ENABLED_OVERRIDE_PROPERTY
,
"false"
);
this
.
environment
.
setProperty
(
EnableAutoConfiguration
.
ENABLED_OVERRIDE_PROPERTY
,
"false"
);
String
[]
imports
=
this
.
importSelector
.
selectImports
(
this
.
annotationMetadata
);
String
[]
imports
=
this
.
importSelector
.
selectImports
(
this
.
annotationMetadata
);
assertThat
(
imports
).
isEmpty
();
assertThat
(
imports
).
isEmpty
();
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java
View file @
93382648
...
@@ -61,12 +61,14 @@ public class IntegrationAutoConfigurationTests {
...
@@ -61,12 +61,14 @@ public class IntegrationAutoConfigurationTests {
@Test
@Test
public
void
parentContext
()
{
public
void
parentContext
()
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
.
register
(
JmxAutoConfiguration
.
class
,
IntegrationAutoConfiguration
.
class
);
this
.
context
.
register
(
JmxAutoConfiguration
.
class
,
IntegrationAutoConfiguration
.
class
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
AnnotationConfigApplicationContext
parent
=
this
.
context
;
AnnotationConfigApplicationContext
parent
=
this
.
context
;
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
.
setParent
(
parent
);
this
.
context
.
setParent
(
parent
);
this
.
context
.
register
(
JmxAutoConfiguration
.
class
,
IntegrationAutoConfiguration
.
class
);
this
.
context
.
register
(
JmxAutoConfiguration
.
class
,
IntegrationAutoConfiguration
.
class
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
assertThat
(
this
.
context
.
getBean
(
HeaderChannelRegistry
.
class
)).
isNotNull
();
assertThat
(
this
.
context
.
getBean
(
HeaderChannelRegistry
.
class
)).
isNotNull
();
((
ConfigurableApplicationContext
)
this
.
context
.
getParent
()).
close
();
((
ConfigurableApplicationContext
)
this
.
context
.
getParent
()).
close
();
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheStandaloneIntegrationTests.java
View file @
93382648
...
@@ -40,8 +40,8 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -40,8 +40,8 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@DirtiesContext
@DirtiesContext
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
NONE
,
properties
=
{
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
NONE
,
properties
=
{
"env.foo=There"
,
"
env.foo=There"
,
"
foo=World"
})
"foo=World"
})
public
class
MustacheStandaloneIntegrationTests
{
public
class
MustacheStandaloneIntegrationTests
{
@Autowired
@Autowired
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFilters.java
View file @
93382648
...
@@ -26,9 +26,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
...
@@ -26,9 +26,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import
org.springframework.boot.context.TypeExcludeFilter
;
import
org.springframework.boot.context.TypeExcludeFilter
;
/**
/**
* Annotation that can be on tests to define a set of {@link TypeExcludeFilter} classes
that
* Annotation that can be on tests to define a set of {@link TypeExcludeFilter} classes
*
should be applied to {@link SpringBootApplication @SpringBootApplication} component
*
that should be applied to {@link SpringBootApplication @SpringBootApplication}
* scanning.
*
component
scanning.
*
*
* @author Phillip Webb
* @author Phillip Webb
* @since 1.4.0
* @since 1.4.0
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/AutoConfigureTestEntityManager.java
View file @
93382648
...
@@ -25,8 +25,8 @@ import java.lang.annotation.Target;
...
@@ -25,8 +25,8 @@ import java.lang.annotation.Target;
import
org.springframework.boot.autoconfigure.ImportAutoConfiguration
;
import
org.springframework.boot.autoconfigure.ImportAutoConfiguration
;
/**
/**
* Annotation that can be applied to a test class to enable
* Annotation that can be applied to a test class to enable
auto-configuration of a
*
auto-configuration of a
{@link TestEntityManager}.
* {@link TestEntityManager}.
*
*
* @author Phillip Webb
* @author Phillip Webb
* @see TestEntityManagerAutoConfiguration
* @see TestEntityManagerAutoConfiguration
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java
View file @
93382648
...
@@ -47,9 +47,9 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -47,9 +47,9 @@ import org.springframework.transaction.annotation.Transactional;
* override these settings.
* override these settings.
* <p>
* <p>
* If you are looking to load your full application configuration, but use an embedded
* If you are looking to load your full application configuration, but use an embedded
* database, you should consider {@link SpringBootTest @SpringBootTest}
* database, you should consider {@link SpringBootTest @SpringBootTest}
combined with
*
combined with {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than
*
{@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this
*
this
annotation.
* annotation.
*
*
* @author Phillip Webb
* @author Phillip Webb
* @see AutoConfigureTestDatabase
* @see AutoConfigureTestDatabase
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedWebEnvironmentTests.java
View file @
93382648
...
@@ -37,8 +37,8 @@ import org.springframework.web.servlet.DispatcherServlet;
...
@@ -37,8 +37,8 @@ import org.springframework.web.servlet.DispatcherServlet;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
/**
* Base class for {@link SpringBootTest} tests configured to start an embedded
* Base class for {@link SpringBootTest} tests configured to start an embedded
servlet
*
servlet
container
* container
*
*
* @author Phillip Webb
* @author Phillip Webb
* @author Andy Wilkinson
* @author Andy Wilkinson
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentDefinedPortTests.java
View file @
93382648
...
@@ -26,8 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -26,8 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
/**
/**
* Tests for {@link SpringBootTest} configured with
* Tests for {@link SpringBootTest} configured with {@link WebEnvironment#DEFINED_PORT}.
* {@link WebEnvironment#DEFINED_PORT}.
*
*
* @author Phillip Webb
* @author Phillip Webb
* @author Andy Wilkinson
* @author Andy Wilkinson
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentRandomPortTests.java
View file @
93382648
...
@@ -26,16 +26,14 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -26,16 +26,14 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
/**
/**
* Tests for {@link SpringBootTest} configured with
* Tests for {@link SpringBootTest} configured with {@link WebEnvironment#DEFINED_PORT}.
* {@link WebEnvironment#DEFINED_PORT}.
*
*
* @author Phillip Webb
* @author Phillip Webb
* @author Andy Wilkinson
* @author Andy Wilkinson
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@DirtiesContext
@DirtiesContext
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"value=123"
})
"value=123"
})
public
class
SpringBootTestWebEnvironmentRandomPortTests
public
class
SpringBootTestWebEnvironmentRandomPortTests
extends
AbstractSpringBootTestEmbeddedWebEnvironmentTests
{
extends
AbstractSpringBootTestEmbeddedWebEnvironmentTests
{
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java
View file @
93382648
...
@@ -289,8 +289,7 @@ public class JsonContentAssertTests {
...
@@ -289,8 +289,7 @@ public class JsonContentAssertTests {
}
}
@Test
@Test
public
void
isEqualToJsonWhenStringIsMatchingAndLenientShouldPass
()
public
void
isEqualToJsonWhenStringIsMatchingAndLenientShouldPass
()
throws
Exception
{
throws
Exception
{
assertThat
(
forJson
(
SOURCE
)).
isEqualToJson
(
LENIENT_SAME
,
JSONCompareMode
.
LENIENT
);
assertThat
(
forJson
(
SOURCE
)).
isEqualToJson
(
LENIENT_SAME
,
JSONCompareMode
.
LENIENT
);
}
}
...
@@ -329,8 +328,7 @@ public class JsonContentAssertTests {
...
@@ -329,8 +328,7 @@ public class JsonContentAssertTests {
}
}
@Test
@Test
public
void
isEqualToJsonWhenBytesAreMatchingAndLenientShouldPass
()
public
void
isEqualToJsonWhenBytesAreMatchingAndLenientShouldPass
()
throws
Exception
{
throws
Exception
{
assertThat
(
forJson
(
SOURCE
)).
isEqualToJson
(
LENIENT_SAME
.
getBytes
(),
assertThat
(
forJson
(
SOURCE
)).
isEqualToJson
(
LENIENT_SAME
.
getBytes
(),
JSONCompareMode
.
LENIENT
);
JSONCompareMode
.
LENIENT
);
}
}
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockBeanOnTestFieldForExistingBeanConfig.java
View file @
93382648
...
@@ -22,8 +22,8 @@ import org.springframework.context.annotation.Import;
...
@@ -22,8 +22,8 @@ import org.springframework.context.annotation.Import;
/**
/**
* Config for {@link MockBeanOnTestFieldForExistingBeanIntegrationTests} and
* Config for {@link MockBeanOnTestFieldForExistingBeanIntegrationTests} and
* {@link MockBeanOnTestFieldForExistingBeanCacheIntegrationTests}. Extracted to a shared
config
* {@link MockBeanOnTestFieldForExistingBeanCacheIntegrationTests}. Extracted to a shared
* to trigger caching.
*
config
to trigger caching.
*
*
* @author Phillip Webb
* @author Phillip Webb
*/
*/
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java
View file @
93382648
...
@@ -615,9 +615,8 @@ public class JettyEmbeddedServletContainerFactory
...
@@ -615,9 +615,8 @@ public class JettyEmbeddedServletContainerFactory
}
}
/**
/**
* Set a Jetty {@link ThreadPool} that should be used by the {@link Server}.
* Set a Jetty {@link ThreadPool} that should be used by the {@link Server}. If set to
* If set to {@code null} (default), the {@link Server} creates
* {@code null} (default), the {@link Server} creates a {@link ThreadPool} implicitly.
* a {@link ThreadPool} implicitly.
* @param threadPool a Jetty ThreadPool to be used
* @param threadPool a Jetty ThreadPool to be used
*/
*/
public
void
setThreadPool
(
ThreadPool
threadPool
)
{
public
void
setThreadPool
(
ThreadPool
threadPool
)
{
...
@@ -898,7 +897,8 @@ public class JettyEmbeddedServletContainerFactory
...
@@ -898,7 +897,8 @@ public class JettyEmbeddedServletContainerFactory
public
Server
createServer
(
ThreadPool
threadPool
)
{
public
Server
createServer
(
ThreadPool
threadPool
)
{
Server
server
=
new
Server
();
Server
server
=
new
Server
();
try
{
try
{
ReflectionUtils
.
findMethod
(
Server
.
class
,
"setThreadPool"
,
ThreadPool
.
class
)
ReflectionUtils
.
findMethod
(
Server
.
class
,
"setThreadPool"
,
ThreadPool
.
class
)
.
invoke
(
server
,
threadPool
);
.
invoke
(
server
,
threadPool
);
}
}
catch
(
Exception
e
)
{
catch
(
Exception
e
)
{
...
...
spring-boot/src/main/java/org/springframework/boot/jackson/JsonObjectDeserializer.java
View file @
93382648
...
@@ -76,8 +76,8 @@ public abstract class JsonObjectDeserializer<T>
...
@@ -76,8 +76,8 @@ public abstract class JsonObjectDeserializer<T>
throws
IOException
;
throws
IOException
;
/**
/**
* Helper method to extract a value from the given {@code jsonNode} or return
{@code null}
* Helper method to extract a value from the given {@code jsonNode} or return
* when the node itself is {@code null}.
*
{@code null}
when the node itself is {@code null}.
* @param jsonNode the source node (may be {@code null}
* @param jsonNode the source node (may be {@code null}
* @param type the data type. May be {@link String}, {@link Boolean}, {@link Long},
* @param type the data type. May be {@link String}, {@link Boolean}, {@link Long},
* {@link Integer}, {@link Short}, {@link Double}, {@link Float}, {@link BigDecimal}
* {@link Integer}, {@link Short}, {@link Double}, {@link Float}, {@link BigDecimal}
...
...
spring-boot/src/test/java/org/springframework/boot/ImageBannerTests.java
View file @
93382648
...
@@ -157,7 +157,8 @@ public class ImageBannerTests {
...
@@ -157,7 +157,8 @@ public class ImageBannerTests {
}
}
@Test
@Test
public
void
printBannerWhenHasMarginPropertyShouldPrintSizedMargin
()
throws
Exception
{
public
void
printBannerWhenHasMarginPropertyShouldPrintSizedMargin
()
throws
Exception
{
AnsiOutput
.
setEnabled
(
AnsiOutput
.
Enabled
.
NEVER
);
AnsiOutput
.
setEnabled
(
AnsiOutput
.
Enabled
.
NEVER
);
String
banner
=
printBanner
(
"large.gif"
,
"banner.image.margin=4"
);
String
banner
=
printBanner
(
"large.gif"
,
"banner.image.margin=4"
);
String
[]
lines
=
banner
.
split
(
NEW_LINE
);
String
[]
lines
=
banner
.
split
(
NEW_LINE
);
...
...
spring-boot/src/test/java/org/springframework/boot/logging/logback/SpringBootJoranConfiguratorTests.java
View file @
93382648
...
@@ -72,7 +72,8 @@ public class SpringBootJoranConfiguratorTests {
...
@@ -72,7 +72,8 @@ public class SpringBootJoranConfiguratorTests {
@After
@After
public
void
reset
()
{
public
void
reset
()
{
this
.
context
.
stop
();
this
.
context
.
stop
();
new
BasicConfigurator
().
configure
((
LoggerContext
)
LoggerFactory
.
getILoggerFactory
());
new
BasicConfigurator
()
.
configure
((
LoggerContext
)
LoggerFactory
.
getILoggerFactory
());
}
}
@Test
@Test
...
...
spring-boot/src/test/java/org/springframework/boot/neo4j/NodeEntityScanTests.java
View file @
93382648
...
@@ -58,12 +58,12 @@ public class NodeEntityScanTests {
...
@@ -58,12 +58,12 @@ public class NodeEntityScanTests {
this
.
thrown
.
expectMessage
(
"Unable to configure "
this
.
thrown
.
expectMessage
(
"Unable to configure "
+
"SessionFactoryFactoryBean from @NodeEntityScan, "
+
"SessionFactoryFactoryBean from @NodeEntityScan, "
+
"ensure an appropriate bean is registered."
);
+
"ensure an appropriate bean is registered."
);
this
.
context
=
new
AnnotationConfigApplicationContext
(
MissingSessionFactory
.
class
);
this
.
context
=
new
AnnotationConfigApplicationContext
(
MissingSessionFactory
.
class
);
}
}
private
void
assertSetPackagesToScan
(
String
...
expected
)
{
private
void
assertSetPackagesToScan
(
String
...
expected
)
{
String
[]
actual
=
this
.
context
String
[]
actual
=
this
.
context
.
getBean
(
TestSessionFactoryProvider
.
class
)
.
getBean
(
TestSessionFactoryProvider
.
class
)
.
getPackagesToScan
();
.
getPackagesToScan
();
assertThat
(
actual
).
isEqualTo
(
expected
);
assertThat
(
actual
).
isEqualTo
(
expected
);
}
}
...
@@ -87,9 +87,7 @@ public class NodeEntityScanTests {
...
@@ -87,9 +87,7 @@ public class NodeEntityScanTests {
static
class
MissingSessionFactory
{
static
class
MissingSessionFactory
{
}
}
private
static
class
TestSessionFactoryProvider
extends
SessionFactoryProvider
{
private
static
class
TestSessionFactoryProvider
extends
SessionFactoryProvider
{
private
String
[]
packagesToScan
;
private
String
[]
packagesToScan
;
...
...
spring-boot/src/test/java/org/springframework/boot/testutil/InternalOutputCapture.java
View file @
93382648
...
@@ -63,7 +63,8 @@ public class InternalOutputCapture implements TestRule {
...
@@ -63,7 +63,8 @@ public class InternalOutputCapture implements TestRule {
try
{
try
{
if
(!
InternalOutputCapture
.
this
.
matchers
.
isEmpty
())
{
if
(!
InternalOutputCapture
.
this
.
matchers
.
isEmpty
())
{
String
output
=
InternalOutputCapture
.
this
.
toString
();
String
output
=
InternalOutputCapture
.
this
.
toString
();
Assert
.
assertThat
(
output
,
allOf
(
InternalOutputCapture
.
this
.
matchers
));
Assert
.
assertThat
(
output
,
allOf
(
InternalOutputCapture
.
this
.
matchers
));
}
}
}
}
finally
{
finally
{
...
...
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