Commit Graph

225 Commits (e187aac93d0080295710c9c4d0dc40ca68947ac4)

Author SHA1 Message Date
Phillip Webb 2c429ba77d Restore static final formatting
Restore static final constants to upper case formatting.

See gh-10457
7 years ago
Phillip Webb 6a55623910 Polish 7 years ago
Spring Buildmaster df2ae7aa19 Next Development Version 7 years ago
Spring Buildmaster c0f9f64776 Next Development Version 7 years ago
Johnny Lim bfa291f671 Polish 7 years ago
Andy Wilkinson 663cae1255 Note behaviour of @MockBean and @SpyBean with non-bean dependencies
Closes gh-10381
7 years ago
Spring Buildmaster 30eb937a83 Next Development Version 7 years ago
Andy Wilkinson 7a4c18eaba Polish "Deprecate JsonContent.assertThat()"
Closes gh-9678
7 years ago
Priyanshi fa57491030 Deprecate JsonContent.assertThat()
See gh-9678
7 years ago
Spring Buildmaster 17a5bb0be4 Next development version 7 years ago
Spring Buildmaster 41c5c0e7c9 Next development version 7 years ago
Andy Wilkinson ece66e1d4a Polish javadoc in JsonContentAssert
See gh-9675
7 years ago
Andy Wilkinson f6727e786a Polish "Fix JsonContentAssert type safety warnings"
- Format code
- Update an existing test to use the contains method that would
  previously have triggered a type safety warning

Closes gh-9675
7 years ago
Mihhail Lapushkin ae91c8460f Fix JsonContentAssert type safety warnings
Previously, JsonContentAssert returns AbstractMapAssert from
extractingJsonPathMapValue. This could lead to type safety warnings
when calling one of the assert's methods with a generic varargs
parameter such as
contains(Entry<? extends Object, ? extends Object>...).

This commit replaces the use of both AbstractMapAssert and
AbstractListAssert with MapAssert and ListAssert respectively. These
classes use final methods and @SafeVargs args to prevent the
above-described problem from occurring.

See gh-9675
7 years ago
Spring Buildmaster 05d4d0281c Next Development Version 8 years ago
Andy Wilkinson 84721666c5 Stop DuplicateJsonObjectContextCustomizer breaking context caching
See gh-9248
8 years ago
Andy Wilkinson 21a5ab7875 Log a warning during tests when multiple JSONOjects on the class path
Closes gh-9248
8 years ago
Stephane Nicoll b5709fd618 Polish
See gh-9330
8 years ago
Stephane Nicoll a22b3d9515 Merge branch '1.4.x' into 1.5.x 8 years ago
Stevo Slavić 6e1d99aa10 Fix typo in javadoc
Closes gh-9212
8 years ago
Phillip Webb 931ce15d7f Update copyright header dates 8 years ago
Spring Buildmaster 9768b0a8c2 Next Development Version 8 years ago
Spring Buildmaster d719d2cbbc Next Development Version 8 years ago
Phillip Webb 5abc050a96 Support detection and with test initializers
Relax `SpringBootTestContextBootstrapper` rules so that a test can
specify an `ApplicationContextInitializer` and still have
`@SpringBootConfiguration` detected.

Prior to this commit detection would not occur because it's possible
that an initializer _could_ register configuration. This scenario is
actually quite unlikely to occur, certainly less likely than wanting to
use an initializer in combination with auto-detection.

Fixes gh-8483
8 years ago
Phillip Webb 393c17b68b Support @SpringBootTest with @ContextHierarchy
Update SpringBootTestContextBootstrapper to detect `@ContextHierarchy`
annotations so that only the last child creates a
`WebApplicationContext`.

Prior to this commit a context hierarchy would start two embedded web
servers which is inconsistent with the `SpringApplicationBuilder`
behavior.

