Gradle 9 prereq: remove smoke test dependencies on Spring Boot launcher#4616
Closed
Gradle 9 prereq: remove smoke test dependencies on Spring Boot launcher#4616
Conversation
Convert remaining smoke tests from Spring Boot to embedded Tomcat + Spring MVC to preserve Java 8 test coverage: - JettyNativeHandler: Remove unused Spring Boot dependency - gRPC: Replace Spring Boot with embedded Tomcat + Spring MVC + gRPC server - RuntimeAttach: Preserve ApplicationInsights.attach() call - RuntimeAttachWithDelayedConnectionString: Preserve ConnectionString.configure() - SystemExit: Preserve System.exit() test logic (added SLF4J for logging) - AzureFunctions: Preserve Azure Functions worker simulation All tests now use Java 8-compatible dependencies: - spring-webmvc:5.3.39 - tomcat-embed-core:9.0.98 - javax.servlet-api:4.0.1 This avoids Spring Boot 3.x's Java 17 launcher requirement entirely while maintaining full Java 8 test coverage.
b0970af to
8571c80
Compare
trask
commented
Feb 6, 2026
Comment on lines
+37
to
+53
| // Start embedded Tomcat with Spring MVC | ||
| Tomcat tomcat = new Tomcat(); | ||
| tomcat.setPort(8080); | ||
| tomcat.getConnector(); | ||
| Context context = tomcat.addContext("", System.getProperty("java.io.tmpdir")); | ||
|
|
||
| AnnotationConfigWebApplicationContext appContext = new AnnotationConfigWebApplicationContext(); | ||
| appContext.setServletContext(context.getServletContext()); | ||
| appContext.register(SpringBootApp.class); | ||
| appContext.refresh(); | ||
|
|
||
| DispatcherServlet dispatcher = new DispatcherServlet(appContext); | ||
| Tomcat.addServlet(context, "dispatcher", dispatcher).setLoadOnStartup(1); | ||
| context.addServletMappingDecoded("/*", "dispatcher"); | ||
|
|
||
| tomcat.start(); | ||
| tomcat.getServer().await(); |
Member
Author
There was a problem hiding this comment.
there's a good bit of duplication of this block of code among these tests
I think that's ok since these are "standalone applications under test"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keeping dependencies on Spring, only removing dependencies on Spring Boot launcher.
Reason: upgrading to Gradle 9.3.1 forces an upgrade of Spring Boot Gradle plugin from 2.5.12 to 3.4.2 (Spring Boot 2.7.x uses deprecated Gradle APIs removed in Gradle 9). Spring Boot 3.x compiles its
bootJarlauncher classes for Java 17+, making it impossible to run these JARs on Java 8 (which we want to continue testing against).