Commit Graph

389 Commits

Author SHA1 Message Date
Phillip Webb
dd3e8154d9 Merge branch '2.1.x' 2019-03-11 22:15:19 -07:00
Phillip Webb
fc3aa43cc2 Update copyright year for changed files 2019-03-11 22:14:53 -07:00
Andy Wilkinson
aa2008bc5a Merge branch '2.1.x' 2019-03-11 16:40:19 +00:00
Andy Wilkinson
8c3cec8f13 Merge branch '2.0.x' into 2.1.x 2019-03-11 16:14:19 +00:00
Andy Wilkinson
361437f4e2 Merge branch '1.5.x' into 2.0.x 2019-03-11 15:53:34 +00:00
Stephane Nicoll
b34b217d1e Upgrade to Kotlin 1.3.21
Closes gh-16195
2019-03-11 15:56:13 +01:00
Andy Wilkinson
d6a869fa98 Switch to Jakarta EE API dependencies where possible
Closes gh-16113
Closes gh-16112
Closes gh-16111
Closes gh-15916
Closes gh-15689
2019-03-06 11:20:51 +00:00
Andy Wilkinson
f2e3e274a8 Merge branch '2.1.x' 2019-02-21 08:19:43 +00:00
Andy Wilkinson
53326695ea Polish 2019-02-21 08:13:54 +00:00
Stephane Nicoll
4992b7fb29 Polish "Migrate Kotlin tests to Mockk"
Closes gh-15993
2019-02-19 13:36:06 +01:00
Sebastien Deleuze
cca79b8d4d Migrate Kotlin tests to Mockk
See gh-15993
2019-02-19 13:35:43 +01:00
Stephane Nicoll
7413584b00 Polish "Support expressing application args in @SpringBootTest"
Closes gh-14823
2019-02-13 15:07:11 +01:00
Justin Griffin
422e6b7d41 Support expressing application args in @SpringBootTest
Add `args` property to the `@SpringBootTest` annotation so tests
can easily supply application arguments to pass to their app under test.

