Commit Graph

506 Commits

Author SHA1 Message Date
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
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
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
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
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
1d15e8c8e2 Disable SampleMongoApplicationTests on Linux aarch64
See gh-30082
2022-03-23 12:03:35 +01:00
Andy Wilkinson
5473cd3abc Try to stabilize SampleSessionWebFluxApplicationTests
Closes gh-30353
2022-03-22 10:20:31 +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
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
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
1e8d29f7aa Configure Kotlin compilation JVM target by convention
Closes gh-29952
2022-02-22 18:11:51 +00:00
Stephane Nicoll
fa6a1463d0 Polish 2022-02-16 16:51:16 +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
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
Andy Wilkinson
b60612dabb Disable LoaderIntegrationTests when Docker's unavailable
Closes gh-29385
2022-01-19 17:23:30 +00: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
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
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
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
27ad0804f5 Update copyright year of changed files 2022-01-12 15:42:25 -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
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
Phillip Webb
783981ba98 Merge branch '2.4.x' into 2.5.x 2021-12-16 13:48:25 -08:00
Phillip Webb
d336a96b7f Update web.xml xsd references to for 3.1 version
See gh-29075
2021-12-16 13:45:12 -08:00
Phillip Webb
17363d1b3a Merge branch '2.4.x' into 2.5.x
Closes gh-29076
2021-12-15 22:16:37 -08:00
Phillip Webb
1749c893dc Update web-app version to 3.1
Update the web-app version specified in `web.xml` to 3.1 in order to
make Eclipse happy.

Closes gh-29075
2021-12-15 22:14:52 -08:00
Andy Wilkinson
3b23c542a0 Test servlet 3.1 compatibility in deployment tests
Closes gh-28906
2021-12-09 12:24:43 +00:00
Scott Frederick
12244a8edd Remove use of Thymeleaf from smoke tests
Closes gh-28788
2021-11-23 12:13:05 -06:00
Andy Wilkinson
015cf920da Name custom task inputs
Closes gh-28753
2021-11-19 15:35:39 +00:00
Andy Wilkinson
88457d9cfa Merge branch '2.4.x' into 2.5.x
Closes gh-28734
2021-11-18 12:20:50 +00:00
Andy Wilkinson
7d19ea4ca1 Limit log output produced by spring-boot-deployment-tests:intTest
Closes gh-28730
2021-11-18 12:18:34 +00:00
Madhura Bhave
64270eca51 Convert environment used by SpringBootTestContextLoader
This commit aligns `SpringBootTest`s to also use `ApplicationEnvironment`
instead of `StandardEnvironment`. This prevents the side-effect of active
profiles from `@ActiveProfiles` from being added to the environment when
doGetActiveProfiles is called. In this case, calling `addActiveProfiles()`
in the environment post processor would result in `@ActiveProfiles` being
added to the environment first, resulting in the wrong order.

The additional call to `setActiveProfiles()` is also not necessary when using
ApplicationEnvironment because that call was put in place to prevent the side-effect
which `ApplicationEnvironment` does not have.

Fixes gh-28530
2021-11-17 16:40:53 -08:00
Andy Wilkinson
5e4a502b2d Merge branch '2.4.x' into 2.5.x
Closes gh-28661
2021-11-12 20:31:25 +00:00
Andy Wilkinson
2cec3971d7 Prohibit unwanted dependencies in all modules not just starters
Closes gh-28658
2021-11-12 20:04:35 +00:00
Andy Wilkinson
92fd3b79a5 Merge branch '2.4.x' into 2.5.x
Closes gh-28652
2021-11-12 13:05:14 +00:00
Andy Wilkinson
08aac25c00 Limit logging produced by spring-boot-loader-tests's intTest task
Closes gh-28651
2021-11-12 13:04:10 +00:00
Andy Wilkinson
7fe6f4887c Merge branch '2.4.x' into 2.5.x
Closes gh-28484
2021-10-29 13:48:23 +01:00
Andy Wilkinson
22d85e6d7b Allow tests to be run in parallel across multiple workers
Closes gh-19876
2021-10-29 12:48:45 +01:00
Stephane Nicoll
0103eb123b Merge branch '2.4.x' into 2.5.x
Closes gh-28278
2021-10-11 09:09:08 +02:00
dreis2211
ae1167e026 Remove unused settings.xml in integration tests
See gh-28269
2021-10-11 09:08:29 +02:00
Andy Wilkinson
322615d9c5 Merge branch '2.4.x' into 2.5.x
Closes gh-28199
2021-10-05 11:12:48 +01:00
Andy Wilkinson
8c3820f87e Fix up-to-date checking of syncAppSource tasks
Previously, the project version was used while filtering the apps
source during syncing but it was not considered as an input to
the task. This could result in the syncing being skipped even though
the project's version had changed.

This commit introduces a new custom task to make the configuration
more declarative and to allow the necessary input configuration to be
done in a single place.

Closes gh-28197
2021-10-05 11:08:22 +01:00
Andy Wilkinson
14a57adb53 Merge branch '2.4.x' into 2.5.x
Closes gh-28165
2021-10-01 14:16:20 +01:00
Andy Wilkinson
35b16ea04e Minimize dependencies of launch script test app
Closes gh-28164
2021-10-01 14:15:52 +01:00
Phillip Webb
5ba69634c9 Merge branch '2.4.x' into 2.5.x 2021-09-21 11:17:55 -07:00
Phillip Webb
dfd36673f7 Update copyright year of changed files 2021-09-21 11:17:19 -07:00
Andy Wilkinson
6d8ba3e8b1 Merge branch '2.4.x' into 2.5.x
Closes gh-27757
2021-08-18 17:56:32 +01:00