Commit Graph

309 Commits (2.3.x)

Author SHA1 Message Date
Phillip Webb 9e1c78da99 Update copyright year of changed files 3 years ago
Madhura Bhave b26e842050 Configure CORS in default security configuration for MVC
Fixes gh-11987
4 years ago
Andy Wilkinson 444474926c Configure JTA tests to write logs beneath build/
Closes gh-26440
4 years ago
Andy Wilkinson 2dd94b5554 Polish "Use try-with-resources statement"
See gh-26449
4 years ago
weixsun 5ba9db391f Use try-with-resources statements
See gh-26449
4 years ago
Andy Wilkinson 4c42810df9 Ensure that server tests pick up latest snapshots
Closes gh-25921
4 years ago
Andy Wilkinson ad67c3d50f Avoid using yum (which requires http:// access) in launch script tests
Fixes gh-26240
4 years ago
Phillip Webb f29c707e6c Increase SampleSessionApplicationTests timeout
Increase timeout in `SampleSessionApplicationTests` to fix flaky local
builds.
4 years ago
Andy Wilkinson 0bc5c2ba8c Ensure that containers' static resource handling not MVC's is used
Closes gh-25949
4 years ago
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
4 years ago
Andy Wilkinson da3920bd46 Wait for process to exit to avoid race with file deletion
See gh-25457
4 years ago
Andy Wilkinson c5cfb8750b Delete files after destroying processes that may be accessing them
Closes gh-25457
4 years ago
dreis2211 b0a6e92fb6 Speed up spring-boot-server-tests
See gh-25457
4 years ago
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
4 years ago
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
4 years ago
dreis2211 d55d8d6b19 Rename DeploymentIntegrationTests
See gh-25446
4 years ago
dreis2211 8bacbff629 Remove spring-boot-smoke-test-jta-jndi
See gh-25434
4 years ago
Andy Wilkinson 67479b6380 Add junit-platform-launcher dependency by convention
Closes gh-25074
4 years ago
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
4 years ago
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
4 years ago
Phillip Webb b351288f48 Fix integration test app detection
See gh-18631
4 years ago
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
4 years ago
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
4 years ago
Madhura Bhave 09e07428cc Configure CORS in default security configuration for MVC
Fixes gh-11987
4 years ago
Stephane Nicoll 07e32bf52e Merge branch '2.2.x' into 2.3.x
Closes gh-24347
4 years ago
Stephane Nicoll f64b7f8465 Use proper CentOS base image
See gh-24344
4 years ago
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
4 years ago
Phillip Webb 5f351a6983 Merge branch '2.2.x' into 2.3.x
Closes gh-24338
4 years ago
Phillip Webb 837fc83527 Fix checkstyle header violations
See gh-24337
4 years ago
Andy Wilkinson 4e9f702681 Only run deployment tests when war has material changes
Closes gh-24137
4 years ago
Stephane Nicoll 9e901b6e07 Upgrade to Testcontainers 1.15.0
Closes gh-24103
4 years ago
Stephane Nicoll 23ad2b4156 Rationalize Testcontainers image versions
This commit rationalizes the Docker image names used in integration
tests.

Closes gh-24107
4 years ago
Andy Wilkinson 8294083c99 Make deployment integration tests run when war changes
Closes gh-23996
4 years ago
Stephane Nicoll b7a8b0f19b Hacking
See gh-23740
4 years ago
Andy Wilkinson d50c8aa312 Update container versions used in deployment integration tests
Closes gh-23211
4 years ago
Andy Wilkinson b9ee545c78 Improve robustness of DeploymentIntegrationTests
Closes gh-23207
4 years ago
Stephane Nicoll a341d00529 Review instructions for running launch script tests with Gradle
Closes gh-20606
4 years ago
Phillip Webb ba2ab3363b Merge branch '2.2.x' into 2.3.x 4 years ago
Phillip Webb 4e76138ebc Update copyright year of changed files 4 years ago
Stephane Nicoll 980ddcffd0 Merge branch '2.2.x' into 2.3.x
Closes gh-22849
4 years ago
Stephane Nicoll dd9c9fd171 Polish "Migrate legacy endpoint that have a dash in their id"
See gh-21615
4 years ago
Gabriele Bianchet-David 0f9f10f97e Migrate legacy endpoint that have a dash in their id
See gh-21615
4 years ago
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
4 years ago
Andy Wilkinson 1233288df0 Disable JarLaunchScriptIntegrationTests without Docker
See gh-21388
4 years ago
Andy Wilkinson 323b097623 Merge branch '2.2.x' into 2.3.x
Closes gh-22721
4 years ago
Andy Wilkinson 84ff233590 Polish "Test the launch script when executed directly"
See gh-21388
4 years ago
Alexey Vinogradov 02a6a84499 Test the launch script when executed directly
See gh-21388
4 years ago
Andy Wilkinson cba9f5b86e Avoid having multiple wars when project's version changes
Fixes gh-21606
4 years ago
Andy Wilkinson 4a828c7db1 Merge branch '2.1.x' into 2.2.x 4 years ago
Andy Wilkinson 2e1366f61f Make spring-boot-dependencies available when building test app 4 years ago