Commit Graph

157 Commits

Author SHA1 Message Date
Spring Buildmaster a89ef5df6e Next Development Version 2016-07-28 09:18:40 +00:00
Johnny Lim 9627d0ed66 Polish
Closes gh-6487
2016-07-27 12:29:33 +01:00
Spring Buildmaster 2216369348 Next Development Version 2016-07-04 14:15:02 +00:00
Spring Buildmaster 819a9574a6 Next Development Version 2016-05-10 05:28:34 +00:00
Andy Wilkinson 3348ed5bb3 Make use of new GetMapping and PostMapping annotations
Closes gh-5277
2016-05-09 17:08:16 +01:00
Spring Buildmaster 376bbe68d8 Next Development Version 2016-05-06 11:23:57 +00:00
Phillip Webb a7cb689f95 Move @LocalServerPort annotation
Move the @LocalServerPort to org.springframework.boot.context.embedded
since it's only really useful when working with embedded servlet
containers.

See gh-5822
2016-04-28 12:45:15 -07:00
Stephane Nicoll f364d713dd Add `LocalManagementPort`
Add an annotation alias for the actual management port, similar to what
was done for the main context (`LocalServerPort`).

See gh-5548
2016-04-15 14:02:38 +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
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
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
Stephane Nicoll 2526a54e31 Polish contribution
Closes gh-5337
2016-03-14 14:24:24 +01:00
Spring Buildmaster 225d877ab9 Next Development Version 2016-02-26 01:06:16 -08:00
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 2016-02-25 12:09:42 +00: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 1cc1fc6431 Use AssertJ in spring-boot-samples
See gh-5083
2016-02-06 15:51:26 -08:00
Phillip Webb fbaf209240 Move master to 1.4.0.BUILD-SNAPSHOT 2016-01-24 10:45:24 -08:00
Spring Buildmaster 504d3e97ba Next development version 2016-01-21 18:41:30 -08:00
Spring Buildmaster 8db59059a5 Next Development Version 2015-12-18 05:43:02 -08: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
Johnny Lim 8ec00c35bf Polish
Closes gh-4572
2015-11-21 08:12:21 +01:00
Spring Buildmaster 3f6f57a80e Next Development Version 2015-11-16 03:18:54 -08:00
Huang YunKun 1c5e445554 Update the samples to use @WebIntegrationTest and randomPort=true
Closes gh-4294
Closes gh-4271
2015-10-27 11:56:01 +00:00
Phillip Webb 1e4d974ec0 Merge remote-tracking branch 'local12x/1.2.x' 2015-10-19 12:56:55 -07:00
Phillip Webb a79131f8d2 Organize imports with new settings
See gh-4234
2015-10-19 12:55:44 -07:00
Spring Buildmaster 2b38a861e3 Next Development Version 2015-10-16 05:57:24 -07:00
Phillip Webb e473364e4e Merge branch '1.2.x' 2015-10-07 23:34:08 -07:00
Phillip Webb 6ab376e2e8 Reformat code use Eclipse Mars 2015-10-07 23:32:31 -07:00
Spring Buildmaster 9409c49c10 Next development version 2015-09-16 09:00:17 -07:00
Stephane Nicoll 7c0c953f81 Add value alias for SpringApplicationConfiguration
Given that Spring Boot uses java config accross the board, a new `value`
attribute is now aliased to the existing `classes` attribute such that
one could write the following:

@SpringApplicationConfiguration(MyConfig.class)
public class MyTest {}

Closes gh-3635
2015-08-19 17:09:34 +02:00
Spring Buildmaster 7ce391db4f Next development version 2015-07-01 22:48:01 -07:00
Phillip Webb 61fc4f3f12 Polish copyright headers 2015-06-23 10:22:14 -07:00
Phillip Webb 1ce617f1ae Polish sample package names 2015-06-23 00:47:12 -07:00
Spring Buildmaster 5d81c87b43 Next Development Version 2015-06-04 00:49:11 -07:00
Spring Buildmaster e03c11dda8 Next development version 2015-03-30 22:56:20 -07:00
Phillip Webb a57a88f5cf Move master to 1.3.0.BUILD-SNAPSHOT 2015-02-26 17:01:02 -08:00
Spring Buildmaster 8f0ad02237 Next development version 2015-02-26 15:26:53 -08:00
Spring Buildmaster 60725cd8bd Next development version 2015-01-07 23:37:07 -08:00
Spring Buildmaster 1a788c1741 Next development version 2014-12-10 16:35:50 -08:00
Andy Wilkinson ba40f13370 Update expectation to match response from anonymous access to /health 2014-10-28 09:39:40 +00:00
Andy Wilkinson 7287c66d88 Fix Actuator sample's health test 2014-10-08 18:58:34 +01:00
Phillip Webb 7d0a3ddcce Rename VanillaHealthIndicator to Application...
Rename `VanillaHealthIndicator` to `ApplicationHealthIndicator` and
changed the exposed bean name from `statusHealthIndicator` to
`applicationHealthIndicator`.

