title: Reflection - Set Private field in controller spring
body: <p>I use Spring MVC.</p>
  
  <p>I have a private field in my controller. The value for this field comes from the properties file as,</p>
  
  <pre><code>@Controller
  public Class MainController() {
  
     @Value("${my-value}")
     private int myValue;
  
  }
  </code></pre>
  
  <p>I have to override the value in for the selenium tests. How can I override the value for this field, means I want to set a customized value (so that the value is not taken from property file)?</p>
  
  <p>Can it be like this,</p>
  
  <pre><code>ReflectionTestUtils.setField(MainController.class, "myValue", 3, Integer.class);
  </code></pre>