title: Spring boot integration test error: "Could not resolve placeholder 'wiremock.server.port'" in tests not requiring Wiremock
body: <p>I have a <code>@SpringBootTest</code> which tests the loading of a <code>@ConfigurationProperties</code> and its methods. It is in <code>test</code> source set.</p>
  
  <p>And, in <code>itest</code>, I have an integration test which uses Wiremock(sending requests and using stubs as response, etc.)</p>
  
  <p>Now, when I run <code>gradle test</code>, the first test fails, saying:</p>
  
  <blockquote>
    <p>[ENV=local] [productName=app-gateway-api] [2019-10-22T16:18:30.994Z] [ERROR] [MSG=[Test worker] o.s.boot.SpringApplication - Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myController' defined in file [E:\coding\code\app\build\classes\java\main\com\app\controller\MyController> .class]: Unsatisfied dependency expressed through constructor
    parameter 0; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'proxyService': Injection of autowired
    dependencies failed; nested exception is
    java.lang.IllegalArgumentException: Could not resolve placeholder
    'wiremock.server.port' in value
    "<a href="http://localhost" rel="nofollow noreferrer">http://localhost</a>:${wiremock.server.port}/send"</p>
  </blockquote>
  
  <p>Which is used in some external properties. The value will be used in <code>itest</code>, but not in <code>test</code>. But the context loads it always.</p>
  
  <p>In other projects using it like this, there is no problem. But, it seems that it is loading all the classes and cannot find Wiremock and create the server.</p>
  
  <p>The test in problem:</p>
  
  <pre class="lang-java prettyprint-override"><code>@SpringBootTest
  public class MapperLookupTest {
      ...
  }
  </code></pre>
  
  <p>Wiremock dependency already has <code>compile</code> scope:</p>
  
  <pre><code>    compile('com.github.tomakehurst:wiremock-jre8-standalone:2.21.0')
      compile("org.springframework.cloud:spring-cloud-starter-contract-stub-runner")
  </code></pre>
  
  <p>I have tried to load only the necessary classes with <code>@SpringBootTest(classes = {...})</code>, but it is too verbose.</p>
  
  <p>So, is there any easy way to tell the context to load Wiremock? </p>