Commit Graph

439 Commits

Author SHA1 Message Date
Andy Wilkinson ab87b2a39b Polish 2019-08-19 16:05:43 +01:00
dreis2211 d4affd7f85 Use hasSize() assertion in favor of length checks
See gh-17874
2019-08-17 06:39:41 +02:00
Phillip Webb 34c31ce099 Remove BeanTypeRegistry
Remove `BeanTypeRegistry` and rely entirely on standard calls Spring
Framework APIs.

Closes gh-17594
2019-08-01 10:15:15 +01:00
Phillip Webb da4f436140 Change SearchStrategy EXHAUSTIVE to TYPE_HIERARCHY
Fixup references following upstream Spring Framework change.
2019-07-31 15:11:43 +01:00
dreis2211 8d2f2b75bd Upgrade to AssertJ 3.13.1
See gh-17690
2019-07-30 09:48:33 +02:00
Phillip Webb 8bc780762a Merge branch '2.1.x' 2019-07-24 11:42:48 +01:00
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 2019-07-24 11:41:32 +01:00
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 2019-07-24 11:39:58 +01:00
Phillip Webb 6c0dbacfce Polish 2019-07-23 15:43:51 +01:00
Phillip Webb 0d92af7d55 Add hasJsonPath and doesNotHaveJsonPath asserts
Extend `JsonContentAssert` with `hasJsonPath` and `doesNotHaveJsonPath`
methods which can be used to check the path regardless of the value it
may or may not contain.

Prior to this commit there wasn't an easy way to assert that the
Jackson `@JsonInclude(JsonInclude.Include.NON_NULL)` annotation was
applied since `assertDoesNotHavePathValue` would pass for both
`{"name" : null}` and `{}`.

Closes gh-17608
2019-07-23 15:43:51 +01:00
Phillip Webb 900ec9f3ec Fix error message formatting placeholders
Fix the formatting message placeholders to '%s' since '{}' isn't
supported by AssertJ.

See gh-15569
2019-07-23 15:43:51 +01:00
Andy Wilkinson 41957ec2ad Polish "Polish OutputCapture and its JUnit Jupiter extension"
See gh-17049
2019-07-18 17:46:56 +01:00
Sam Brannen e1c595a67f Polish OutputCapture and its JUnit Jupiter extension
- Polish Javadoc
- Improve error message in OutputCapture
- Use ExtensionContext.Store in OutputCaptureExtension

See gh-17049
2019-07-18 17:46:55 +01:00
Phillip Webb a9ba7080ce Merge branch '2.1.x' 2019-07-17 21:48:42 +01:00
Phillip Webb eff1147ccc Rename classpath runner package
Remove `runner` since we're no longer tied to JUnit 4.

See gh-17491
2019-07-15 13:40:26 +01:00
Phillip Webb 1117fdb2b3 Make ModifiedClassPathExtension package private
Meta-annotate `ClassPathExclusions` and `ClassPathOverrides` with
so that the `ModifiedClassPathExtension` no longer needs to be
used directly.

See gh-17491
2019-07-15 13:38:26 +01:00
dreis2211 0f0278e69b Migrate ModifiedClassPath tests to JUnit 5
Migrate the remaining JUnit 4 tests to JUnit 5, making use of the
new `ModifiedClassPathExtension`.

See gh-17491
2019-07-15 00:31:03 +01:00
Phillip Webb 0cb6a7f47d Polish 2019-07-15 00:24:19 +01:00
Phillip Webb 01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
2019-07-15 00:24:19 +01:00
Phillip Webb cdf43a7489 Polish 2019-07-14 19:42:56 +01:00
Phillip Webb 8d4a2add63 Allow OutputCaptureRule to be used with AssertJ
Update `OutputCaptureRule` so that it now implements
`CapturedOutput` and can be used directly with AssertJ.

