title: @Value "Could not resolve placeholder" in Spring Boot Test
body: <p>I want to take a Junit test for Spring-boot as below:</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(classes = {ApplicationTest.class})
  public class TestOnSpring {
      @Value("${app.name}")
      private String appName;
  
      @Test
      public void testValue(){
          System.out.println(appName);
      }
  }
  </code></pre>
  
  <p>and ApplicationTest.java like this</p>
  
  <pre><code>@ComponentScan("org.nerve.jiepu")
  @EnableAutoConfiguration()
  public class ApplicationTest {
  
      public static void main(String[] args) {
          SpringApplication.run(ApplicationTest.class, args);
      }
  }
  </code></pre>
  
  <p>and my POM like this:</p>
  
  <pre><code>&lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.3.0.BUILD-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  </code></pre>
  
  <p>When I run the test, I got below error information</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'app.name' in string value "${app.name}"
      at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
      at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
      at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:204)
      at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:178)
      at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$2.resolveStringValue(PropertySourcesPlaceholderConfigurer.java:172)
      at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:807)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1027)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:543)
      ... 31 more
  </code></pre>
  
  <p>But When I run this application as normal Java Application</p>
  
  <pre><code>@SpringBootApplication
  public class Application {
  
      public static void main(String[] args){
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>It work well! </p>
  
  <p>What's wrong with it ? How should I take the junit test with Spring-boot?
  Thanks a lot!</p>