title: spring @Conditional in SpringJUnit4ClassRunner
body: <p>I need to load test properties in production environment when tests is performing by SpringJUnit4ClassRunner.</p>
  
  <p>I'm using @Conditional in my spring context to define test/production properties files, like:</p>
  
  <pre><code>@Configuration
  public class ContextResource {
  
  @Bean
  @Conditional(TestApplicationConfiguration.class)
  public static PropertySourcesPlaceholderConfigurer testProperties() {
      PropertySourcesPlaceholderConfigurer placeholderConfigurer = new PropertySourcesPlaceholderConfigurer();
      Resource [] resources = new Resource[] {
              new ClassPathResource("properties/constants/constants-test.properties")
      };
  
      placeholderConfigurer.setLocations(resources);
      return placeholderConfigurer;
  }
  
  @Bean
  @Conditional(ProductionApplicationConfiguration.class)
  public static PropertySourcesPlaceholderConfigurer productionProperties() {
      PropertySourcesPlaceholderConfigurer placeholderConfigurer = new PropertySourcesPlaceholderConfigurer();
      Resource [] resources = new Resource[] {
              new ClassPathResource("properties/constants/constants.properties")
      };
  
      placeholderConfigurer.setLocations(resources);
      return placeholderConfigurer;
  }
  </code></pre>
  
  <p>Also i'm using test with </p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  </code></pre>
  
  <p>When <i>ProductionApplicationConfiguration.class</i> returned false, <i>constants-test.properties</i> is loading and it's normal, but how can I tell my tests to load test properties even if <i>ProductionApplicationConfiguration.class</i> returned <i>true</i> ? </p>
  
  <p>Thank you in advance!</p>