Commit Graph

7761 Commits

Author SHA1 Message Date
Phillip Webb 513dec718f Add TestExcludeFilter for component scanning
Add a new TypeFilter specifically for excluding candidate components.
The filter is applied to `@SpringBootApplication` and allows tests to
dynamically contribute exclude filters so that specific classes of
component can be excluded.

See gh-5295
See gh-4901
2016-03-23 22:18:46 -07:00
Phillip Webb 965dd33ec8 Introduce @SpringBootConfiguration annotation
Add a new @SpringBootConfiguration annotation that can be used to
indicate the primary application configuration. The new annotation is
primarily indented to allow test automatically code to find the main
configuration class.

See gh-5295
2016-03-23 22:18:43 -07:00
Phillip Webb 40c2e24a58 Fix SpringApplicationContextLoader customizers
Update SpringApplicationContextLoader to call ContextCustomizers in the
same way as other classes in `spring-test`.

Fixes gh-5294
2016-03-23 22:18:22 -07:00
Phillip Webb c28f552883 Migrate SpringJUnit4ClassRunner to SpringRunner
Replace all existing SpringJUnit4ClassRunner references with the new
SpringRunner alias.

Fixes gh-5292
2016-03-23 22:18:18 -07:00
Phillip Webb 2f815a907a Migrate existing tests from deprecated package
Update the existing tests to use the relocated `spring-boot-test`
classes. Restructuring was achieved using the following command:

find . -type f -name '*.java' -exec sed -i '' \
-e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/\
org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \
-e s/org.springframework.boot.test.EnvironmentTestUtils/\
org.springframework.boot.test.util.EnvironmentTestUtils/g \
-e s/org.springframework.boot.test.IntegrationTest/\
org.springframework.boot.test.context.IntegrationTest/g \
-e s/org.springframework.boot.test.IntegrationTestPropertiesListener/\
org.springframework.boot.test.context.IntegrationTestPropertiesListener/g \
-e s/org.springframework.boot.test.OutputCapture/\
org.springframework.boot.test.rule.OutputCapture/g \
-e s/org.springframework.boot.test.SpringApplicationConfiguration/\
org.springframework.boot.test.context.SpringApplicationConfiguration/g \
-e s/org.springframework.boot.test.SpringApplicationContextLoader/\
org.springframework.boot.test.context.SpringApplicationContextLoader/g \
-e s/org.springframework.boot.test.SpringBootMockServletContext/\
org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \
-e s/org.springframework.boot.test.TestRestTemplate/\
org.springframework.boot.test.web.client.TestRestTemplate/g \
-e s/org.springframework.boot.test.WebIntegrationTest/\
org.springframework.boot.test.context.web.WebIntegrationTest/g {} \;

See gh-5293
2016-03-23 22:17:50 -07:00
Phillip Webb aef7f4bcb1 Restructure spring-boot-test packages
Create a new package structure for `spring-boot-test` and deprecate
existing classes.

Fixes gh-5293
2016-03-23 22:17:27 -07:00
Phillip Webb da1e49703b Add JSONassert and JsonPath to the test starter
Update spring-boot-starter-test to include JSONassert and JsonPath.
Both are generally useful libraries when writing MVC tests.

Fixes gh-5469
2016-03-23 21:52:09 -07:00
Phillip Webb 47fb614bde Set "proxy target class" for transaction managers
Update `@EnableTransactionManagement` so that `proxyTargetClass` is
set to true. This ensures that @Transactional beans that aren't
interface based can still be proxied.

Fixes gh-5423
2016-03-23 21:52:09 -07:00
Phillip Webb 4352707eb3 Call afterProperties set in LogFileMvcEndpoint
Call afterPropertiesSet on the delegate `ResourceHttpRequestHandler`
to prevent an NPE. This change is required following SPR-13834.
2016-03-23 21:52:09 -07:00
Phillip Webb 1b6c2a3e5e Polish 2016-03-23 20:06:03 -07:00
Stephane Nicoll caa14e6be5 Polish 2016-03-23 17:38:20 +01:00
Andy Wilkinson 19d8c5e6f6 Complete the move to constructor injection in configuration classes
This is a follow-on from the work done in 5009933. Now that SPR-14015
has been fixed, constructor injection can also be used for parameterised
dependencies, including optional dependencies that are injected via
an ObjectProvider.

