MockMvcWebDriverAutoConfiguration wraps, if org.springframework.security.concurrent.DelegatingSecurityContextExecutor is on the classpath, a DelegatingSecurityContextExecutor around a Executors.newSingleThreadExecutor() and configures this wrapped executor as the executor used by HtmlUnitDriver.

By default (when not setting the executor explicitly) HtmlUnitDriver uses an Executors.newCachedThreadPool(). I'm not sure what the implications of virtual threads will be here.

Comment From: mhalbritter

As we don't know what exactly the HtmlUnitDriver is doing and if it's pinning threads, we're not switching this to virtual threads. It's not scalability relevant, either.