Commit Graph

203 Commits

Author SHA1 Message Date
Andy Wilkinson
c85f19b75b Revert "Add profiles directly to the application environment for tests"
This reverts commit 487b9cbf96.

Fixes gh-19788
2020-01-20 15:01:09 +00:00
Phillip Webb
9bd49562fe Update copyright year of changed files 2020-01-13 14:09:11 -08:00
Scott Frederick
487b9cbf96 Add profiles directly to the application environment for tests
Prior to this commit, active profiles were being added to the Spring Boot
application environment by setting the `spring.profiles.active` property.
This could result in profiles getting parsed differently than other uses of `@ActiveProfiles`.
Setting the profiles directly in the `Environment` prevents this parsing.

See gh-19556
2020-01-07 13:23:09 -08:00
Andy Wilkinson
bc53fe0344 Recommend mockito-inline for mocking and spying of CGLib proxies
This reverts commit 52050c173c.

See gh-17817
Closes gh-19020
2019-12-05 16:13:02 +00:00
Stephane Nicoll
e4ba6049ff Clarify scope of "@SpringBootTest#classes"
See gh-18229
2019-10-15 14:36:28 +02:00
Andy Wilkinson
3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
2019-10-02 10:48:30 +01:00
Roland Weisleder
92ae7b21a1 Fix typo in ApplicationContextAssert
See gh-18372
2019-09-27 16:32:32 +02:00
Stephane Nicoll
9065c4997d Fix rebase from master 2019-09-16 09:52:55 +02:00
Stephane Nicoll
e05f42f0f3 Polish Add Testable to CLASS_ANNOTATIONS in TestTypeExcludeFilter"
See gh-18214
2019-09-16 09:44:01 +02:00
Leonard Brünings
b9c8d7dd60 Add Testable to CLASS_ANNOTATIONS in TestTypeExcludeFilter
See gh-18214
2019-09-16 09:42:55 +02:00
Andy Wilkinson
52050c173c Fix spying on scoped beans with @SpyBean
Previously, when spying on a scoped bean the creation of the spy
would be performed using the scoped proxy. This would result in
the spy being unable to spy on any of the target bean's methods as
the scoped proxy's implementations of those methods would be final.

This commit updates MockitoPostProcessor so that the creation of the
spy and injection of the @SpyBean-annotated field is performed using
the scoped target. The scoped target has not be proxied so this
allows Mockito to spy on all of its methods.

Closes gh-17817
2019-08-23 19:03:08 +01:00
Andy Wilkinson
ab87b2a39b Polish 2019-08-19 16:05:43 +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
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
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
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
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
ed998ef0d3 Update copyright header of changed files 2019-05-14 21:04:50 -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
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
f12ab1ff90 Update copyright header of changed files 2019-04-03 16:13:00 -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
c592e71449 Override missing methods in FilteredClassLoader
Closes gh-16404
2019-04-01 15:42:02 -07: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
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
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
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
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
Dmytro Nosan
2f3e5d65be Test server port shouldn't affect management port when random
Closes gh-16108
2019-03-15 17:21:29 -07:00
Phillip Webb
fc3aa43cc2 Update copyright year for changed files 2019-03-11 22:14:53 -07: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
Andy Wilkinson
53326695ea Polish 2019-02-21 08:13:54 +00:00
Andy Wilkinson
1f67707509 Fix cast in TestRestTemplateContextCustomizer
Closes gh-15843
2019-02-05 11:39:25 +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
e15e140f8c Polish "Fix typos in JsonContentAssert failure messages"
See gh-15752
2019-01-22 09:19:41 +00:00