See gh-14823
2019-02-13 14:38:26 +01:00
Andy Wilkinson
c04eba7ebc Polish "Add TestNG support in TestTypeExcludeFilter"
See gh-7630
2019-02-12 15:28:19 +00:00
Eddú Meléndez
b005008cac Add TestNG support in TestTypeExcludeFilter
See gh-7630
2019-02-12 15:27:51 +00:00
Andy Wilkinson
89bf486d0c Merge branch '2.1.x' 2019-02-05 11:39:37 +00:00
Andy Wilkinson
1f67707509 Fix cast in TestRestTemplateContextCustomizer
Closes gh-15843
2019-02-05 11:39:25 +00:00
Andy Wilkinson
45cc649c7d Merge branch '2.1.x' 2019-02-04 12:36:33 +00:00
Andy Wilkinson
82bc87560c Use AssertJ’s exception assertions rather than fail
Closes gh-15761
2019-02-04 11:48:26 +00:00
Andy Wilkinson
2cb147af7c Merge branch '2.1.x' 2019-01-22 09:22:17 +00:00
Andy Wilkinson
e15e140f8c Polish "Fix typos in JsonContentAssert failure messages"
See gh-15752
2019-01-22 09:19:41 +00:00
Johnny Lim
3744082996 Fix typos in JsonContentAssert failure messages
Closes gh-15752
2019-01-22 09:19:25 +00:00
Stephane Nicoll
32b14f3098 Merge branch '2.1.x' 2019-01-17 16:15:32 -05:00
Stephane Nicoll
f0a20b1821 Polish contribution
Closes gh-15733
2019-01-17 16:14:15 -05:00
NAIT BELKACEM
6a0053c8bc Fix typo
See gh-15733
2019-01-17 16:11:11 -05:00
Stephane Nicoll
33f2bd4d61 Merge branch '2.1.x' 2019-01-14 08:13:37 -05:00
Stephane Nicoll
485bdc9901 Polish "Remove redundant interface modifiers"
Closes gh-15694
2019-01-14 08:13:08 -05:00
igor-suhorukov
2d873c78fe Remove redundant interface modifiers
See gh-15694
2019-01-14 08:12:41 -05:00
Stephane Nicoll
6baa6b291e Polish contribution
Closes gh-15695
2019-01-14 08:11:20 -05:00
Johnny Lim
af3ed9ff9f Polish
See gh-15695
2019-01-14 08:09:32 -05:00
Stephane Nicoll
1e98c78ab9 Fix typo 2018-12-31 09:59:00 +01:00
Camille Vienot
ff8edf8d98 Use assertJ to generate AssertionError and filter its stacktrace
Closes gh-15569
2018-12-31 09:58:13 +01:00
Andy Wilkinson
064f6478df Move back to JUnit 4 until SUREFIRE-1614 has been resolved
See gh-14736
See gh-14737
See gh-14738
2018-12-12 16:49:30 +00:00
Stephane Nicoll
dfd477aa74 Merge branch '2.1.x' 2018-12-11 08:53:37 +01:00
Stephane Nicoll
38e4d330b0 Merge branch '2.0.x' into 2.1.x 2018-12-11 08:52:58 +01:00
dreis2211
0f92b139f3 Remove Mockito 1 leftover
Closes gh-15422
2018-12-11 08:52:15 +01:00
Madhura Bhave
e367b54928 Merge branch '2.1.x' 2018-12-07 11:57:19 -08:00
Madhura Bhave
31a5e85ab6 Perform placeholder resolution in test env post processor
Fixes gh-15354
2018-12-07 11:45:04 -08:00
Andy Wilkinson
bbf0932f0f Exclude jcl-over-slf4j in favour of spring-jcl
Closes gh-15392
2018-12-07 15:37:24 +00:00
Stephane Nicoll
d5f90ffcfb Polish "Replace this lambda with a method reference"
Closes gh-15401
2018-12-07 11:10:10 +01:00
igor-suhorukov
5c1813aef8 Replace this lambda with a method reference
See gh-15401
2018-12-07 11:01:42 +01:00
Madhura Bhave
5a18df2d69 Fix tests 2018-12-05 18:33:50 -08:00
Madhura Bhave
59d2b0a3fb Upgrade tests to Junit5
See gh-14737
2018-12-05 17:49:09 -08:00
Madhura Bhave
12e1d9a6a4 Add Junit5 OutputCapture Extension
See gh-14738
2018-12-05 17:48:27 -08:00
Johnny Lim
fd5aa3ebf1 Polish
See gh-15134
2018-11-11 11:03:13 +01:00
Phillip Webb
f3fa20b2d1 Polish 2018-10-29 14:25:45 -07:00
Phillip Webb
683484e4a8 Fix primary beans with ApplicationContextAssert
Update `ApplicationContextAssert.getBean` so that multiple beans are
supported as long as one of them is primary. This aligns better with
the way that the standard `ApplicationContext.getBean` method works.

Closes gh-14874
2018-10-24 21:34:17 -07:00
dreis2211
8b14754cda Remove usages of BasicAuthorizationInterceptor
See gh-14830
2018-10-16 10:21:32 +02:00
Stephane Nicoll
1a0d53dec0 Replace ReflectionTestUtils usage by hasFieldOrPropertyWithValue
Closes gh-14696
2018-10-15 08:25:10 +02:00
Stephane Nicoll
baf83aec0d Polish "Allow ClassPathResources to be filtered by FilteredClassLoader"
Closes gh-14774
2018-10-12 15:37:25 +02:00
Roy Jacobs
d3ca1a7b0e Allow ClassPathResources to be filtered by FilteredClassLoader
See gh-14774
2018-10-12 15:15:16 +02:00
Andy Wilkinson
da7daece08 Tolerate Integer values for port properties
Closes gh-14682
2018-10-04 10:53:02 +01:00
Andy Wilkinson
b473f2996d Polish 2018-10-04 10:39:07 +01:00
Phillip Webb
d76bba5e6f Migrate from ExpectedException rule to AssertJ
Replace ExpectedException JUnit rules with AssertJ exception
assertions.

Closes gh-14336
2018-10-02 10:55:28 -07:00
Phillip Webb
94b366bc16 Make assertable context interfaces configurable
Update `Assertable*ApplicationContext` interfaces so that they also
extend the appropriate `Configurable*ApplicationContext` interface.

