change application.properties value in spring boot application using @RefreshScope to take effect during runtime

I have a spring boot application that reads a value from a property from application.properties file in the Spring Boot Application. I want to use it as a switch and need to be able to change it during run time so that the code will switch as per the value configured to get the desired output.

As of now it is requiring a restart of the application. Here is what I am using:

    @Configuration
    @RefreshScope
    @PropertySource("classpath:application.properties")
    @Service
    public class MyServiceImpl implements MyService {

        @Value("${enabled}")
        private boolean SWITCH_ENABLED;

if (SWITCH_ENABLED==true) {
            // code for switch when true
        }
        else {
            // code for switch is false
        }

I have the following properties in the application.properties :

enabled=true

The value is not getting refreshed and takes effect only after restart. I tried using the spring-boot-actuator as well.