Currenlty the CloudPlatform auto-detection (used by the onCloudPlatformCondition) relies on environment properties detection. In some cases, like Kubernetes, we're strictly looking for environment variables, which are hard to mock for tests purposes.
This issue should introduce a new spring.main.cloud-platform configuration property for overriding the auto-detection and forcing a particular cloud platform.