Closes gh-14650
2018-10-01 10:27:39 -07:00
Stephane Nicoll
c403ac9db6 Merge branch '2.0.x' 2018-09-26 11:43:59 -04:00
Stephane Nicoll
b6e5103dc4 Polish contribution
Closes gh-14592
2018-09-26 11:43:19 -04:00
Marten Deinum
77afe76ed5 Polish
The SpringBootContextLoader still checked if tests were annotated with
@IntegrationTest or @WebIntegrationTest. Those classes have been
removed in Spring Boot 1.5 and been deprecated since 1.4.

This commit removes the check on the annotations as well as the static
list of names.

See gh-14592
2018-09-26 11:41:25 -04:00
Johnny Lim
521f746151 Polish
Closes gh-14517
2018-09-20 09:51:10 +02:00
Madhura Bhave
b2dd162572 Merge branch '2.0.x' 2018-09-17 14:30:38 -07:00
Madhura Bhave
d7d5cbf959 Simplify printing ConditionEvaluationReport when using context runner
Closes gh-13119
2018-09-17 14:23:47 -07:00
Madhura Bhave
d5a197fe66 Support random actuator port in SpringBootTest
This commit changes @SpringBootTest(randomPort = true) to
generate a random port for the actuator endpoints if the
management server runs on a different port from the main
server.

Closes gh-4424
2018-09-14 15:42:08 -07:00
Phillip Webb
04710373bf Add @Author attribution
See gh-11077
2018-09-06 13:42:29 -07:00
Phillip Webb
bc357225b5 Polish MockitoPostProcessor
Closes gh-11077
2018-09-06 13:31:35 -07:00
Andreas Neiser
a5b3a2646b Test @MockBean/@SpyBean with @Primary
Add additional tests to ensure that `@MockBean` and `@SpyBean`
work consistently when combined with `@Primary`.

See gh-11077
2018-09-06 13:31:33 -07:00
Phillip Webb
c777614d8f Support @MockBean/@SpyBean with @Primary
Update `MockitoPostProcessor` so that `@MockBean` and `@SpyBean`
work consistently when combined with `@Primary`.

See gh-11077

Co-authored-by: Andreas Neiser <andreas.neiser@gmail.com>
2018-09-06 13:24:41 -07:00
Phillip Webb
82b27c60a4 Drop MockitoPostProcessor factory method
Remove factory method previously used to create the mock instance.
Since commit 0e00a49dcc, the method is not longer needed.

See gh-11077
2018-09-06 13:22:46 -07:00
Phillip Webb
0e725543d5 Merge branch '2.0.x' 2018-09-05 13:43:16 -07:00
Phillip Webb
ec27137632 Merge branch '1.5.x' into 2.0.x 2018-09-05 13:40:48 -07:00
Johnny Lim
d92441e53f Update assertion message in AnnotatedClassFinder.scanPackage()
Closes gh-13989
2018-08-03 09:06:38 +02:00
Phillip Webb
4d86ac4713 Polish copyright date on changed files 2018-07-29 09:30:26 +01:00
Phillip Webb
80da9cf5eb Merge branch '2.0.x' 2018-07-29 09:28:56 +01:00
Phillip Webb
aeb885192e Polish ternary expressions 2018-07-29 09:24:46 +01:00
Phillip Webb
a6c9c92f2e Merge branch '2.0.x' 2018-07-28 01:35:43 +01:00
Phillip Webb
63b609827e Fix checkstyle method order issues
Fix checkstyle issues with method ordering following the
spring-javaformat upgrade.

See gh-13932
2018-07-28 01:11:53 +01:00
Phillip Webb
e6a68b39a3 Fix checkstyle javadoc issues
Fix checkstyle issues in javadoc following the spring-javaformat
upgrade.

See gh-13932
2018-07-28 01:11:52 +01:00
Phillip Webb
7fc455654a Fix checkstyle ternary issues
Fix checkstyle issues with ternary expressions following the
spring-javaformat upgrade.