Closes gh-5306
2016-03-23 14:43:04 +00:00
Stephane Nicoll cb2ad7fb87 Prevent Thymeleaf to be configured with Thymeleaf 3
Spring Boot does not support Thymeleaf 3 yet. This commit prevents the
auto-configuration to activate if Thymeleaf 3 is available on the
classpath.

Closes gh-5371
2016-03-22 11:43:58 +01:00
Stephane Nicoll 93f392134a Polish 2016-03-22 11:35:02 +01:00
Phillip Webb 8d08e816a7 Fix tests that fail when Redis is unavailable 2016-03-21 23:11:04 -07:00
Phillip Webb 7942d9f787 Polish 2016-03-21 22:52:25 -07:00
Stephane Nicoll 2ae1435916 Polish 2016-03-21 15:43:27 +01:00
Stephane Nicoll 24f09e28c4 Prevent Redis to be initiated
This commit excludes the Redis auto-configuration that would attempt
to connect to a redis instance running at localhost otherwise.
2016-03-21 15:37:14 +01:00
Stephane Nicoll d8c972c27e Merge branch '1.3.x' 2016-03-21 11:56:21 +01:00
Stephane Nicoll b1b84a358d Fix Artemis embedded mode condition
This commit prevents the Artemis embedded mode to kick-in if the
`EmbeddedJMS` class it not in the classpath. The previous condition would
match if only `artemis-server` was on the classpath while
`artemis-jms-server` is actually required.

Closes gh-5452
2016-03-21 11:55:59 +01:00
Stephane Nicoll a243b3e177 Merge pull request #5455 from eddumelendez/gh-5448
* pr/5455:
  Polish contribution
  Auto-configure Redis repositories
2016-03-21 11:02:30 +01:00
Stephane Nicoll 96b7419916 Polish contribution
Closes gh-5455
2016-03-21 11:02:22 +01:00
Eddú Meléndez 2fc2ec457b Auto-configure Redis repositories
Closes gh-5448
2016-03-21 10:47:23 +01:00
Stephane Nicoll b8bc4f66e5 Align dependencies for Spring Data Hopper RC1
Align dependencies upgrade of the Hopper release.

Closes gh-5150
See gh-5443
2016-03-18 14:21:58 +01:00
Stephane Nicoll 29b4e381fa Upgrade to Spring Data Hopper RC1
Closes gh-5150
2016-03-18 13:24:47 +01:00
Stephane Nicoll 3109fd5034 Merge pull request #5417 from mdeinum/gh-5416
* pr/5417:
  Polish contribution
  Support setting webAllowOthers for the H2 Web Console
2016-03-18 13:06:05 +01:00
Stephane Nicoll bca83bde5b Polish contribution
Closes gh-5417
2016-03-18 13:05:44 +01:00
Marten Deinum ec8b94f13c Support setting webAllowOthers for the H2 Web Console
This commit adds a configuration option for the webAllowOthers option
for the H2 WebServlet. It will only be added it the
spring.h2.console.webAllowOthers is set to true, else it will be
ignored.

Closes gh-5416
2016-03-18 12:45:39 +01:00
Stephane Nicoll 52461b42ae Merge pull request #5372 from herau/fix/1598
* pr/5372:
  Polish contribution
  Improve ActiveMQ connection pool configuration
2016-03-18 11:23:44 +01:00
Stephane Nicoll 3d4a9d9c84 Polish contribution
The properties exposed by the ActiveMQ pooled connection factory are
quite specific and I felt it was arbitrary to expose some and not others.

However, the number of connections and the timeouts seem the most useful
so they have been kept and a `configuration` nested namespace can be
used to configure any additional settings.