Fixes gh-8311
8 years ago
Phillip Webb 8eb79b3c0f Polish 8 years ago
Phillip Webb f46d799f31 Polish 8 years ago
Madhura Bhave 9e2d54feae Support json view with JacksonTester
Closes gh-8672
8 years ago
Stephane Nicoll c8ac94b75d Polish contribution
Closes gh-8490
8 years ago
Roland Weisleder a6f0da8cc6 Introduce reset method to OutputCapture
Closes gh-8390
8 years ago
Spring Buildmaster d23fa24340 Next Development Version 8 years ago
Spring Buildmaster 2a83e80a9b Next Development Version 8 years ago
Andy Wilkinson 545b29552d Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 98cf35d48e Polish "Ignore spock.lang annotations when creating test context cache key"
See gh-8252
8 years ago
erlholmq 8f18df8a9c Ignore spock.lang annotations when creating test context cache key
See gh-7524
Closes gh-8252
8 years ago
Phillip Webb ca1540cefe Update header copyright for changed files 8 years ago
Phillip Webb 5867cd6175 Polish 8 years ago
Andy Wilkinson 8318177b0d Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 70e802fba5 Use name from @SpyBean to disambiguate multiple candidates
Previously, @SpyBean's name attribute was not used when determining
the name of the bean to spy upon. When there were multiple candidates,
none of which were primary, this would lead to a failure to find the
bean to spy upon. This behaviour is also inconsistent with @MockBean
which does use the name attribute to identify the bean to mock.

This commit updates MockitoPostProcessor to use the name attribute,
when set, to identify the bean that should be spied upon. For
consistency with @MockBean it is always used when set. When not set
the previous logic will continue to be used.

Closes gh-8315
8 years ago
Johnny Lim 0adab8a2be Use logical 'and' instead of bitwise 'and'
Closes gh-8198
8 years ago
Andy Wilkinson b9b0cdb342 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 2f50d515a1 Apply root to URIs directly rather than relying on expansion
Previously, TestRestTemplate applied the root URI to URIs by
converting them to a String and then passing the String to the
RestTemplate delegate. Being a String, meant that the URI passed
through RestTemplate's standard URI template expansion processing
using the configured UriTemplateHandler. While this caused the root
URI to be applied, it also had the unwanted side-effect of
encoding the URI for a second time.

This commit updates TestRestTemplate so that, when configured with a
RootUriTemplateHandler, it applies the root URI directly and then
passes a modified URI to the RestTemplate delegate. Being a URI means
that no template expansion is performed and the possible double
encoding is avoided.

Closes gh-8163
8 years ago
Spring Buildmaster 5c12500366 Next Development Version 8 years ago
Spring Buildmaster a2696bf873 Next Development Version 8 years ago
Andy Wilkinson dd4051686b Remove empty test
The caching behaviour when using ImportAutoConfiguration is covered
by tests in spring-boot-test-auto-configuration, specifically by
ImportsContextCustomizerFactoryWithAutoConfigurationTests.

See gh-7953
8 years ago
Phillip Webb fa6a138598 Refine ImportsContextCustomizer cache logic
Update `ImportsContextCustomizer` so that whenever possible a more
specific cache key is used.

Prior to this commit the customizer would generate a key based on *all*
annotations on the test class. This has repeatedly caused issues where
test classes that should have the same cache key did not due to
unrelated annotations.

A new `DeterminableImports` interface has been added that can be
implemented by `ImportSelector` and `ImportBeanDefinitionRegistrar`
implementations that are able to determine their imports early. The
existing `ImportAutoConfigurationImportSelector` and
`AutoConfigurationPackages` classes have been retrofitted with
this interface.

Fixes gh-7953
8 years ago
Spring Buildmaster ed1ce140c0 Next Development Version 8 years ago
Stephane Nicoll 505e7f75ea Polish contribution
Closes gh-8089
8 years ago
dreis d58f38f6f6 Use String.replace() with single char if possible
See gh-8089
8 years ago
Andy Wilkinson b71baf2c38 Support @ContextHierarchy when using @SpringBootTest
Closes gh-8000
8 years ago