See gh-13932
2018-07-28 01:11:52 +01:00
Stephane Nicoll
f780179777 Polish contribution
Closes gh-13904
2018-07-26 17:22:58 +02:00
artsiom
df6feb3e2a Make SpringBootConfigurationFinder public and usable with other annotations
See gh-13904
2018-07-26 17:07:55 +02:00
Andy Wilkinson
6a48a440b2 Annotate our test annotations with @ExtendWith(SpringExtension.class)
Closes gh-13739
2018-07-11 17:25:21 +01:00
Andy Wilkinson
b4cd4f4c43 Stop mocking class that is final in latest Framework 5.1 snapshots 2018-06-28 10:51:58 +01:00
Andy Wilkinson
20546024d3 Merge branch '2.0.x' 2018-06-20 10:11:44 +01:00
Andy Wilkinson
e1774672af Prefer servlet to reactive when Jersey and WebFlux are both available
Closes gh-13521
2018-06-20 10:10:35 +01:00
Brian Clozel
bd8106d77f Upgrade to Spring Framework 5.1
As of Spring Framework 5.1, we're depending on the Reactor Californium
release train.
Reactor Netty is now at version 0.8 and changed its artifact
coordinates, package names and broke several APIs. Spring Framework is
now up-to-date with those changes and this commit does the same for
Spring Boot.

Note that in that process, the `NettyServerCustomizer` has been changed
since the former `HttpServerOptions.Builder` API is now gone from
Reactor Netty, and we're now relying on immutable server instances
instead of a stateful builder pattern.

See gh-13321
2018-06-04 18:59:17 +02:00
Andy Wilkinson
e306aad28c Merge branch '2.0.x' 2018-06-01 17:27:10 +01:00
Andy Wilkinson
27267a7090 Ensure that condition evaluator uses runner’s class loader
Closes gh-13319
2018-06-01 17:26:32 +01:00
Stephane Nicoll
52b80c77d8 Merge branch '2.0.x' 2018-05-29 10:39:39 +02:00
nkjackzhang
17bcd1c359 Fix wrong reference in cast operation
Closes gh-13288
2018-05-29 10:37:32 +02:00
Stephane Nicoll
7462401291 Merge branch '2.0.x' 2018-05-28 09:28:30 +02:00
Eddú Meléndez
065eebfb4b Fix javadoc
Closes gh-13274
2018-05-28 09:26:16 +02:00
Stephane Nicoll
4464a5f5bd Remove code deprecated in 2.0
Closes gh-12962
2018-05-22 14:48:25 +02:00
Phillip Webb
2dc4f1df00 Polish 2018-05-21 21:32:42 -07:00
Stephane Nicoll
300f6bf4d7 Polish contribution
Closes gh-13208
2018-05-18 14:20:31 +02:00
Mihhail Lapushkin
d31dbac69e Support custom UriTemplateHandler in LocalHostUriTemplateHandler
See gh-13208
2018-05-18 14:19:01 +02:00
Phillip Webb
5b3cb8a698 Update copyright header year for changed files 2018-05-04 15:59:26 -07:00
Phillip Webb
6e09e497f2 Formatting 2018-05-04 12:06:19 -07:00
Phillip Webb
2d70a7ae5e Polish caught exception names
Prefer `ex` over `e`.
2018-05-03 22:43:32 -07:00
Phillip Webb
41efea51a7 Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the
the check.
2018-05-03 22:43:12 -07:00
Phillip Webb
e125085993 Merge branch '1.5.x' into 2.0.x 2018-05-03 12:43:50 -07:00
Johnny Lim
f03849d502 Polish
See gh-12812
2018-04-10 11:46:16 +02:00
igor-suhorukov
4c61d8abfe avoid check class by string name 2018-03-14 23:59:42 +01:00
Stephane Nicoll
ed05e1f7ca Polish "Reorder modifiers to comply with the JLS"
Closes gh-12432
2018-03-12 15:17:23 +01:00
igor-suhorukov
aebb475bc5 Reorder modifiers to comply with the JLS
See gh-12432
2018-03-12 15:17:05 +01:00
igor-suhorukov
98f4692c62 Polish
This commit changes invocations to immediately return the expression
instead of assigning it to a temporary variable. The method name should
be sufficient for callers to know exactly what will be returned.

Closes gh-12211
2018-02-25 10:59:02 +01:00
Phillip Webb
4b9c3c137e Polish Collection.toArray
Consistently use `StringUtils.toStringArray`, `ClassUtils.toClassArray`
or zero length when converting collections to arrays.