The core properties have been renamed to be less "raw" and more compliant
with the structure of other properties. The documentation on fields has
also been aligned.

Closes gh-5372
2016-03-18 11:23:09 +01:00
n27 e41d42171b Improve ActiveMQ connection pool configuration
Closes gh-1598
2016-03-18 09:26:24 +01:00
Stephane Nicoll fa84b179a8 Allow to customize the Couchbase environment
Closes gh-5403
2016-03-18 09:08:41 +01:00
Stephane Nicoll caf11e4445 Add Couchbase cache support
This commit updates the cache auto-configuration to provide a
`CouchbaseCacheManager` if a `Bucket` has been configured.

The global customizer infrastructure allows to further tune the cache
manager if necessary.

Closes gh-5176
2016-03-18 07:52:56 +01:00
Stephane Nicoll 10012cfddc Rename Maven plugin mojo
Rename the goal from `generate-build-info` to `build-info` for consistency.

See gh-2559
2016-03-17 16:58:08 +01:00
Stephane Nicoll 9c733128ac Use ConditionalOnSingleCandidate when appropriate
This commit updates various auto-configuration to use
`@ConditionalOnSingleCandidate` rather than assuming that at most one
bean of a given type will be available.

Closes gh-2784
2016-03-17 15:15:59 +01:00
Stephane Nicoll 4ebba984f0 Merge pull request #5341 from garyrussell/GH-5340
* pr/5341:
  Polish contribution
  Add Retry Config: Template and Listener
2016-03-17 13:26:22 +01:00
Stephane Nicoll 25f00b9bb8 Polish contribution
Closes gh-5341
2016-03-17 13:25:35 +01:00
Gary Russell 08732fe4c8 Add Retry Config: Template and Listener
Also add requeue rejected to listener config and
timeouts to RabbitTemplate config.

Closes gh-5340
2016-03-17 13:01:33 +01:00
Stephane Nicoll f4bb9e3ba7 Polish doc
Closes gh-5404
2016-03-17 12:53:32 +01:00
Stephane Nicoll f699bd2435 Fix build
`@ManagedResource` annotated bean must be public.
2016-03-17 11:50:48 +01:00
Stephane Nicoll 5473b1fcf4 Merge pull request #5424 from ddbullfrog/patch-1
* pr/5424:
  Fix typo
2016-03-16 09:29:31 +01:00
ddbullfrog 21c630828e Fix typo
Closes gh-5424
2016-03-16 09:29:12 +01:00
Stephane Nicoll a5a8c567cf Merge branch '1.3.x' 2016-03-15 12:16:56 +01:00
Stephane Nicoll 3c15ddf807 Fix version of Spring Framework in doc
Closes gh-5415
2016-03-15 12:15:31 +01:00
Stephane Nicoll 34852f772b Fix typo
Closes gh-5409
2016-03-15 08:34:14 +01:00
Stephane Nicoll fca6dbaf09 Merge pull request #5337 from anandshah123/feature/gh-5262-advance
* pr/5337:
  Polish contribution
  Add `@LocalServerPort`
2016-03-14 14:24:33 +01:00
Stephane Nicoll 2526a54e31 Polish contribution
Closes gh-5337
2016-03-14 14:24:24 +01:00
Anand Shah f6a32a1d5a Add `@LocalServerPort`
Closes gh-5262
2016-03-14 14:24:24 +01:00
Stephane Nicoll a3a38c6bbc Fix build 2016-03-14 14:24:14 +01:00
Stephane Nicoll e67f2e2983 Separate Couchbase setup from Spring Data
This commit separates the basic setup of Couchbase from Spring Data so
that a `Bucket` and `Cluster` bucket beans are exposed even if Spring
Data is not available.

A basic setup happens if `spring.couchbase.bootstrap-hosts` is specified,
configuring the `default` bucket with no authentication unless specified
otherwise.

If Spring Data is available, those beans are re-used by default to
configure the `CouchbaseTemplate` and other repository-related beans.

Closes gh-5347
2016-03-14 11:11:48 +01:00