I understand that I can use @ConditionalOnExpression to enable or disable a component such as a @RestController, or @Service, or @Entity.  That is all clear.
However, Spring Boot has more.  It has application.properties configuration, it has @Autowired properties, it has @Test classes/methods.
For example, given I have feature flag defined in my application.properties file as:
myFeature.enabled=false
I want to disabled following:
- database connectivity settings in application.properties
 
    // I want to disable all these using myFeature.enabled flag
    spring.jpa.hibernate.ddl-auto=update
    spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/db_example
    spring.datasource.username=springuser
    spring.datasource.password=ThePassword
    spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
    #spring.jpa.show-sql: true
- an
@Autowiredproperty in a class and I only want to disable that one injected property 
    @Component
    public class FooService {  
        @Autowired
        private Foo foo; // I want to disable only this property using myFeature.enabled flag
    }
- Test class and I want to disable it (I know I can use 
@Ignoreor@Disable) using myFeature.enabled flag 
    @SpringBootTest
    public class EmployeeRestControllerIntegrationTest {
    
        ...
    
        // tests methods
    }
How do I disable these using myFeature.enabled flag?
I know that in case of an @Entity or @Controller class I can simply do something like below, but I dont know how to use same mechanism to disable the 3 above cases:
@Entity
@ConditionalOnExpression(${myFeature.enabled})
public class Employee {
   ...
}