Commit Graph

829 Commits

Author SHA1 Message Date
Stephane Nicoll d4a1365a2a Polish contribution
Closes gh-5444
2016-04-05 13:34:44 +02:00
John Blum 67f92bff1e Polish Pivotal GemFire starter and sample
Closes gh-5439
2016-04-05 12:52:10 +02:00
Stephane Nicoll 05ef0818f8 Polish contribution
Closes gh-5511
2016-04-05 12:38:04 +02:00
Huang YunKun 6a2ff3f02a Upgrade elasticsearch to 2.2.0
Closes gh-5443
2016-04-05 12:38:04 +02:00
Phillip Webb b398b3319c Rename @SpringApplicationTest -> @SpringBootTest
Rename @SpringApplicationTest to SpringBootTest and
@SpringApplicationContextLoader to @SpringBootContextLoader.

Fixes gh-5562
2016-04-04 22:36:58 -07:00
Phillip Webb 4d404b214c Migrate away from @SpringApplicationConfiguration
Refactor internal tests to no longer use @SpringApplicationConfiguration

See gh-5562
2016-04-04 22:36:57 -07:00
Dave Syer 72db5becd6 Add comment to pom in sample explaining provided deps 2016-04-04 11:08:08 +01:00
Andy Wilkinson 33f0ea3480 Rework SpringApplicationTest to support web modes
Rework the new testing support so that @SpringApplicationTest can be
used for standard integration tests, web integration tests with a
mock Servlet environment and web integration tests with an embedded
servlet container. This means that it a replacement for 1.3's
@IntegrationTest and @WebIntegrationTest and allows all
SpringApplication testing to be configured using a common annotation.

The old @IntegrationTest and @WebIntegrationTest along with their
supporting classes have been reinstated to their previous form (while
remaining deprecated). This should ensure that they continue to work
in 1.4 exactly as they did in 1.3 giving users a smooth path to
@SpringApplicationTest.

See gh-5477
2016-03-31 21:35:10 -07:00
Johnny Lim a28dd9d9e6 Polish
Closes gh-5532
2016-03-30 08:43:23 +02:00
Stephane Nicoll f7ffb017ad Relocate static asset
Closes gh-5504
2016-03-29 09:34:27 +02:00
Phillip Webb 50cb72cb48 Ignore failing Maven goal from Eclipse 2016-03-25 12:46:53 -07:00
Phillip Webb a3bfc29e6e Fix warnings 2016-03-25 12:46:53 -07:00
Stephane Nicoll fd437797b6 Polish contribution
This commit polihes the original Neo4j contribution in several areas.

Rather than providing the packages to scan, this commit rearranges the
`EntityScan` and `EntityScanRegistrar` so that the logic can be shared
for other components. If no package is provided, scanning now defaults to
the "auto-configured" package(s) and a `@NodeEntityScan` annotation
allows to override that.

The configuration has also been updated to detect the driver based on the
`uri` property. If the embedded driver is available we use that by
default. If it is not available, we're trying to connect to a Neo4j
server running on localhost. It is possible to disable the embedded mode
or set the `uri` parameter explicitly to deviate from these defaults.

The sample no longer relies on the embedded driver for licensing reason:
rather it expects an instance running on localhost (like other
data-related samples) and gracefully ignore any connection error. A
README has been added in the sample to further explain the available
options;

Closes gh-5458
2016-03-25 11:39:49 +01:00
Michael Hunger 0658cc8aee Add Neo4j support
See gh-5458
2016-03-25 11:26:57 +01:00
Andy Wilkinson 13d4409f32 Merge branch '1.3.x' 2016-03-24 17:50:51 +00:00
Andy Wilkinson 58ca9a1c5d Add a BuildInfo task for generating build.properties with Gradle
The commit adds a new BuildInfo task that can be used to generate
a build.properties file, intended for inclusion in the Actuator's
info endpoint.

A default instance of the task can be configure using the plugin's
DSL:

springBoot {
	buildInfo()
}

Additional properties can also be configured using the DSL:

springBoot {
	buildInfo {
		additionalProperties = [
			'foo': 'bar'
		]
	}
}