This provides less confusing JSON output:

  {"status":"UP","application":{"status":"UP"}}

vs:

  {"status":"UP","status":{"status":"UP"}}

Fixes gh-1291
2014-08-11 09:04:01 -07:00
Stephane Nicoll 249e09d9bc Switch master to 1.2.0.BUILD-SNAPSHOT 2014-07-11 10:44:05 +02:00
Spring Buildmaster 40327e1ae6 Next development version 2014-07-08 02:33:36 -07:00
Phillip Webb fa88c481a5 Remote trailing whitespace 2014-07-02 15:17:14 -07:00
Spring Buildmaster 981669b7c0 Next development version 2014-06-26 14:09:54 -07:00
Phillip Webb 200cd535c2 Revert "Next development version"
This reverts commit 67189477fe.
2014-06-26 11:03:09 -07:00
Spring Buildmaster 67189477fe Next development version 2014-06-26 10:51:35 -07:00
Spring Buildmaster 542f3cbda8 Next development version 2014-06-24 13:53:56 -07:00
Spring Buildmaster 4ca26a21dc Next development version 2014-06-11 10:46:27 -07:00
Spring Buildmaster 05ed7b3bcd Next development version 2014-06-10 12:40:35 -07:00
Phillip Webb 3007a777d0 Roll back to 1.1.0.BUILD-SNAPSHOT 2014-06-10 09:00:08 -07:00
Spring Buildmaster c650f2391e Next development version 2014-06-09 21:55:19 -07:00
Christian Dupuis 4648188782 Rework HealthEndpoint and HealthIndicator
With this commit the state of a component or subsystem becomes a first-class citizen in Boot's application health support. HealthIndicators now return a Health instance with status and some contextual details.

An aggregation strategy has been introduced to aggregate several Health instances into one final application Health instance. Out of the box OrderedHealthAggregator can be configured to allow different ordering or a custom HealthAggregator bean can be registered.
2014-05-22 12:27:03 +02:00
Christian Dupuis c38f9bcdfa Add missing tests 2014-05-08 16:58:52 +02:00
Dave Syer 030f00c36d Convert actuator-ui sample to FreeMarker
See gh-679
2014-04-30 13:04:19 +01:00
Phillip Webb 64a835e91a Move master to 1.1.0.BUILD-SNAPSHOT 2014-04-24 12:45:20 +01:00
Spring Buildmaster d3954a1703 Next development version 2014-04-24 02:24:28 -07:00
Phillip Webb fad5ce45db Polish 2014-04-23 12:35:33 +01:00
Dave Syer 7b07fe8ce0 Convert remaining samples to use random port
Partial fix for gh-337. See also gh-607 which complements this, but might
conflict on a merge.
2014-04-17 20:29:04 -07:00
Spring Buildmaster a5864ebcd0 Next development version 2014-04-06 22:43:18 -07:00
Spring Buildmaster 15e9dbe98b Next development version 2014-04-01 03:05:51 -07:00
Phillip Webb 1e68b7e0a9 Remove superfluous <packaging> tags from POMs 2014-04-01 02:07:43 -07:00
Phillip Webb 0af7f7e347 Add missing POM info 2014-04-01 02:07:42 -07:00
Phillip Webb 488b03387f Polish POM formatting 2014-04-01 02:07:36 -07:00
Phillip Webb 6f9bb233ad Revert "Next development version"
This reverts commit b67bb70ee3.
2014-04-01 00:38:48 -07:00
Spring Buildmaster b67bb70ee3 Next development version 2014-03-31 22:38:42 -07:00
Phillip Webb ac4cdd33c3 Revert "Next development version"
This reverts commit 1d0eea12eb.
Returning to 1.0.0.BUILD-SNAPSHOT for an updated release.
2014-03-31 17:14:30 -07:00
Spring Buildmaster 1d0eea12eb Next development version 2014-03-28 11:47:09 -07:00
Phillip Webb aca67066bf Rename RestTemplates to TestRestTemplate
Rename the RestTemplates to TestRestTemplate to help indicate that it's
primarily intended for testing. Also now extend RestTemplate to allow
direct use, rather than via factory methods.

