Commit Graph

574 Commits

Author SHA1 Message Date
Scott Frederick
51343139c2 Remove empty files
See gh-30875
2022-05-05 15:58:55 -05:00
Scott Frederick
6098b0c91f Merge branch '2.5.x' into 2.6.x
Closes gh-30876
2022-05-05 15:36:57 -05:00
Scott Frederick
8fe47aaebd Remove smoke tests that do nothing without a server
Fixes gh-30875
2022-05-05 15:35:38 -05:00
Andy Wilkinson
fa327a783d Merge branch '2.5.x' into 2.6.x
Closes gh-30850
2022-05-03 15:14:00 +01:00
Andy Wilkinson
4fd2e0c916 Polish "Fix typos"
See gh-30773
2022-05-03 14:09:53 +01:00
Andy Wilkinson
f6d24dc1a8 Fix typos
See gh-30773
2022-05-03 14:09:37 +01:00
Andy Wilkinson
d4348279a7 Merge branch '2.5.x' into 2.6.x
Closes gh-30666
2022-04-14 14:51:09 +01:00
Andy Wilkinson
8f1b8622ba Ensure that webEnvironment=NONE creates non-web context
Previously, if spring.main.web-application-type was configured in
application.properties to servlet or reactive, setting
webEnvironment=NONE on @SpringBootTest would not work correctly and
a servlet or reactive web application context would be created
based on the value of spring.main.web-application-type.

This commit updates the test context bootstapper to set
spring.main.web-application-type to none when webEnvironment has been
set to none. This is done in the merged context configuration's
property source properties which are applied to the environment in a
high-precedence test property source that will override configuration
in application.properties.

Closes gh-29695
2022-04-14 14:44:30 +01:00
Andy Wilkinson
344aa405ae Merge branch '2.5.x' into 2.6.x
Closes gh-30429
2022-03-25 11:14:46 +00:00
Andy Wilkinson
e36ac6c155 Polish "Enable Java 18 for LoaderIntegrationTests"
See gh-30422
2022-03-25 11:02:57 +00:00
Eddú Meléndez
e9c433a0b7 Enable Java 18 for LoaderIntegrationTests
See gh-30422
2022-03-25 11:02:42 +00:00
Moritz Halbritter
27ddcbd551 Merge branch '2.5.x' into 2.6.x 2022-03-23 13:46:33 +01:00
Moritz Halbritter
cd5d3dbf8d Disable SampleSessionWebFluxApplicationTests on Linux aarch64
These tests use embedded mongo under the hood.

See gh-30082
2022-03-23 13:45:25 +01:00
Moritz Halbritter
4e09289076 Merge branch '2.5.x' into 2.6.x
# Conflicts:
#	spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-mongodb/src/test/java/smoketest/data/mongo/SampleMongoApplicationTests.java
2022-03-23 12:04:30 +01:00
Moritz Halbritter
1d15e8c8e2 Disable SampleMongoApplicationTests on Linux aarch64
See gh-30082
2022-03-23 12:03:35 +01:00
Andy Wilkinson
f04a85957e Merge branch '2.5.x' into 2.6.x
Closes gh-30359
2022-03-22 10:36:17 +00:00
Andy Wilkinson
5473cd3abc Try to stabilize SampleSessionWebFluxApplicationTests
Closes gh-30353
2022-03-22 10:20:31 +00:00
Andy Wilkinson
0d4d225ebb Merge branch '2.5.x' into 2.6.x 2022-03-09 15:37:40 +00:00
Andy Wilkinson
a58cd050e5 Disable LoaderIntegrationTests when all runtimes are incompatible
See gh-29524
2022-03-09 15:36:53 +00:00
Andy Wilkinson
344f71c75a Merge branch '2.5.x' into 2.6.x
Closes gh-30087
2022-03-07 14:57:20 +00:00
Andy Wilkinson
4bcb7e2f77 Prevent ActiveProfilesTests from binding to 8080
Due to gh-29695, smoketest.profile.ActiveProfilesTests starts a web
server bound to the default port (8080) despite the test setting
`webEnvironment` to `NONE`.

This commit works around the problem by running the tests with
server.port set to zero.

Closes gh-30086
2022-03-07 14:55:00 +00:00
Andy Wilkinson
97222236fe Merge branch '2.5.x' into 2.6.x
Closes gh-30046
2022-03-03 11:05:27 +00:00
Andy Wilkinson
57f935faed Use a more relaxed AliasCheck for CI on Windows
ContextHandler.ApproveAliases has been deprecated. We tried to
replace it with AllowedResourceAliasChecker but it does not
behave in the same way and causes CI failures on Windows.
ContextHandler.ApproveAliases always returns true so we should
hardcode our own implementation that does the same.

Closes gh-30045
2022-03-03 11:01:48 +00:00
Andy Wilkinson
3614c8d1f8 Merge branch '2.5.x' into 2.6.x
Closes gh-29954
2022-02-22 20:08:31 +00:00
Andy Wilkinson
1e8d29f7aa Configure Kotlin compilation JVM target by convention
Closes gh-29952
2022-02-22 18:11:51 +00:00
Stephane Nicoll
78797572ac Merge branch '2.5.x' into 2.6.x 2022-02-16 16:51:27 +01:00
Stephane Nicoll
fa6a1463d0 Polish 2022-02-16 16:51:16 +01:00
Stephane Nicoll
dc171c6462 Upgrade to Jetty 9.4.45.v20220203
Closes gh-29791
2022-02-14 13:43:43 +01:00
Stephane Nicoll
a99582a3bb Upgrade to Jetty 9.4.45.v20220203
Closes gh-29771
2022-02-14 13:43:23 +01:00
Stephane Nicoll
136b5959c3 Merge branch '2.5.x' into 2.6.x
Closes gh-29612
2022-02-01 10:59:08 +01:00
Stephane Nicoll
7f17f819a6 Polish "Enforce use of BDDMockito"
See gh-29178
2022-02-01 10:03:18 +01:00
Yanming Zhou
b49418aaaf Enforce use of BDDMockito
1. Replace Mockito.verify*() with BDDMockito.then()
2. Replace Mockito.doReturn() with BDDMockito.willReturn()
3. Adjust checkstyle rule

