Since Spring boot 3.3.2, system properties and environment variables are not passed to runtime when executing bootTestRun using gradle:
val map = mapOf("abc" to "123")
tasks.named<org.springframework.boot.gradle.tasks.run.BootRun>("bootTestRun") {
environment(map)
systemProperties(map)
}
It was working fine in 3.3.1.
3.3.1:
System.getenv("abc"); // output: 123
System.getProperty("abc"); // output: 123
3.3.2:
System.getenv("abc"); // output: null
System.getProperty("abc"); // output: null