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
87d696d6
Commit
87d696d6
authored
Mar 06, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Align with breaking API change in AssertJ 3.12
Closes gh-16145
parent
c2e9f986
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
76 additions
and
52 deletions
+76
-52
ValidationErrorsTests.java
...ext/properties/bind/validation/ValidationErrorsTests.java
+2
-2
ConfigurationPropertySourcesTests.java
.../properties/source/ConfigurationPropertySourcesTests.java
+2
-2
DefaultPropertyMapperTests.java
...context/properties/source/DefaultPropertyMapperTests.java
+32
-20
FilteredIterableConfigurationPropertiesSourceTests.java
...e/FilteredIterableConfigurationPropertiesSourceTests.java
+3
-2
MapConfigurationPropertySourceTests.java
...roperties/source/MapConfigurationPropertySourceTests.java
+1
-1
SpringConfigurationPropertySourcesTests.java
...rties/source/SpringConfigurationPropertySourcesTests.java
+4
-4
SpringIterableConfigurationPropertySourceTests.java
...ource/SpringIterableConfigurationPropertySourceTests.java
+1
-1
SystemEnvironmentPropertyMapperTests.java
...operties/source/SystemEnvironmentPropertyMapperTests.java
+25
-16
ServletContextInitializerBeansTests.java
...boot/web/servlet/ServletContextInitializerBeansTests.java
+6
-4
No files found.
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationErrorsTests.java
View file @
87d696d6
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -101,7 +101,7 @@ public class ValidationErrorsTests {
allErrors
.
add
(
new
ObjectError
(
"foo"
,
"bar"
));
ValidationErrors
errors
=
new
ValidationErrors
(
NAME
,
Collections
.
emptySet
(),
allErrors
);
assertThat
(
errors
.
iterator
()).
containsExactlyElementsOf
(
allErrors
);
assertThat
(
errors
.
iterator
()).
toIterable
().
containsExactlyElementsOf
(
allErrors
);
}
@Test
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesTests.java
View file @
87d696d6
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -127,7 +127,7 @@ public class ConfigurationPropertySourcesTests {
new
MapPropertySource
(
"baz"
,
Collections
.
singletonMap
(
"baz"
,
"barf"
)));
Iterable
<
ConfigurationPropertySource
>
configurationSources
=
ConfigurationPropertySources
.
from
(
sources
);
assertThat
(
configurationSources
.
iterator
()).
hasSize
(
5
);
assertThat
(
configurationSources
.
iterator
()).
toIterable
().
hasSize
(
5
);
}
}
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/DefaultPropertyMapperTests.java
View file @
87d696d6
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -35,33 +35,45 @@ public class DefaultPropertyMapperTests extends AbstractPropertyMapperTests {
@Test
public
void
mapFromStringShouldReturnBestGuess
()
{
assertThat
(
namesFromString
(
"server"
)).
containsExactly
(
"server"
);
assertThat
(
namesFromString
(
"server.port"
)).
containsExactly
(
"server.port"
);
assertThat
(
namesFromString
(
"host[0]"
)).
containsExactly
(
"host[0]"
);
assertThat
(
namesFromString
(
"host[0][1]"
)).
containsExactly
(
"host[0][1]"
);
assertThat
(
namesFromString
(
"host[0].name"
)).
containsExactly
(
"host[0].name"
);
assertThat
(
namesFromString
(
"host.f00.name"
)).
containsExactly
(
"host.f00.name"
);
assertThat
(
namesFromString
(
"my.host-name"
)).
containsExactly
(
"my.host-name"
);
assertThat
(
namesFromString
(
"my.hostName"
)).
containsExactly
(
"my.hostname"
);
assertThat
(
namesFromString
(
"my.HOST_NAME"
)).
containsExactly
(
"my.hostname"
);
assertThat
(
namesFromString
(
"s[!@#$%^&*()=+]e-rVeR"
))
assertThat
(
namesFromString
(
"server"
)).
toIterable
().
containsExactly
(
"server"
);
assertThat
(
namesFromString
(
"server.port"
)).
toIterable
()
.
containsExactly
(
"server.port"
);
assertThat
(
namesFromString
(
"host[0]"
)).
toIterable
().
containsExactly
(
"host[0]"
);
assertThat
(
namesFromString
(
"host[0][1]"
)).
toIterable
()
.
containsExactly
(
"host[0][1]"
);
assertThat
(
namesFromString
(
"host[0].name"
)).
toIterable
()
.
containsExactly
(
"host[0].name"
);
assertThat
(
namesFromString
(
"host.f00.name"
)).
toIterable
()
.
containsExactly
(
"host.f00.name"
);
assertThat
(
namesFromString
(
"my.host-name"
)).
toIterable
()
.
containsExactly
(
"my.host-name"
);
assertThat
(
namesFromString
(
"my.hostName"
)).
toIterable
()
.
containsExactly
(
"my.hostname"
);
assertThat
(
namesFromString
(
"my.HOST_NAME"
)).
toIterable
()
.
containsExactly
(
"my.hostname"
);
assertThat
(
namesFromString
(
"s[!@#$%^&*()=+]e-rVeR"
)).
toIterable
()
.
containsExactly
(
"s[!@#$%^&*()=+].e-rver"
);
assertThat
(
namesFromString
(
"host[FOO].name"
)).
containsExactly
(
"host[FOO].name"
);
assertThat
(
namesFromString
(
"host[FOO].name"
)).
toIterable
()
.
containsExactly
(
"host[FOO].name"
);
}
@Test
public
void
mapFromConfigurationShouldReturnBestGuess
()
{
assertThat
(
namesFromConfiguration
(
"server"
)).
containsExactly
(
"server"
);
assertThat
(
namesFromConfiguration
(
"server.port"
)).
containsExactly
(
"server.port"
);
assertThat
(
namesFromConfiguration
(
"host[0]"
)).
containsExactly
(
"host[0]"
);
assertThat
(
namesFromConfiguration
(
"host[0][1]"
)).
containsExactly
(
"host[0][1]"
);
assertThat
(
namesFromConfiguration
(
"host[0].name"
))
assertThat
(
namesFromConfiguration
(
"server"
)).
toIterable
()
.
containsExactly
(
"server"
);
assertThat
(
namesFromConfiguration
(
"server.port"
)).
toIterable
()
.
containsExactly
(
"server.port"
);
assertThat
(
namesFromConfiguration
(
"host[0]"
)).
toIterable
()
.
containsExactly
(
"host[0]"
);
assertThat
(
namesFromConfiguration
(
"host[0][1]"
)).
toIterable
()
.
containsExactly
(
"host[0][1]"
);
assertThat
(
namesFromConfiguration
(
"host[0].name"
)).
toIterable
()
.
containsExactly
(
"host[0].name"
);
assertThat
(
namesFromConfiguration
(
"host.f00.name"
))
assertThat
(
namesFromConfiguration
(
"host.f00.name"
))
.
toIterable
()
.
containsExactly
(
"host.f00.name"
);
assertThat
(
namesFromConfiguration
(
"my.host-name"
))
assertThat
(
namesFromConfiguration
(
"my.host-name"
))
.
toIterable
()
.
containsExactly
(
"my.host-name"
);
assertThat
(
namesFromConfiguration
(
"host[FOO].name"
))
assertThat
(
namesFromConfiguration
(
"host[FOO].name"
))
.
toIterable
()
.
containsExactly
(
"host[FOO].name"
);
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/FilteredIterableConfigurationPropertiesSourceTests.java
View file @
87d696d6
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -33,7 +33,8 @@ public class FilteredIterableConfigurationPropertiesSourceTests
public
void
iteratorShouldFilterNames
()
{
MockConfigurationPropertySource
source
=
(
MockConfigurationPropertySource
)
createTestSource
();
IterableConfigurationPropertySource
filtered
=
source
.
filter
(
this
::
noBrackets
);
assertThat
(
filtered
.
iterator
()).
extracting
(
ConfigurationPropertyName:
:
toString
)
assertThat
(
filtered
.
iterator
()).
toIterable
()
.
extracting
(
ConfigurationPropertyName:
:
toString
)
.
containsExactly
(
"a"
,
"b"
,
"c"
);
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySourceTests.java
View file @
87d696d6
...
...
@@ -88,7 +88,7 @@ public class MapConfigurationPropertySourceTests {
MapConfigurationPropertySource
source
=
new
MapConfigurationPropertySource
();
source
.
put
(
"foo.BAR"
,
"spring"
);
source
.
put
(
"foo.baz"
,
"boot"
);
assertThat
(
source
.
iterator
()).
containsExactly
(
assertThat
(
source
.
iterator
()).
toIterable
().
containsExactly
(
ConfigurationPropertyName
.
of
(
"foo.bar"
),
ConfigurationPropertyName
.
of
(
"foo.baz"
));
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourcesTests.java
View file @
87d696d6
...
...
@@ -155,7 +155,7 @@ public class SpringConfigurationPropertySourcesTests {
new
MapPropertySource
(
"baz"
,
Collections
.
singletonMap
(
"baz"
,
"barf"
)));
SpringConfigurationPropertySources
configurationSources
=
new
SpringConfigurationPropertySources
(
sources
);
assertThat
(
configurationSources
.
iterator
()).
hasSize
(
5
);
assertThat
(
configurationSources
.
iterator
()).
toIterable
().
hasSize
(
5
);
}
@Test
...
...
@@ -163,15 +163,15 @@ public class SpringConfigurationPropertySourcesTests {
MutablePropertySources
sources
=
new
MutablePropertySources
();
SpringConfigurationPropertySources
configurationSources
=
new
SpringConfigurationPropertySources
(
sources
);
assertThat
(
configurationSources
.
iterator
()).
hasSize
(
0
);
assertThat
(
configurationSources
.
iterator
()).
toIterable
().
hasSize
(
0
);
MapPropertySource
source1
=
new
MapPropertySource
(
"test1"
,
Collections
.
singletonMap
(
"a"
,
"b"
));
sources
.
addLast
(
source1
);
assertThat
(
configurationSources
.
iterator
()).
hasSize
(
1
);
assertThat
(
configurationSources
.
iterator
()).
toIterable
().
hasSize
(
1
);
MapPropertySource
source2
=
new
MapPropertySource
(
"test2"
,
Collections
.
singletonMap
(
"b"
,
"c"
));
sources
.
addLast
(
source2
);
assertThat
(
configurationSources
.
iterator
()).
hasSize
(
2
);
assertThat
(
configurationSources
.
iterator
()).
toIterable
().
hasSize
(
2
);
}
@Test
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySourceTests.java
View file @
87d696d6
...
...
@@ -71,7 +71,7 @@ public class SpringIterableConfigurationPropertySourceTests {
mapper
.
addFromPropertySource
(
"key4"
,
"my.key4"
);
SpringIterableConfigurationPropertySource
adapter
=
new
SpringIterableConfigurationPropertySource
(
propertySource
,
mapper
);
assertThat
(
adapter
.
iterator
()).
extracting
(
Object:
:
toString
)
assertThat
(
adapter
.
iterator
()).
toIterable
().
extracting
(
Object:
:
toString
)
.
containsExactly
(
"my.key1"
,
"my.key2a"
,
"my.key2b"
,
"my.key4"
);
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapperTests.java
View file @
87d696d6
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -35,26 +35,35 @@ public class SystemEnvironmentPropertyMapperTests extends AbstractPropertyMapper
@Test
public
void
mapFromStringShouldReturnBestGuess
()
{
assertThat
(
namesFromString
(
"SERVER"
)).
containsExactly
(
"server"
);
assertThat
(
namesFromString
(
"SERVER_PORT"
)).
containsExactly
(
"server.port"
);
assertThat
(
namesFromString
(
"HOST_0"
)).
containsExactly
(
"host[0]"
);
assertThat
(
namesFromString
(
"HOST_0_1"
)).
containsExactly
(
"host[0][1]"
);
assertThat
(
namesFromString
(
"HOST_0_NAME"
)).
containsExactly
(
"host[0].name"
);
assertThat
(
namesFromString
(
"HOST_F00_NAME"
)).
containsExactly
(
"host.f00.name"
);
assertThat
(
namesFromString
(
"S-ERVER"
)).
containsExactly
(
"s-erver"
);
assertThat
(
namesFromString
(
"SERVER"
)).
toIterable
().
containsExactly
(
"server"
);
assertThat
(
namesFromString
(
"SERVER_PORT"
)).
toIterable
()
.
containsExactly
(
"server.port"
);
assertThat
(
namesFromString
(
"HOST_0"
)).
toIterable
().
containsExactly
(
"host[0]"
);
assertThat
(
namesFromString
(
"HOST_0_1"
)).
toIterable
()
.
containsExactly
(
"host[0][1]"
);
assertThat
(
namesFromString
(
"HOST_0_NAME"
)).
toIterable
()
.
containsExactly
(
"host[0].name"
);
assertThat
(
namesFromString
(
"HOST_F00_NAME"
)).
toIterable
()
.
containsExactly
(
"host.f00.name"
);
assertThat
(
namesFromString
(
"S-ERVER"
)).
toIterable
().
containsExactly
(
"s-erver"
);
}
@Test
public
void
mapFromConfigurationShouldReturnBestGuess
()
{
assertThat
(
namesFromConfiguration
(
"server"
)).
containsExactly
(
"SERVER"
);
assertThat
(
namesFromConfiguration
(
"server.port"
)).
containsExactly
(
"SERVER_PORT"
);
assertThat
(
namesFromConfiguration
(
"host[0]"
)).
containsExactly
(
"HOST_0"
);
assertThat
(
namesFromConfiguration
(
"host[0][1]"
)).
containsExactly
(
"HOST_0_1"
);
assertThat
(
namesFromConfiguration
(
"host[0].name"
)).
containsExactly
(
"HOST_0_NAME"
);
assertThat
(
namesFromConfiguration
(
"host.f00.name"
))
assertThat
(
namesFromConfiguration
(
"server"
)).
toIterable
()
.
containsExactly
(
"SERVER"
);
assertThat
(
namesFromConfiguration
(
"server.port"
)).
toIterable
()
.
containsExactly
(
"SERVER_PORT"
);
assertThat
(
namesFromConfiguration
(
"host[0]"
)).
toIterable
()
.
containsExactly
(
"HOST_0"
);
assertThat
(
namesFromConfiguration
(
"host[0][1]"
)).
toIterable
()
.
containsExactly
(
"HOST_0_1"
);
assertThat
(
namesFromConfiguration
(
"host[0].name"
)).
toIterable
()
.
containsExactly
(
"HOST_0_NAME"
);
assertThat
(
namesFromConfiguration
(
"host.f00.name"
)).
toIterable
()
.
containsExactly
(
"HOST_F00_NAME"
);
assertThat
(
namesFromConfiguration
(
"foo.the-bar"
)).
containsExactly
(
"FOO_THEBAR"
,
"FOO_THE_BAR"
);
assertThat
(
namesFromConfiguration
(
"foo.the-bar"
)).
toIterable
()
.
containsExactly
(
"FOO_THEBAR"
,
"FOO_THE_BAR"
);
}
@Test
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java
View file @
87d696d6
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -48,7 +48,8 @@ public class ServletContextInitializerBeansTests {
ServletContextInitializerBeans
initializerBeans
=
new
ServletContextInitializerBeans
(
this
.
context
.
getBeanFactory
());
assertThat
(
initializerBeans
.
size
()).
isEqualTo
(
1
);
assertThat
(
initializerBeans
.
iterator
()).
hasOnlyElementsOfType
(
TestServlet
.
class
);
assertThat
(
initializerBeans
.
iterator
()).
toIterable
()
.
hasOnlyElementsOfType
(
TestServlet
.
class
);
}
@Test
...
...
@@ -57,7 +58,8 @@ public class ServletContextInitializerBeansTests {
ServletContextInitializerBeans
initializerBeans
=
new
ServletContextInitializerBeans
(
this
.
context
.
getBeanFactory
());
assertThat
(
initializerBeans
.
size
()).
isEqualTo
(
1
);
assertThat
(
initializerBeans
.
iterator
()).
hasOnlyElementsOfType
(
TestFilter
.
class
);
assertThat
(
initializerBeans
.
iterator
()).
toIterable
()
.
hasOnlyElementsOfType
(
TestFilter
.
class
);
}
@Test
...
...
@@ -66,7 +68,7 @@ public class ServletContextInitializerBeansTests {
ServletContextInitializerBeans
initializerBeans
=
new
ServletContextInitializerBeans
(
this
.
context
.
getBeanFactory
(),
TestServletContextInitializer
.
class
);
assertThat
(
initializerBeans
.
size
()).
isEqualTo
(
1
);
assertThat
(
initializerBeans
.
iterator
())
assertThat
(
initializerBeans
.
iterator
())
.
toIterable
()
.
hasOnlyElementsOfType
(
TestServletContextInitializer
.
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