Fixes gh-12160
2018-02-22 21:11:30 -08:00
Johnny Lim
680287635c Rename TestRestTemplateTestContextCustomizer*
Closes gh-12182
2018-02-22 20:26:14 -08:00
Phillip Webb
cd5266ac03 Polish 2018-02-22 20:25:28 -08:00
Johnny Lim
2fe86da95b Use isTrue() and isFalse() for AssertJ
Closes gh-12170
2018-02-22 09:55:40 +01:00
igor-suhorukov
fe023817c7 Polish static finals
Closes gh-12083
2018-02-19 20:10:58 -08:00
Johnny Lim
88b184ca23 Polish 2018-02-19 20:00:20 -08:00
Phillip Webb
9e75680e6f Polish 2018-02-16 18:11:54 -08:00
Brian Clozel
db7268b841 Fix TestRestTemplate request factory management
This commit fixes two issues in `TestRestTemplate`:

* it improves the detection of the underlying request factory, using
reflection to look inside the intercepting request factory if
interceptors were configured

* it avoids reusing the same request factory when creating a new
`TestRestTemplate` with `withBasicAuth`. Sharing the same instance would
result in sharing authentication state (HTTP cookies). Since the
original request factory can't be detected consistently, a new one is
selected automatically

See gh-8697
2018-02-16 22:36:20 +01:00
Brian Clozel
03a6f97e76 TestRestTemplate should not override request factory
Previously `TestRestTemplate` would override the configured
`ClientHttpRequestFactory` if the Apache HTTP client library was on
classpath.

This commit fixes two issues:

1. The existing `ClientHttpRequestFactory` is overridden *only* if it is
using the Apache HTTP client variant, in order to wrap it with the
`TestRestTemplate` custom support

2. Calling `withBasicAuth` will no longer directly use the request
factory returned by the internal `RestTemplate`; if client interceptors
are configured, the request factory is wrapped with an
`InterceptingClientHttpRequestFactory`. If we don't unwrap it,
interceptors are copied/applied twice in the newly created
`TestRestTemplate` instance. For that, we need to use reflection as the
underlying request factory is not accessible directly.

Closes gh-8697
2018-02-16 12:29:47 +01:00
Phillip Webb
728b522307 Include scope support on ApplicationContextAssert
Update `ApplicationContextAssert` with support for scopes. Allows
tests to consider the all ancestors, or limit assertions to just the
current context.

Fixes gh-12015
2018-02-12 17:49:54 -08:00
Phillip Webb
7ab587a067 Add initializer support
Add `ApplicationContextInitializer` support to
`ApplicationContextRunner`.
2018-02-12 17:49:53 -08:00
Phillip Webb
0348889fd7 Polish 2018-02-12 10:03:06 -08:00
Brian Clozel
2be0c46562 Remove TestRestTemplate constructors taking template args
As discussed in gh-11872, `TestRestTemplate` constructor variants taking
a `RestTemplate` argument are confusing since the main goal of that
class is to mutate `RestTemplate`.

This commit removes all those constructor variants and replaces them
with `RestTemplateBuilder` arguments when possible.

Closes gh-11872
2018-02-12 16:57:15 +01:00
Andy Wilkinson
76a450dfba Format with Eclipse Oxygen SR2 2018-02-08 10:53:53 +00:00
Andy Wilkinson
37f3b1d1e5 Polish 2018-02-08 10:10:34 +00:00
Andy Wilkinson
b3ed46af5a Polish 2018-02-07 16:30:03 +00:00
Phillip Webb
7ea6af0e46 Make AbstractApplicationContextRunner public
Fixes gh-11929
2018-02-06 13:28:18 -08:00
Andy Wilkinson
886f782b20 Merge branch '1.5.x' 2018-02-05 11:04:48 +00:00
Phillip Webb
69234f8c08 Polish 2018-02-02 18:59:05 -08:00
Andy Wilkinson
875091ed85 Polish “Remove or use unused method parameters”
Closes gh-11812
2018-02-02 09:34:19 +00:00
igor-suhorukov
717bd2c580 Remove or use unused method parameters 2018-02-02 09:34:19 +00:00
Phillip Webb
706aa7af59 Make getInitializers() a protected method
Update `SpringBootContextLoader` so that `getInitializers()` is now a
protected method for subclasses to override if necessary.

Closes gh-11457
2018-02-01 12:24:11 -08:00
Andy Wilkinson
458dde63a8 Explicitly order AbstractTestExecutionListener subclasses
By default, AbstractTestExecutionListeners have an order of lowest
precedence. This means that it is impossible to write a listener with
lower precedence that any listener that's using the default order.