Closes gh-17512
2019-07-14 19:42:42 +01:00
dreis2211 82047a2544 Polish
See gh-17505
2019-07-14 11:38:40 +02:00
Johnny Lim 426ef749db Polish
See gh-17413
2019-07-09 07:40:30 +02:00
Andy Wilkinson 2816635418 Polish 2019-07-04 17:51:20 +01:00
Phillip Webb a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
2019-07-03 11:39:47 -07:00
Phillip Webb 605599138e Merge branch '2.1.x' 2019-06-28 23:56:02 -07:00
Phillip Webb 92bff3c328 Merge branch '2.0.x' into 2.1.x 2019-06-28 23:42:28 -07:00
Phillip Webb cfeb0239b7 Merge branch '1.5.x' into 2.0.x 2019-06-28 23:28:34 -07:00
Stephane Nicoll e560b7f6ba Remove public modifier on JUnit5 lifecycle methods
See gh-17292
2019-06-21 18:09:05 +02:00
Andy Wilkinson a189e4cf96 Merge branch '2.1.x'
Closes gh-17220
2019-06-17 14:05:16 +01:00
Andy Wilkinson 645514f848 Polish "Honour base path from @WebAppConfiguration in @WebMvcTest"
See gh-16485
2019-06-17 13:54:41 +01:00
Lorenzo Dee 7340d546b8 Honour base path from @WebAppConfiguration in @WebMvcTest
See gh-16485
2019-06-17 13:37:55 +01:00
Madhura Bhave 30cfe7b4c5 Polish 2019-06-13 08:02:26 -07:00
Phillip Webb aad21d1996 Polish "Support default headers with RestTemplateBuilder"
Broaden the scope of customizer support so that instead of focusing
just on headers, we can now customize any outgoing `HttpClientRequest`.
Also update auto-configuration to automatically add any
`RestTemplateRequestCustomizer` beans to the builder.

See gh-17091
2019-06-12 16:34:31 -07:00
Ilya Lukyanovich 43b1a667ce Support default headers with RestTemplateBuilder
Update `RestTemplateBuilder` so that it is easier to apply custom
headers to the outgoing request. The update is particularly useful
for setting the `User-Agent` header, for example so that a GitHub
username can be used when calling `api.github.com`.

See gh-17091
2019-06-12 13:49:39 -07:00
Phillip Webb 266d6334b2 Fix checkstyle RedundantModifier test violations 2019-06-07 20:46:33 -07:00
Andy Wilkinson b18fffaf14 Move tests to JUnit 5 wherever possible 2019-06-07 12:25:54 +01:00
Andy Wilkinson aef92b9295 Merge branch '2.1.x'
Closes gh-17079
2019-06-07 11:00:44 +01:00
Andy Wilkinson 24925c3dae Merge branch '2.0.x' into 2.1.x
Closes gh-17078
2019-06-07 10:50:34 +01:00
Andy Wilkinson c6c139d980 Merge branch '1.5.x' into 2.0.x 2019-06-07 10:46:31 +01:00
Phillip Webb db75347eb6 Merge branch '2.1.x' 2019-06-04 14:41:20 -07:00
Phillip Webb 0ef331018e Merge branch '2.0.x' into 2.1.x 2019-06-04 14:30:52 -07:00
Phillip Webb 7fc01971ed Merge branch '1.5.x' into 2.0.x 2019-06-04 14:20:25 -07:00
Phillip Webb 76e075ddd0 Polish "Use request factory to support Basic Authentication"
Reduce the surface area of the public API by making the
`BasicAuthentication` and `BasicAuthenticationClientHttpRequestFactory`
class package private.

This commit also attempts to simplify `TestRestTemplate` by keeping
the `RestTemplateBuilder` and reusing it, rather than needing to deal
only with a `RestTemplate` instance.

See gh-17010
2019-05-31 22:35:36 -07:00
Dmytro Nosan 18a0a7a2e8 Use request factory to support Basic Authentication
Update `RestTemplateBuilder` to use a custom request factory to add
authentication headers rather than an interceptor.

Prior to this commit, the use of the `BasicAuthenticationInterceptor`
interceptor could cause `OutOfMemoryError` whenever a large file is
uploaded.

See gh-17010
2019-05-31 22:29:20 -07:00
Madhura Bhave 898a903d2f Fix typos in javadoc 2019-05-31 15:18:29 -07:00
Andy Wilkinson 0644a79401 Repackage output capture and always use extension declaratively
Closes gh-17029
2019-05-31 18:33:10 +01:00
Phillip Webb d11d5ceb29 Split up JUnit 5 OutputCapture class
Split the JUnit 5 `OutputCapture` class into separate `OutputExtension`
and `CapturedOutput` classes. The JUnit 5 callback methods are now
contained only in the `OutputExtension` class so no longer pollute the
public API that users will interact with.

The `CapturedOutput` class has also been updated to capture System.err
and System.out separately to allow distinct assertions if required.

Closes gh-17029
2019-05-30 23:44:35 -07:00
Phillip Webb 68aec8b6ee Polish 2019-05-30 11:30:27 -07:00
Andy Wilkinson 86380ab8db Add missing package-info.java files 2019-05-29 07:20:34 +01:00
Johnny Lim d8e5169f5f Polish
Closes gh-16948
2019-05-25 11:28:23 +02:00
Andy Wilkinson 23f803c6b6 Upgrade to Hamcrest 2.1, switch to hamcrest artifact from -core and -library
Closes gh-15555
2019-05-22 14:50:15 +01:00
dreis2211 27ca7e17d9 Fix deprecated StandardAnnotationMetadata usages
Closes gh-16930
2019-05-22 14:05:15 +02:00
Phillip Webb ed998ef0d3 Update copyright header of changed files 2019-05-14 21:04:50 -07:00
Andy Wilkinson 552345fcd1 Disable more @Bean method proxying
Previously, due to a quirk in Spring Framework, it was necessary to use bean method
proxying in @Configuration classes that define one or more FactoryBeans. This quirk has
now been addressed so this commit disables bean method proxying where it is now no longer
needed.