When configured via the DSL, the Java plugin's classes task is
configured to depend on the build info task. Alternatively, if more
control is required, the task can be declared and configured manually:

task buildInfo(type: org.springframework.boot.gradle.buildinfo.BuildInfo) {
	additionalProperties = [
		'foo': 'bar'
	]
}

classes {
	dependsOn buildInfo
}

See gh-2559
2016-03-24 08:59:55 +00:00
Phillip Webb 247bdf9c84 Add a new spring-boot-sample-test application
Add a sample application that demonstrates recently added testing
features.

See gh-4901
2016-03-23 22:22:12 -07:00
Phillip Webb 0829a1bde8 Drop superfluous annotations
Update internal tests to drop annotations that can now
be inferred.

Fixes gh-5470
2016-03-23 22:19:36 -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
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
Phillip Webb 8d08e816a7 Fix tests that fail when Redis is unavailable 2016-03-21 23:11:04 -07:00
n27 e41d42171b Improve ActiveMQ connection pool configuration
Closes gh-1598
2016-03-18 09:26:24 +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
ddbullfrog 21c630828e Fix typo
Closes gh-5424
2016-03-16 09:29:12 +01:00
Stephane Nicoll 2526a54e31 Polish contribution
Closes gh-5337
2016-03-14 14:24:24 +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
Stephane Nicoll dddea70985 Collect and display build information
This commit updates the Maven plugin to generate a
`META-INF/boot/build.properties` file with various build-specific
settings (group, artifact, name, version and build time). Additionally,
the plugin can be configured to write an arbitrary number of additional
properties.

A new `BuildProperties` bean is automatically exposed when such a file is
present. If that bean is present, an `InfoContributor` is automatically
created to expose that information under the `build` key.

As for the git contributor, it is possible to only display the core
settings or everything using the `management.info.build.mode` property.

See gh-2559
2016-03-10 17:21:31 +01:00
Andy Wilkinson 86d87f6b8a Deprecate support for Velocity
Support for Velocity has been deprecated in Spring Framework 4.3 with
the plan being to remove it in 5.0. This commit deprecates Spring
Boot's support in 1.4, with the plan being to remove it in 2.0.

Closes gh-5276
2016-03-07 13:48:17 +00:00
Andy Wilkinson 5009933788 Move to constructor injection in simple configuration classes
This commit updates "simple" configuration classes to use constructor
injection. Simple means that there are no optional dependencies
(@Autowired(required=false) is not used), and none of the dependencies
use generics.

Configuration classes that are not simple will be updated in a second
pass once https://jira.spring.io/browse/SPR-14015 has been fixed.

See gh-5306
2016-03-04 12:27:29 +00:00
Phillip Webb 73cbb2f40a Polish 2016-03-03 09:14:24 -08:00
Stephane Nicoll 0490fbc7f8 Polish contribution
`InfoProvider` is now `InfoContributor` and contributes to the `Info`
instance via a builder. The `Info` instance is immutable. Each
contributor can be disabled via the `management.info.<name>.enabled`
key or all can be disabled using `management.info.defaults.enabled` (this
is similar to what the health endpoint does).

By default, all keys from the environment starting with `info.` are
exposed. If a `git.properties` file is present in the classpath, the
content of `GitInfo` is exposed using the `git` key.

A `SimpleInfoContributor` and `AbstractEnvironmentInfoContributor` are
available for convenience. `InfoContributor` instances can be ordered
the usual way, with a default order provided by
`InfoProviderAutoConfiguration#DEFAULT_ORDER`.

