Commit Graph

309 Commits

Author SHA1 Message Date
Phillip Webb
9e1c78da99 Update copyright year of changed files 2021-06-08 18:03:46 -07:00
Madhura Bhave
b26e842050 Configure CORS in default security configuration for MVC
Fixes gh-11987
2021-05-19 14:40:57 -07:00
Andy Wilkinson
444474926c Configure JTA tests to write logs beneath build/
Closes gh-26440
2021-05-14 11:40:43 +01:00
Andy Wilkinson
2dd94b5554 Polish "Use try-with-resources statement"
See gh-26449
2021-05-13 11:37:10 +01:00
weixsun
5ba9db391f Use try-with-resources statements
See gh-26449
2021-05-13 11:36:14 +01:00
Andy Wilkinson
4c42810df9 Ensure that server tests pick up latest snapshots
Closes gh-25921
2021-05-04 09:51:15 +01:00
Andy Wilkinson
ad67c3d50f Avoid using yum (which requires http:// access) in launch script tests
Fixes gh-26240
2021-04-27 10:39:19 +01:00
Phillip Webb
f29c707e6c Increase SampleSessionApplicationTests timeout
Increase timeout in `SampleSessionApplicationTests` to fix flaky local
builds.
2021-04-13 21:05:26 -07:00
Andy Wilkinson
0bc5c2ba8c Ensure that containers' static resource handling not MVC's is used
Closes gh-25949
2021-04-09 17:48:03 +01:00
Andy Wilkinson
4d3d56abfe Try to stabilize SampleSessionWebFluxApplicationTests
userDefinedMappingsSecureByDefault in
SampleSessionWebFluxApplicationTests may fail with an NPE if the
session times out before the initial response is sent due to the absence
of a SESSION cookie in the response. The test uses a short session
timeout (2 seconds) and we've seen the problem occur on CI when,
presumably, a noisy neighbour has caused some CPU starvation.

This commit increases the timeout to 5 seconds to reduce the chance of
a short period of CPU starvation causing the test to fail.

Closes gh-25572
2021-03-10 14:06:40 +00:00
Andy Wilkinson
da3920bd46 Wait for process to exit to avoid race with file deletion
See gh-25457
2021-03-03 17:55:37 +00:00
Andy Wilkinson
c5cfb8750b Delete files after destroying processes that may be accessing them
Closes gh-25457
2021-03-03 16:42:49 +00:00
dreis2211
b0a6e92fb6 Speed up spring-boot-server-tests
See gh-25457
2021-03-03 13:34:41 +00:00
Andy Wilkinson
8f72ca6521 Use ResourceConfig customization to register endpoints with Jersey
Previously, actuator endpoints were registered with Jersey upon
injection of the ResourceConfig bean into a registrar class rather than
using a ResourceConfigCustomizer. This was done to fix a problem
when running the Actuator on a separate port where the main application
context's customizers were also applied to the management context,
breaking the singleton contract for those resources. This approach
meant that the registration could be performed at any point after the
ResourceConfig had been created. When Jersey's configured as a Filter
this resulted in the registration failing as the attempt was being made
after the Filter lifecyle callbacks which make the ResourceConfig
immutable.

This commit reworks the endpoint registration to be performed using a
ManagementContextResourceConfigCustomizer, a resource config customizer
that's only applied to the ResourceConfig that's used by the Actuator.
When there's a separate management context, this ResourceConfig is
created by the Actuator's auto-configuration and the management context
resource config customizers are applied to it during its creation. The
main application's customizers are not applied. When the actuator is
using the same context as the main application, this ResourceConfig is
created by the main application. In this case a
ResourceConfigCustomizer is defined that delegates to all
ManagementContextResourceConfigCustomizers, allowing them to register
the actuator endpoints with the main ResourceConfig.

Fixes gh-25262
2021-02-26 14:25:24 +00:00
dreis2211
4ff9e5edaa Split DeploymentIntegrationTests by container
Prior to this commit, every test started a new testcontainer. By splitting the
tests apart we can make use of static containers that are only instantiated once
per application (TomEE, Wildfly etc.)

See gh-25446
2021-02-26 14:04:17 +00:00
dreis2211
d55d8d6b19 Rename DeploymentIntegrationTests
See gh-25446
2021-02-26 14:04:08 +00:00
dreis2211
8bacbff629 Remove spring-boot-smoke-test-jta-jndi
See gh-25434
2021-02-25 18:02:25 +00:00
Andy Wilkinson
67479b6380 Add junit-platform-launcher dependency by convention
Closes gh-25074
2021-02-02 13:03:21 +00:00
Phillip Webb
939b5dfc26 Add junit-platform-launcher dependency
Update `build.gradle` files to ensure that `junit-platform-launcher` is
a `testRuntimeOnly` dependency. This ensures that tests can be run from
Eclipse.

Closes gh-25074
2021-02-01 15:31:28 -08:00
Madhura Bhave
9928d74a9e Revert fix to enable cors for actuator endpoints
The fix causes a Jersey application to fail in the absence
of a `CorsFilter` or `CorsConfigurationSource` bean.

See gh-11987
2021-01-04 12:25:43 -08:00
Phillip Webb
b351288f48 Fix integration test app detection
See gh-18631
2020-12-17 22:32:56 -08:00
Phillip Webb
a2a153ade6 Fix name clash with integration test apps
Rename "app" projects in `spring-boot-launch-script-tests` and
`spring-boot-loader-tests` to something unique.

See gh-18631
2020-12-17 22:00:12 -08:00
Phillip Webb
c4e41305d5 Prevent Tomcat URL "reflective access" warnings
Update the jar `Handler` class to support a non-reflective fallback
mechanism when possible. The updated code attempts to capture a regular
jar URL before our handler is installed. It can then use that URL as
context when creating the a fallback URL. The JDK jar `Handler` will
be copied from the context URL to the fallback URL.

Without this commit, resolving new Tomcat URLs of the form
`jar:war:file:...` would result in an ugly "Illegal reflective access"
warning.

Fixes gh-18631
2020-12-17 20:43:41 -08:00
Madhura Bhave
09e07428cc Configure CORS in default security configuration for MVC
Fixes gh-11987
2020-12-16 14:55:36 -08:00
Stephane Nicoll
07e32bf52e Merge branch '2.2.x' into 2.3.x
Closes gh-24347
2020-12-07 11:55:40 +01:00
Stephane Nicoll
f64b7f8465 Use proper CentOS base image
See gh-24344
2020-12-07 11:46:33 +01:00
Stephane Nicoll
a5a8545801 Switch integration tests to CentOS 7
This commit upgrades the docker image for CentOS to Centos 7.9 as
CentOs 6 is EOL since November 30. Given that CentOS 7 does no longer
support SysVinit, this commit also updates the integration tests to not
test this OS anymore.

Closes gh-24344
2020-12-07 10:33:29 +01:00
Phillip Webb
5f351a6983 Merge branch '2.2.x' into 2.3.x
Closes gh-24338
2020-12-04 18:21:57 -08:00
Phillip Webb
837fc83527 Fix checkstyle header violations
See gh-24337
2020-12-04 18:05:53 -08:00
Andy Wilkinson
4e9f702681 Only run deployment tests when war has material changes
Closes gh-24137
2020-11-20 12:05:51 +00:00
Stephane Nicoll
9e901b6e07 Upgrade to Testcontainers 1.15.0
Closes gh-24103
2020-11-10 16:24:16 +01:00
Stephane Nicoll
23ad2b4156 Rationalize Testcontainers image versions
This commit rationalizes the Docker image names used in integration
tests.

Closes gh-24107
2020-11-10 16:04:27 +01:00
Andy Wilkinson
8294083c99 Make deployment integration tests run when war changes
Closes gh-23996
2020-11-02 17:33:58 +00:00
Stephane Nicoll
b7a8b0f19b Hacking
See gh-23740
2020-10-20 09:32:40 +02:00
Andy Wilkinson
d50c8aa312 Update container versions used in deployment integration tests
Closes gh-23211
2020-09-07 16:43:27 +01:00
Andy Wilkinson
b9ee545c78 Improve robustness of DeploymentIntegrationTests
Closes gh-23207
2020-09-07 16:15:12 +01:00
Stephane Nicoll
a341d00529 Review instructions for running launch script tests with Gradle
Closes gh-20606
2020-09-01 11:30:50 +02:00
Phillip Webb
ba2ab3363b Merge branch '2.2.x' into 2.3.x 2020-08-18 15:38:53 -07:00
Phillip Webb
4e76138ebc Update copyright year of changed files 2020-08-18 15:37:59 -07:00
Stephane Nicoll
980ddcffd0 Merge branch '2.2.x' into 2.3.x
Closes gh-22849
2020-08-10 16:05:13 +02:00
Stephane Nicoll
dd9c9fd171 Polish "Migrate legacy endpoint that have a dash in their id"
See gh-21615
2020-08-10 14:53:18 +02:00
Gabriele Bianchet-David
0f9f10f97e Migrate legacy endpoint that have a dash in their id
See gh-21615
2020-08-10 14:42:46 +02:00
Andy Wilkinson
8f27ad9726 Remove version from name of Ant-built jar
Previously, the project version was included in the name of the
Ant-built jar and the integration test assumed that there would be a
single jar in the output directory. This assumption did not hold true
if the project's version had changed and the project had been built
again without a clean. This resulted in two jars, one for the previous
version and one for the current version, in the output directory. This
caused a test failure.

This commit updates the build.xml to remove the version from the name
of the Ant-built jar and updates the integration test to find it.

Closes gh-22782
2020-08-07 09:49:14 +01:00
Andy Wilkinson
1233288df0 Disable JarLaunchScriptIntegrationTests without Docker
See gh-21388
2020-08-04 18:23:06 +01:00
Andy Wilkinson
323b097623 Merge branch '2.2.x' into 2.3.x
Closes gh-22721
2020-08-04 13:32:49 +01:00
Andy Wilkinson
84ff233590 Polish "Test the launch script when executed directly"
See gh-21388
2020-08-04 11:29:53 +01:00
Alexey Vinogradov
02a6a84499 Test the launch script when executed directly
See gh-21388
2020-08-04 10:18:35 +01:00
Andy Wilkinson
cba9f5b86e Avoid having multiple wars when project's version changes
Fixes gh-21606
2020-07-30 17:58:17 +01:00
Andy Wilkinson
4a828c7db1 Merge branch '2.1.x' into 2.2.x 2020-07-25 09:10:50 +01:00
Andy Wilkinson
2e1366f61f Make spring-boot-dependencies available when building test app 2020-07-24 18:30:52 +01:00