title: Override Spring XML Property with Java Code
body: <p>I currently have a default properties file defined in my Spring XML file. I also have a number of integration tests that each need to use a specific properties files that are different from the default.</p>
  
  <p>What is the best way for each test to override this and specify the properties file that needs to be used?</p>
  
  <p>I tried using the Java annotation:</p>
  
  <pre><code>    @PropertySource({ "classpath:integrationTest.properties" })
  </code></pre>
  
  <p>But the test still loads the default properties file defined in my XML.</p>