Closes gh-3492
2016-03-03 16:23:37 +01:00
Meang Akira Tanaka 8bebe6dea9 Info endpoint
See gh-3492
2016-03-03 14:39:55 +01:00
Andy Wilkinson 355860fd09 Remove @Autowired from constructors where class has single constructor
Closes gh-5226
2016-03-01 16:03:07 +00:00
Andy Wilkinson 3ca67e669d Polishing 2016-03-01 14:30:27 +00:00
Sebastien Deleuze 6fde504a63 Fix failing Content-Type related test after SPR-13631 changes 2016-03-01 15:05:22 +01:00
Stephane Nicoll 6741f05af1 Polish contribution
Closes gh-4903
2016-02-29 14:07:01 +01:00
Andy Wilkinson fa7dfb5109 Ignore tests that are broken by UNDERTOW-639 2016-02-26 18:24:56 +00:00
Ken Dombeck 9f93559d44 Fix logger classname
Closes gh-5254
2016-02-26 16:53:48 +01:00
Stephane Nicoll 5680ffdedb Fixup version numbers following release 2016-02-26 11:00:36 +01:00
Spring Buildmaster 225d877ab9 Next Development Version 2016-02-26 01:06:16 -08:00
Andy Wilkinson fcb5f03146 Upgrade to Hazelcast 3.6
Closes gh-5237
2016-02-25 20:15:02 +00:00
Andy Wilkinson 56487d23d6 Merge branch '1.3.x' 2016-02-25 20:00:34 +00:00
Vedran Pavic 6801e8208d Fix namespace declarations in Hazelcast xml's and make them consistent 2016-02-25 19:59:28 +00:00
Andy Wilkinson 01b7a7d9d3 Add missing copyright headers 2016-02-25 12:12:57 +00:00
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 2016-02-25 12:09:42 +00:00
Phillip Webb 34ae7e3eee Fix packages and annotations used in sample
Fixup accidental error in previous commit.
2016-02-22 12:07:49 -08:00
Phillip Webb 95c4cdbedc Fix packages and annotations used in sample
Update a few of the samples to correct the packages used in tests and
to make use of the `@SpringBootApplication` annotation.
2016-02-22 10:29:43 -08:00
Phillip Webb 89b7704977 Extract spring-boot-test.jar
Relocate the `org.springframework.boot.test` package from the
`spring-boot.jar` to `spring-boot-test.jar`.

Fixes gh-5184
2016-02-19 19:28:37 -08:00
Phillip Webb 4b55144d80 Polish 2016-02-19 16:19:22 -08:00
Andy Wilkinson 99b3af9216 Use a random server port in the Couchbase sample’s tests 2016-02-19 16:13:42 +00:00
Andy Wilkinson d66bc7b1ee Merge branch '1.3.x' 2016-02-18 12:48:10 +00:00
Andy Wilkinson d3074a086c Increase timeout for startup of embedded Cassandra
The integration tests for the Spring Data Cassandra sample application
fail intermittently, apparently due to Cassandra failing to start
within the default timeout period of 10000ms.

In attempt to get the tests to pass reliably, this commit increases
the timeout to 60000ms (1 minute).
2016-02-18 12:46:31 +00:00
Andy Wilkinson 3b068c8bc2 Upgrade to Spring Integration 4.3.0.M1
Closes gh-5163
2016-02-17 16:42:39 +00:00
Stephane Nicoll 64a5cad09a Improve couchbase support
Expose an `auto-index` property that controls if views and indexes
should be created automatically.

Update the sample so that it uses this new property, lowering the manual
steps to make it working on a vanilla couchbase server.

See gh-3498
2016-02-16 11:42:14 +01:00
Stephane Nicoll da3b49e024 Polish contribution
Closes gh-3499
2016-02-16 09:31:50 +01:00
Eddú Meléndez 76f1ca4188 Add Couchbase support
Closes gh-3498
2016-02-16 09:31:50 +01:00
Oliver Gierke e703997be2 Use new projection capabilities in Spring Data Hopper.
Uses interfaces instead of DTOs to implement projections. Works
around DATAJPA-864 [0].

[0] https://jira.spring.io/browse/DATAJPA-864
2016-02-15 15:19:54 +01:00
Stephane Nicoll ebffa493e4 Harmonize ConfigurationProperties bean name
When `@EnableConfigurationProperties` is defined, Spring Boot
automatically registers a bean in the context for each class specified
on the annotation. Previously, the name of the bean only included the
prefix which leads to conflict if two different classes use the same
prefix.

This commit changes the bean name structure to be <prefix>-<fqn> where
prefix is the prefix used on the annotation and <fqn> the fully qualified
name of the target class.

