@RestartScope is useful when working with testcontainers but with gradle we usually recommend that devtools is added to the developmentOnly configuration. It looks like this means it isn't available for tests.

We can add a new testAndDevelopmentOnly configuration similar to JavaPluginAction.configureDevelopmentOnlyConfiguration where JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME extends from developmentOnly?

Comment From: mhalbritter

When we change this, we have to update the documentation, too.

Comment From: candrews

When we change this, we have to update the documentation, too.

This change hasn't yet been made: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.testcontainers.at-development-time.devtools

Comment From: wilkinsona

Thanks, @candrews. I've opened https://github.com/spring-projects/spring-boot/issues/38571.