Please, refer to the issue https://github.com/spring-cloud/spring-cloud-config/issues/2376

Unfortunately it was closed because the feedback was provided too late.

I found how to reproduce the issue in your Demo.

Pleas, modify your test class DemoApplicationTests


@SpringBootTest(properties = {
        "spring.config.import=optional:configserver:http://localhost:8065"
            })

Than you will see that the default value was returned instead of value from application.properties.