Closes gh-16533
2019-05-10 10:16:22 +01:00
Andy Wilkinson ca51609cdf Align mock with Selenium HtmlUnit's new behaviour
See gh-16801
2019-05-09 09:48:36 +01:00
Madhura Bhave 1db1c8b03c Validate our own tests work with JUnit5 and the vintage engine
Closes gh-14737

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-05-08 16:05:44 +02:00
Madhura Bhave d15347d4e5 Add Junit5 OutputCapture Extension
Closes gh-14738
2019-05-08 16:05:43 +02:00
Stephane Nicoll c91578bbae Define surefire test provider to use
The `spring-boot-test` module has a dependency to TestNG to validate
some part of the test infrastructure but no tests are actually written
using TestNG. The presence of TestNG is a trigger for the maven surefire
plugin and it attempts to run tests using it.

This commit defines the explicit provider to use (JUnit 4)

Closes gh-16735
2019-05-07 14:22:53 +02:00
Phillip Webb 32040e355b Merge branch '2.1.x'
Closes gh-16649
2019-04-24 19:50:41 -07:00
Phillip Webb d4151e0b51 Polish "Use Jackson configuration with JsonPath"
Polish contribution to use a factory method in `AbstractJsonMarshalTester`
rather than additional constructor arguments.

Also change the `JsonContent` tests so that the `Configuration` constructor
is package private. This keeps JsonPath classes out of our public API, at
the expense of limiting custom JsonPath configurations to just our code.

See gh-16629
2019-04-24 19:45:43 -07:00
Phillip Webb 17aaf26590 Use consistent javadoc style for annotation links
Closes gh-13920
2019-04-24 19:37:59 -07:00
Phillip Webb 1e44aba772 Fix compiler warnings and polish
Fix various compiler warnings and apply a little polish.
2019-04-24 19:37:42 -07:00
Diego Berrueta 756a7f12a3 Use Jackson configuration with JsonPath
Update `JacksonTester` so that the JsonPath instance is explicitly configured
with both a `JacksonJsonProvider` and a `JacksonMappingProvider`.

Prior to this commit, the handling of special characters was not symmetrical
between the serialization (handled via the JacksonTester) and the parsing (handled
via JsonPath) due to the fact that JsonPath used `SimpleJson` as its parser.

See gh-16629
2019-04-24 18:15:46 -07:00
Phillip Webb b879972d0d Migrate to MergedAnnotations API
Migrate away from `AnnotationUtils` and `AnnotatedElementUtils`
when possible to the new `MergedAnnotations` API.

Closes gh-16551
2019-04-18 15:40:02 -07:00
Phillip Webb 5f1bbf8c72 Update copyright header of changed files 2019-04-15 17:51:08 -07:00
Phillip Webb 7d4118a0fe Align withBean methods with ApplicationContext
Rework `AbstractApplicationContextRunner.withBean` methods to
align signatures as much as possible with those provided by
the `ApplicationContext`.

Also update the implementation to use a dedicate member
variable rather than adding initializers.

Closes gh-16011
2019-04-15 17:51:08 -07:00
Phillip Webb 2dfd916c96 Polish 2019-04-15 17:51:08 -07:00
Stephane Nicoll a780875390 Allow `ApplicationContextRunner` to accept simple bean definitions
This commit adds `withBean` methods to the `ApplicationContextRunner`
abstraction so that simple beans can be registered inline. This is a
nice alternative for cases where a inner configuration class has to be
defined for the purpose of creating a simple bean.

Closes gh-16011
2019-04-09 12:15:05 +02:00
Stephane Nicoll c432288ed1 Migrate ApplicationContext to common hierarchy
This commit migrates `AnnotationConfigReactiveWebApplicationContext`
parent to the `GenericApplicationContext` abstraction. Any use of
`AnnotationConfigWebApplicationContext` is also removed as it also
inherits from the `AbstractRefreshableApplicationContext` outdated
hierarchy.

A new `AnnotationConfigServletWebApplicationContext` context is
introduced instead, extending from `GenericApplicationContext` and
providing the counter part of the reactive context for the Servlet-based
web app tests.