This commit updates Boot's 6 AbstractTestExecutionListeners to order
them explicitly. MockitoTestExecutionListener performs injection of
Mockito mocks and spies into the test instance. It now has an order of
2050 giving it slightly lower precedence than the dependency injection
test execution listener (2000).

The remaining 5 listeners have all been ordered with lowest precedence
- 100. This leaves them near their current lowest precedence position
while creating some room for any listeners that require lower
precedence.

Closes gh-11796
2018-02-01 14:28:25 +00:00
dreis2211
a7663c88d3 Replace casted Mockito.any() calls
Closes gh-11817
2018-01-29 07:50:29 +01:00
Jon Schneider
fd237f85cc Extract common micrometer test setup
Create `MetricsRun` that can be used to apply common micrometer test
configuration to a `ApplicationContextRunner`.

Closes gh-11804
2018-01-26 14:42:22 -08:00
Phillip Webb
b7c52da457 Allow custom WebTestClient beans
Update `@SpringBootTest` `WebTestClient` support so that the bean
definition is only registered when the user has not defined or
auto-configured their own.

See gh-10556
2018-01-25 00:08:19 -08:00
Phillip Webb
177281a504 Allow custom TestRestTemplate beans
Update `@SpringBootTest` `TestRestTemplate` support so that the bean
definition is only registered when the user has not defined or
auto-configured their own.

See gh-10556
2018-01-25 00:08:19 -08:00
Phillip Webb
ab6ad6aa4b Polish 2018-01-24 16:09:14 -08:00
andrey.onufreyko
b19dcb13e2 Replace string arguments with char
Optimize method calls by replacing single character String arguments
with char.

Closes gh-11680
2018-01-22 16:35:06 -08:00
Stephane Nicoll
c926bed6f5 Polish "Fix modifiers order"
Closes gh-11681
2018-01-19 11:30:30 +01:00
igor-suhorukov
e2d05607f2 Fix modifiers order
See gh-11681
2018-01-19 11:30:06 +01:00
Phillip Webb
f3379668ac Polish 2018-01-18 23:21:51 -08:00
Phillip Webb
6d93573db0 Merge branch '1.5.x' 2018-01-18 22:03:51 -08:00
Stephane Nicoll
efd941bbe0 Merge branch '1.5.x' 2018-01-18 17:05:22 +01:00
Andy Wilkinson
54c0cf513b Polish 2018-01-17 19:03:23 +00:00
sdeleuze
d4c91d2fe0 Improve Kotlin extensions doc about type erasure
Since type erasure can be fixed only when using
ParameterizedTypeReference based Java methods, TestRestTemplate
API documentation should be updated to specify which extensions
are subject to type erasure, and which are not.

Closes gh-11604
2018-01-16 10:19:12 +01:00
Andy Wilkinson
db83a80deb Correct test expectations following changes to application context ID
See gh-11023
2018-01-10 14:12:06 +00:00
Phillip Webb
b078698f20 Update copyright year of changed files 2018-01-09 12:13:27 -08:00
Johnny Lim
b8706c47d6 Use instance equality for Class
Closes gh-11534
2018-01-09 09:30:36 +01:00
Andy Wilkinson
268b97bf98 No-op ResetMocksTestExecutionListener when Mockito is not present
Closes gh-11508
2018-01-05 11:13:36 +00:00
Stephane Nicoll
ac004eabf3 Update copyright header
See gh-11510
2018-01-05 10:30:43 +01:00
Johnny Lim
37d8eedae3 Polish
Closes gh-11510
2018-01-05 10:29:22 +01:00
Phillip Webb
bee5fa7fc6 Polish 2018-01-03 13:24:04 -08:00
Madhura Bhave
8102dc78cb Remove redundant throws declarations 2017-12-29 12:10:13 -08:00
Johnny Lim
8f7ab95e0e Use BufferedReader.lines()
Closes gh-11436
2017-12-27 16:44:27 +01:00
Johnny Lim
e4f0ad2165 Polish
Closes gh-11372
2017-12-23 13:11:53 +01:00
Phillip Webb
2efa21c570 Make hot methods in-line friendly
Refactor a few hot methods so that they are more likely to be in-lined
by the JIT.