Closes gh-4395
2016-02-09 17:19:11 +01:00
Phillip Webb 2b18e99ac7 Polish 2016-02-08 11:01:52 -08:00
Phillip Webb 1cc1fc6431 Use AssertJ in spring-boot-samples
See gh-5083
2016-02-06 15:51:26 -08:00
Phillip Webb 516afcd2ca Polish 2016-02-06 15:02:12 -08:00
Stephane Nicoll 5bfccf42c4 Merge branch '1.3.x' 2016-02-02 11:24:00 +01:00
Karol Rynio 19afae7fe6 Fix typos
Closes gh-5025
2016-02-02 11:23:35 +01:00
Stephane Nicoll da5e0f6abe Remove reference to `spring-boot.version` in the build
Closes gh-5014
2016-01-26 13:24:16 +01:00
Stephane Nicoll 2b1c319867 Fix broken build
`server.session-timeout` was deprecated in 1.3 but still used in a sample
that broke once the support for it was removed. This commit fix the build
by using the expected property.
2016-01-26 10:08:02 +01:00
Stephane Nicoll e293008c3f Rename redis starter to spring-boot-starter-data-redis
Closes gh-1033
2016-01-26 08:31:34 +01:00
Stephane Nicoll bead239448 Remove support for Log4j
Apache Log4j 1.x is EOL and has now been replaced by log4j 2. This commit
removes the deprecated support for Log4j 1.x

See gh-4905
2016-01-25 14:06:06 +01:00
Phillip Webb fbaf209240 Move master to 1.4.0.BUILD-SNAPSHOT 2016-01-24 10:45:24 -08:00
Phillip Webb c77a7e0cba Fixup version numbers following release 2016-01-21 19:18:01 -08:00
Spring Buildmaster 504d3e97ba Next development version 2016-01-21 18:41:30 -08:00
Phillip Webb 7397dbaf57 Allow ExitCodeGenerator to be used on Exceptions
Update exit code support to allow the ExitCodeGenerator interface to
be placed on an Exception. Any uncaught exception implementing the
interface and returning a non `0` status will now trigger a System.exit
with the code.

Fixes gh-4803
2016-01-13 12:31:37 +00:00
Andy Wilkinson 2aff82bb64 Merge branch '1.2.x' 2016-01-12 10:19:36 +00:00
Stephane Nicoll ecf56f0708 Fixup version numbers following release 2015-12-18 15:07:13 +01:00
Spring Buildmaster 8db59059a5 Next Development Version 2015-12-18 05:43:02 -08:00
Stephane Nicoll bb736e255b Fix SNAPSHOT version 2015-12-17 14:15:14 +01:00
Kirill Vlasov 786aacf2e9 Use Collections.isEmpty() instead of .size() == 0
Ensure that Collections.isEmpty() is used to check if there are no
elements in a collections. This is more explicit and can be faster than
calling .size().

Closes gh-4783
2015-12-16 20:59:33 +00:00
Dave Syer c7c685f65f Disable hypermedia in actuator endpoints by default
This change permanently removes links from the endpoints that return
arrays or collections, and also disables them in the rest of the
endpoints (except /actuator) by default.

Fixes gh-4616
2015-12-16 11:00:22 +00:00
Stephane Nicoll f269383803 Polish contribution
Closes gh-4770
2015-12-14 14:49:22 +01:00
David Morley 288aa962c4 Rename method to clarify which connector is being created
See gh-4770
2015-12-14 14:44:48 +01:00
Eddú Meléndez 1b81d9f0b5 Add support for server.server-header property
Add a `server.server-header` property which can be used to override the
`server` header usually sent back automatically by Tomcat/Jetty or
Undertow.

See https://www.owasp.org/index.php/Securing_tomcat for background.

Fixes gh-4461
Closes gh-4504
2015-12-12 21:24:29 +00:00
Phillip Webb 7f8aff0231 Format HTML in web-ui sample 2015-12-11 13:41:38 +00:00
kozazz 0de4b6ce63 Add update/delete to the web-ui sample
Closes gh-4735
See gh-4733
2015-12-11 13:37:08 +00:00
Phillip Webb 0489a3b4de Polish 2015-12-10 19:43:29 +00:00
Andy Wilkinson 4f7752d467 Merge branch '1.2.x' 2015-12-10 13:45:15 +00:00
Andy Wilkinson ce541bebcf Align BasicErrorController’s HTML response status with non-HTML status
Previously, BasicErrorController would return the response status
set in the javax.servlet.error.status_code request attribute when
serving JSON but would also return a 200 OK response when serving
HTML. This didn’t cause much trouble when a person was browsing, but
proved problematic for machine clients that request text/html and care
about the response status. For example, the success handler would be
driven for an XHR request even though the response was really an error.

