title: Normalizing Spring Resource for use with JUnit & war?
body: <p>I'm probably thinking about this incorrectly, but here's what I'm up against:</p>
  
  <p>I'm injecting Spring Resource objects into my app that give me the location of security certificates, for example:<code>&lt;property name="certificateResource" value="SomeCert.p12" /&gt;</code> where certificateResource is of type <code>org.springframework.core.io.Resource</code></p>
  
  <p>Running under JUnit the Resource is a classpath resource and everything is fine. When deployed as a war under Tomcat the the Resource is in a Servlet Context and requires <code>WEB-INF/classes/</code> prepended to the certificate.</p>
  
  <p>I've tried a number of Resource prefix and wildcard combinations but can't come-up with a single string that satisfies both contexts. So far the "solution" is to override the bean definition in <code>src/test/resources/test-applicationContext.xm</code>l but that means maintaining the strings in two locations.</p>
  
  <p>Any pointers to better solutions would be appreciated, thanks.</p>