Fixes gh-11409
2017-12-22 20:55:47 -08:00
dreis2211
00d12c5b2d Align 'behavior' spelling to style guide
Closes gh-11394
2017-12-22 18:15:19 +01:00
Phillip Webb
3273859fde Polish 2017-12-13 14:32:55 -08:00
Phillip Webb
5ca608330c Merge branch '1.5.x' 2017-12-13 13:07:18 -08:00
Stephane Nicoll
a626f5462d Consistent use of @AliasFor
Closes gh-10836
2017-12-13 14:42:16 +01:00
Stephane Nicoll
7f2af8b209 Polish 2017-12-13 09:46:41 +01:00
Stephane Nicoll
23218add90 Polish 2017-12-12 11:57:30 +01:00
Johnny Lim
96250743b5 Add missing "abstract" keywords
Closes gh-11303
2017-12-09 15:29:15 -08:00
Johnny Lim
6d54072e04 Remove "final" keywords
Closes gh-11294
2017-12-08 11:13:07 -08:00
Stephane Nicoll
7380920ed4 Remove wrong usage of commons-lang3
Closes gh-11267
2017-12-05 17:43:56 -08:00
Johnny Lim
2c204f2154 Polish
Closes gh-11242
2017-12-02 09:03:59 +01:00
Andy Wilkinson
03fce55cdb Polish "Remove a redundant dash in TestPropertyValues.Type"
Closes gh-11156
2017-11-27 10:44:53 +00:00
Johnny Lim
f21737a675 Remove a redundant dash in TestPropertyValues.Type
Prior to this change, the dash was duplicated. For example
"test--systemEnvironment". This commit removes the redundant dash
and corrects the assertion in the test that should have caught the
problem.

See gh-11156
2017-11-27 10:43:38 +00:00
Stephane Nicoll
aa87c45b5d Polish "Introduce TestRestTemplate Kotlin extensions"
Closes gh-11039
2017-11-24 09:56:47 +01:00
sdeleuze
cd98da5ee9 Introduce TestRestTemplate Kotlin extensions
This commit introduces Kotlin extensions similar to the RestOperations
ones in order to be able to take advantage of Kotlin reified type
parameters for example.

See gh-11039
2017-11-24 09:44:34 +01:00
Phillip Webb
e147982045 Add FilteredClassLoader
Add `FilteredClassLoader` to replace `HideClassesClassLoader` and
`HidePackagesClassLoader`.

Fixes gh-10303
2017-11-18 23:20:00 -08:00
Johnny Lim
cbb483735d Polish
Closes gh-10948
2017-11-16 10:36:20 +01:00
Andy Wilkinson
71632ac767 Polish "Provide access to root URI from TestRestTemplate"
See gh-10641
2017-11-12 12:11:57 +00:00
tinexw
c1205c3243 Provide access to root URI from TestRestTemplate
Closes gh-10641
2017-11-12 12:05:53 +00:00
Andy Wilkinson
07462be090 Polish 2017-11-11 16:29:12 +00:00
Johnny Lim
bd0dcfb172 Utilize StandardCharsets
Closes gh-10972
2017-11-10 09:49:13 +01:00
Phillip Webb
06b1b453a6 Limit when SystemEnvironment mapping is used
Update `SpringConfigurationPropertySource` so that the
`SystemEnvironmentPropertyMapper` is only used for the "actual" system
environment property source. This allows SystemEnvironmentProperySource
class to be used for other purposes (for example, Spring Cloud uses it
to as an override source providing decryption).

Only property sources named `systemEnvironment` or ending with
`-systemEnvironment` now have the `SystemEnvironmentPropertyMapper`
applied. The `TestPropertyValues` has been retrofitted to name the
source it adds appropriately.

Fixes gh-10840
2017-11-06 13:12:25 -08:00
Johnny Lim
c05a299520 Polish
Closes gh-10921
2017-11-06 12:28:43 +01:00
Phillip Webb
fa191d8c73 Align ReactiveWebApplicationContext with framework
Refactor `ReactiveWebApplicationContext` implementations to align closer
with the `WebApplicationContext` implementations defined in
Spring Framework.