Fixes gh-599
2014-03-27 11:22:03 -07:00
Phillip Webb 80ac1fb0cd Polish 2014-03-15 13:02:01 -07:00
Dave Syer 7a285cf65d Convert all sample tests to @IntegrationTest where appropriate
Makes them a lot more readable IMO, and also enables @Autowiring
from the context into the test case (sweeet). I added @DirtiesContext
to all of them as well to be on the safe side, but possbly that can be
optimized in some way as well.
2014-03-11 13:54:30 +00:00
Sebastien Deleuze ab6c8dfee3 Use org.springframework.boot groupId in spring-boot-samples
Use org.springframework.boot instead of ${project.groupId}
groupId in order to make it easier to use spring-boot-samples
modules as a starting point for new projects.
2014-03-07 17:02:20 +00:00
Spring Buildmaster b0d4e8ae69 Next development version 2014-03-03 22:46:12 -08:00
Spring Buildmaster cb8668a151 Release version 1.0.0.RC4 2014-03-03 22:46:05 -08:00
Spring Buildmaster 1367d57e8c Next development version 2014-02-13 13:19:12 -08:00
Spring Buildmaster eaff1677a7 Release version 1.0.0.RC3 2014-02-13 13:18:56 -08:00
Dave Syer 216bd16b7a Remove unneeded explicit versions in sample 2014-01-28 15:19:24 +00:00
Dave Syer 607b371706 Add thymeleaf starter
Fixes gh-264
2014-01-24 09:28:45 +00:00
Phillip Webb 0160760568 Apply latest eclipse cleanup rules 2014-01-21 16:28:26 -08:00
Phillip Webb 68293f34af Upgrade version to 1.0.0.BUILD-SNAPSHOT
Fixes fg-243
2014-01-21 00:43:54 -08:00
Dave Syer 559f907b54 Use explicit test dependencies in samples 2014-01-17 09:08:18 +00:00
Dave Syer f448e79f29 Remove long package names from samples
Long package names are really unnecessary in samples and they
just clutter things up. Also Spring Loaded doesn't work with
org.sfw packages, so to demo that technology you need a
different package name.
2013-12-31 08:40:26 +00:00
Dave Syer fa507005cd Use ServletWrappingController for jolokia instead of Servlet
We get more control over the handling and in particular the registration
of the endpoint this way. It was practically impossible to disable the
AgentServlet bean when in a parent context of the management server
because of lifecyce issues - you don't know that the user wants a
separate management server until too late.

This approach also makes it possible to test with spring-test MVC
support.
2013-12-20 19:49:48 +00:00
Dave Syer e2c962ac28 Switch to thymeleaf-spring4 2013-12-19 13:40:24 +00:00
Dave Syer ab4dec58ef Rename packages in samples 2013-12-18 20:05:33 -08:00
Dave Syer bcae284dd9 Add a shim Endpoint if management context is child
When management endpoints are on a different port the HandlerMappings
are restricted to a single EndpointHandlerMapping, so the error
controller (which is a normal @Controller with @RequestMappings) does
not get mapped.

Fixed by addinga shim Endpoint on "/error" that delegates to the
ErrorController (which interface picks up an extra method).
2013-12-05 09:56:00 +00:00
Dave Syer bd26b28aa5 Extract actuator security into separate classes
So spring-security + a web app is secure by default
(you don't need the actuator).
2013-11-21 16:47:29 +00:00
Phillip Webb 64f32893bb Source format and clean-up 2013-11-16 00:08:18 -08:00
Dave Syer e53dad879d Add sample with form login 2013-11-01 11:28:53 +00:00
Dave Syer 0498617411 Disable whitelabel view if Thymeleaf error.html detected 2013-10-23 10:48:14 -04:00
Phillip Webb a33425920b Rework POMs to support automated CI release 2013-09-05 22:05:29 -07:00
Dave Syer 38e565e920 Back to SNAPSHOT for dev 2013-09-05 17:15:15 -07:00
Dave Syer b634b3bde6 Update to 0.5.0.M2 2013-09-05 17:15:15 -07:00
Phillip Webb a95494fe61 Remove '/resources/**' mapping and default servlet
Remove '/resources/**' mapping since it can cause problems with the
'/**' when the developer defines their own 'resources' sub-folder.

Also remove default servlet config since the resources mapping renders
it redundant.

Issue: #55494446
2013-09-05 17:14:13 -07:00
Dave Syer 43fc107437 Fix security config
The management endpoints were still all mixed up
with the user endpoints. Fixed that and extracted
user endpoints in to conditional block so not
protected if path explicitly set to empty string.

[#53029715]
2013-09-05 17:14:11 -07:00
Dave Syer 521174754e Add default /error view for HTML clients
* Add integration tests for /error view
* Add "error" @Bean as default view for HTML

Users may see side effects because now there will be
a ContentNegotiatingViewResolver by default for the
first time in a vanilla Actuator app. Should be
interesting.

[Fixes #54597932] [bs-273] Circular view reference for /error
2013-08-07 10:55:30 +01:00