See gh-29178
2022-02-01 09:37:15 +01:00
Madhura Bhave
3460c24a16 Ignore context path when calling privilege evaluator
Previously, the error page security filter passed the request's URI
to the privilege evaluator. This was incorrect in applications with
a custom context path as the privilege evaluator must be passed a
path that does not include the context path and the request URI
includes the context path.

This commit updates the filter to use UrlPathHelper's
pathWithinApplication instead. The path within the application does
not include the context path. In addition, pathWithinAppliation
also correctly handles applications configured with a servlet
mapping other than the default of /.

Closes gh-29299

Co-Authored-By: Andy Wilkinson <wilkinsona@vmware.com>
2022-01-20 12:36:18 +00:00
Andy Wilkinson
4c422b9f3c Merge branch '2.5.x' into 2.6.x 2022-01-19 17:24:17 +00:00
Andy Wilkinson
b60612dabb Disable LoaderIntegrationTests when Docker's unavailable
Closes gh-29385
2022-01-19 17:23:30 +00:00
Phillip Webb
f6cdc27b2a Merge branch '2.5.x' into 2.6.x 2022-01-18 18:48:40 -08:00
Phillip Webb
eca05c42fb Further refine LoaderIntegrationTests for CI
Update `LoaderIntegrationTests` to filter compatible JDKs early.

See gh-29385
2022-01-18 18:47:41 -08:00
Phillip Webb
392de30390 Merge branch '2.5.x' into 2.6.x 2022-01-18 18:18:56 -08:00
Phillip Webb
de8f8c3e64 Refine LoaderIntegrationTests for CI
Refine `LoaderIntegrationTests` to fix failures when CI builds are
running with later JDK versions.

See gh-29385
2022-01-18 18:16:47 -08:00
Phillip Webb
44537d4494 Merge branch '2.5.x' into 2.6.x
Closes gh-29462
2022-01-18 17:36:59 -08:00
Phillip Webb
3d908079ef Run LoaderIntegrationTests against multiple JDKs
Update `LoaderIntegrationTests` to run against OpenJDK 8, 11 and 17 as
well as Oracle JDK 17.

Closes gh-29385
2022-01-18 17:36:48 -08:00
Phillip Webb
14fe9347b5 Merge branch '2.5.x' into 2.6.x 2022-01-14 13:56:47 -08:00
Phillip Webb
3f7bf7d34f Modify SpringApplication Environment rather than setting it
Update `SpringBootContextLoader` so that when possible the
`SpringApplication` remains in control of creating the `Environment`
instance.

Prior to this commit, we would always create the `Environment` in the
`SpringBootContextLoader` and then call `setEnvironment` on the
`SpringApplication`. This meant that the `ApplicationEnvironment`
classes were not used and that `isCustomEnvironment` was set to `true`
so no conversion was applied.

With the updated code, an `ApplicationListener` is used to mutate the
`Environment` instance and add the required test property sources.

Fixes gh-29169
2022-01-14 13:47:22 -08:00
Phillip Webb
e7fe371927 Merge branch '2.5.x' into 2.6.x 2022-01-12 15:43:11 -08:00
Phillip Webb
27ad0804f5 Update copyright year of changed files 2022-01-12 15:42:25 -08:00
Phillip Webb
91d2b1b988 Merge branch '2.5.x' into 2.6.x
Closes gh-29374
2022-01-12 15:32:00 -08:00
Phillip Webb
eb6b48fff0 Use side-effect free environment with tests rather than converting
Refine the logic introduced in 64270eca to use a side-effect free
Environment implementation rather than converting the Environment early.

Early conversion can cause condition evaluation issues if
`src/test/resources/application.properties` files are bound to the
`SpringApplication`. Specifically the `spring.main.web-application-type`
property can change the `Environment` type which must happen before
conditions are evaluated.

Fixes gh-29169
2022-01-12 14:21:52 -08:00
Phillip Webb
72696cdb0f Merge branch '2.5.x' into 2.6.x
Closes gh-29371
2022-01-12 14:07:31 -08:00
Phillip Webb
7c16668bf3 Log Docker output to aid debugging
Add an SLF4J logger so that we can see real time output of the
Docker container.

See gh-29370
2022-01-12 14:03:27 -08:00
Madhura Bhave
d9d161cd6b Allow previously authorized users to access the error page
Prior to this commit, the `ErrorPageSecurityFilter` verified if
access to the error page was allowed by invoking the
`WebInvocationPrivilegeEvaluator` with the Authentication from the
`SecurityContextHolder`.
This meant that access to the error page was denied for a `null` Authentication
 or `AnonymousAuthenticationToken` in cases where the error page required
authenticated access. This prevented authorized users from accessing the
error page in case the Authentication wasn't retrievable for the error dispatch,
which is the case for `@Transient` authentication or stateless session policy.

This commit updates the `ErrorPageSecurityFilter` to check access to the error page
only if the error is an authn or authz error in cases where an authentication object
is not found in the SecurityContextHolder. This makes the error response consistent
when bad credentials or no credentials are used while also allowing access to previously
authorized users.

Fixes gh-28953
2021-12-17 16:58:58 -08:00