This commit updates BasicErrorController to set the response status for
text/html responses to match the status that it would use in an
application/json response.

Closes gh-4694
2015-12-10 13:40:16 +00:00
Andy Wilkinson 0e09408f91 Merge branch '1.2.x' 2015-12-03 11:10:52 +00:00
Ivan Chen d6bd120b2c Remove unused test.css from spring-boot-sample-tomcat
Closes gh-4606
2015-12-03 11:10:15 +00:00
Dave Syer 344360453e Add test for management.security.enabled=false with child context 2015-11-27 17:14:49 +00:00
Dave Syer 2de48a35ab Make /error the error page in child context as well as parent
If user set the management.port *and* the management.context-path
then the /error path was in the wrong place because formerly it
was implemented (in this case) by an MvcEndpoint. If we
switch it to a regular @Controller (which are now supported in the
child context if there is one) then it won't disappear under the
management.context-path.

Also use lazy request matching in ignores as well as secure paths.
The problem was that the ignores were constructed eagerly from the
actuator paths before they were available (the EndpointHandlerMapping
needs to be lazily accessed to avoid a security-induced bean creation
cascade).

Fixes gh-4624
2015-11-27 16:53:37 +00:00
Stephane Nicoll e19d9ff09d Fix gradle config for the bootRun task
Closes gh-4627
2015-11-27 10:23:12 +01:00
Johnny Lim 8ec00c35bf Polish
Closes gh-4572
2015-11-21 08:12:21 +01:00
Stephane Nicoll 14e7b10310 Fixup version numbers following release 2015-11-16 12:50:27 +01:00
Spring Buildmaster 3f6f57a80e Next Development Version 2015-11-16 03:18:54 -08:00
Johnny Lim 4d9111606b Polish docs
Closes gh-4446
2015-11-12 17:23:04 +01:00
Dave Syer 88f776ef17 Remove duplicate sample 2015-11-07 10:25:07 +00:00
Phillip Webb 6c2ea4648f Polish 2015-11-03 20:36:20 -08:00
Dave Syer fa9724becb Revert "Add or avoid proxy configurations for integration tests"
This reverts commit 251f2805a8.
2015-11-02 17:38:54 +00:00
mrumpf 251f2805a8 Add or avoid proxy configurations for integration tests
The Maven POM does all the dependency resolutions for the
spring-boot-antlib project. Delegating this task to Ivy, which is
buried deep in the Antrun/Antunit part of the build, makes any kind
of proxy configuration much more complex.
The ivysettings.xml already has the local M2 repository configured,
but because the folder "repository" is missing, the artifacts, already
downloaded by Maven cannot be resolved from this location.
The Spring and Maven Central repositories should be removed from the
ivysettings.xml files in order to force all resolves to be done through
the local M2 repository. The POM of joda-time version 2.8.1 has an
optional dependency to joda-convert 1.2, which lets the Ivy resolve
process fail, because this version of the joda-convert library was
not resolved by any of the Maven POMs. It seems as if Ivy does not
respect the optional scope, defined in the joda-time POM.

Pass proxy settings to the forked process to make the Gradle distribution download work

Create a gradle.properties file for each Gradle integration test and writes the forking
process' proxy settings as systemProp.http(s).Host/Port to the properties file.
This configures the external process with the right proxy settings to let it download
the Gradle distribution via the HTTP proxy server.

Added a hint for Windows users to get the core.autocrlf setting right

When the core.autocrlf setting under Windows is set to false for example
All files are not converted regarding their EOL characters to the
Windows format with CRLF at a line's end. There is a checkstyle
validation that checks that all files have the system's line endings
and in some test-cases the value from the system property "line.ending"
is used to check test output. So without the conversion, those checks
are going to fail, resulting in build errors.

Fixes gh-4367, fixes gh-3816
2015-11-02 17:23:30 +00:00