See gh-16096
2019-04-05 14:17:41 +02:00
Phillip Webb ad7eebee9e Merge branch '2.1.x' 2019-04-03 17:00:25 -07:00
Phillip Webb f12ab1ff90 Update copyright header of changed files 2019-04-03 16:13:00 -07:00
Phillip Webb 2376f973f4 Merge branch '2.1.x' 2019-04-02 13:46:36 -07:00
Phillip Webb 47c6bf741d Merge branch '2.0.x' into 2.1.x 2019-04-02 13:40:21 -07:00
Phillip Webb 07c000c5b7 Merge branch '1.5.x' into 2.0.x 2019-04-02 13:34:28 -07:00
Madhura Bhave 8daa8c48fb Merge branch '2.1.x' 2019-04-01 15:51:25 -07:00
Madhura Bhave c592e71449 Override missing methods in FilteredClassLoader
Closes gh-16404
2019-04-01 15:42:02 -07:00
Andy Wilkinson 878a635bfb Merge branch '2.1.x' 2019-03-28 11:48:47 +00:00
Andy Wilkinson 5a3474c7a8 Polish "Use HTTPS for external links wherever possible"
See gh-16320
2019-03-28 10:53:01 +00:00
Andy Wilkinson 864942ad4f Merge branch '2.0.x' into 2.1.x 2019-03-28 09:35:53 +00:00
Spring Operator 1a4c6f2dac Use HTTPS for external links wherever possible
See gh-16319
2019-03-27 20:06:52 +00:00
Andy Wilkinson ba4671f0ab Merge branch '1.5.x' into 2.0.x 2019-03-27 19:59:36 +00:00
Andy Wilkinson 4900505425 Merge branch '2.0.x' into 2.1.x 2019-03-26 13:53:57 +00:00
Andy Wilkinson fedb40a2bf Merge branch '1.5.x' into 2.0.x 2019-03-26 13:48:32 +00:00
Madhura Bhave 95d10388dd Merge branch '2.1.x' 2019-03-25 11:03:10 -07:00
Madhura Bhave 0c2e71cd08 Prevent early initialization of factory beans in text context customizers
Until Spring Framework 5.1.15, a FactoryBean with a non-default constructor
defined via component scanning would cause an error. This behavior has changed
as of https://github.com/spring-projects/spring-framework/issues/22409.
Regardless of this change we want to ensure that we avoid triggering eager
initialisation. `SimpleFactoryBean` has been written this way so that the tests
fail if early initialization is triggered regardless of the Spring Framework version.

Fixes gh-15898
2019-03-25 10:55:41 -07:00
Andy Wilkinson 36c1c051b8 Merge branch '2.1.x' 2019-03-20 16:55:10 +00:00
Andy Wilkinson e23f72c8b0 Merge branch '2.0.x' into 2.1.x 2019-03-20 16:53:48 +00:00
Andy Wilkinson 9fbd38ab3c Merge branch '1.5.x' into 2.0.x 2019-03-20 16:45:26 +00:00
Spring Operator 00ab30362c Use HTTPS for external links in XML files
See gh-16270
2019-03-20 14:33:25 +00:00
Andy Wilkinson b828b398b5 Merge branch '2.1.x' 2019-03-19 17:11:45 +00:00
Andy Wilkinson a36aa67b52 Merge branch '2.0.x' into 2.1.x 2019-03-19 17:04:41 +00:00
Spring Operator 3e2b6ac8ed Update build and setup configuration to use HTTPS
See gh-16246
2019-03-19 16:58:31 +00:00
Madhura Bhave 0611eb49c8 Merge branch '2.1.x' 2019-03-18 18:03:32 -07:00
Madhura Bhave 7ea8770524 Polish "Fix request factory used with withBasicAuth"
Fixes gh-15982
2019-03-18 18:00:17 -07:00
Dmytro Nosan 756bd890eb Fix request factory used with TestRestTemplate withBasicAuth
This commit updates the behavior of withBasicAuth on TestRestTemplate
by trying to use the same request factory type as the underlying restTemplate.
If creation of a new instance of the configured request factory class fails,
it falls back to the `ClientHttpRequestFactorySupplier`.

See gh-15982
2019-03-18 18:00:08 -07:00
Madhura Bhave 1893eeef4f Merge branch '2.1.x' 2019-03-15 17:27:10 -07:00
Dmytro Nosan 2f3e5d65be Test server port shouldn't affect management port when random
Closes gh-16108
2019-03-15 17:21:29 -07:00
Madhura Bhave 2cdc93cf19 Make TestRestTemplate withBasicAuth fault tolerant
It's part of TestRestTemplate's contract that it's fault tolerant. This
commit aligns the behavior of `withBasicAuth` with that expectation.

Closes gh-15780
2019-03-13 11:49:42 -07:00
Andy Wilkinson 68bfb020aa Reduce need for bean method proxying and disable where not needed
Closes gh-9068
2019-03-12 13:18:42 +00:00
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