The following classes are now provided:

  - `AnnotationConfigReactiveWebApplicationContext` -- A refreshable
    reactive web context with support for `@Configuration` classes.

  - `GenericReactiveWebApplicationContext` -- A non-refreshable reactive
    GenericApplicationContext.

  - `ReactiveWebServerApplicationContext` --  A non-refreshable reactive
    GenericApplicationContext with support for server discovery.

  - `AnnotationConfigReactiveWebServerApplicationContext` -- A
    non-refreshable reactive `GenericApplicationContext` with support
    for `@Configuration` classes and server discovery.

These classes roughly align to the following Servlet equivalents:

  - `AnnotationConfigWebApplicationContext` (Spring Framework)
  - `GenericWebApplicationContext` (Spring Framework)
  - `ServletWebServerApplicationContext` (Spring Boot)
  - `AnnotationConfigServletWebServerApplicationContext` (Spring Boot)

An additional `ConfigurableReactiveWebEnvironment` interface as also
been introduced, primarily for `@ConditionalOnWebApplication` to use.

Fixes gh-10852
2017-11-03 19:07:23 -07:00
Phillip Webb
b6166dc12a Move Assume to spring-boot-test-support
Fixes gh-10866
2017-11-03 19:07:23 -07:00
Nguyen Duy Tiep
fae7a09b83 Support custom SpringBootContextLoader environment
Provide a `getEnvironment` method in `SpringBootContextLoader` to allow
specialized `ConfigurableEnvironment` implementations to be used.

Closes gh-10740
2017-11-02 23:22:16 -07:00
Andy Wilkinson
4757ad63f1 Fix typos in Javadoc of assertable application context classes
Closes gh-10865
2017-11-01 14:49:23 +00:00
Johnny Lim
6168fae720 Remove explicit type arguments
See gh-10494
2017-10-24 14:44:20 +01:00
Andy Wilkinson
a256602c7b Polish 2017-10-24 14:41:03 +01:00
Andy Wilkinson
027c5a0e35 Remove usage of Mockito's internals
Previously, we relied on Mockito's internals to bypass any Spring AOP
proxy during verification of a spy. Thanks to a new API in Mockito,
we can replace the use of Mockito's internals with a
VerificationStartedListener. This listener changes Mockito's view of
the mock to be the ultimate target of the AOP proxy, i.e. to be the
actual Mockito-created spy, allowing Mockito's verification of the
spy to proceed successfully.

This above-described change will mean that we require a very
up-to-date version of Mockito so the tests that verify our
compatibility with 2.5 have been removed as we will no longer support
it when using @MockBean or @SpyBean.

Lastly, two tests have been updated to replace their usage of the
internal MockUtil class with the equivalent public API calls.

Closes gh-10352
2017-10-17 15:56:28 +01:00
Stephane Nicoll
2eba1c5f62 Polish "Use Assert.state() with Supplier where possible"
Closes gh-10658
2017-10-17 15:36:51 +02:00
dreis2211
3b71393e0a Use Assert.state() with Supplier where possible
See gh-10658
2017-10-17 15:35:59 +02:00
Johnny Lim
5aa32b3d0f Polish
Closes gh-10636
2017-10-17 15:29:13 +02:00
Phillip Webb
748e0779b6 Update copyright year for changed files 2017-10-10 11:56:13 -07:00
Phillip Webb
0cc33d5c7c Revert class name change
This reverts commit de7b624643.
2017-10-08 17:09:12 -07:00
Phillip Webb
ae7e9a2cdf Polish 2017-10-08 16:39:38 -07:00
Phillip Webb
de7b624643 Polish 2017-10-08 16:16:06 -07:00
Phillip Webb
b87f9c11f1 Fix POMs for the updated build/release process
Fix POMs following project relocations and apply CI friendly Maven
conventions.

See gh-9316
2017-10-04 16:34:38 -07:00
Phillip Webb
0ba4830b4f Relocate projects to spring-boot-project
Move projects to better reflect the way that Spring Boot is released.

The following projects are under `spring-boot-project`:

  - `spring-boot`
  - `spring-boot-autoconfigure`
  - `spring-boot-tools`
  - `spring-boot-starters`
  - `spring-boot-actuator`
  - `spring-boot-actuator-autoconfigure`
  - `spring-boot-test`
  - `spring-boot-test-autoconfigure`
  - `spring-boot-devtools`
  - `spring-boot-cli`
  - `spring-boot-docs`

See gh-9316
2017-10-04 16:34:23 -07:00