title: Only when testing: No mapping found for HTTP request
body: <p>I use <a href="http://projects.spring.io/spring-restdocs/" rel="nofollow">Spring Rest Docs</a> in version 1.1.2.RELEASE</p>
  
  <p><strong>The Test</strong>  </p>
  
  <pre><code>MvcResult result = this.mockMvc.perform(get("/api").accept(MediaType.APPLICATION_JSON))
                  .andExpect(status().isOk())
                  .andDo(print())
                  .andDo(document("index"))
                  .andReturn();
  </code></pre>
  
  <p><strong>The API</strong>  </p>
  
  <pre><code>@RequestMapping(value = "/api")
      public ResponseEntity&lt;String&gt; apiWelcome() {
          final HttpHeaders httpHeaders= new HttpHeaders();
          httpHeaders.setContentType(MediaType.APPLICATION_JSON);
          return new ResponseEntity&lt;String&gt;("{\"api\": \"test1\"}", httpHeaders, HttpStatus.OK);
      }
  </code></pre>
  
  <p>When I run the application I can access "/api" in the browser and get the expected <code>{"api": "test1"}</code> response. </p>
  
  <p>But if I run the test I get the following log entries:</p>
  
  <pre><code>c.i.crawler.testnet.measure.RestDocsTest INFO  Started RestDocsTest in 2.96 seconds
  o.s.web.servlet.PageNotFound WARN  No mapping found for HTTP request with URI [/api] in DispatcherServlet with name '' [main] 
  </code></pre>
  
  <p>and the test fails because of <code>HTTP/1.1 404 Not Found</code>.
  What am I doing wrong?</p>
  
  <p><strong>Application start</strong> </p>
  
  <pre><code>@SpringBootApplication
  @Configuration
  @EnableConfigurationProperties
  @EnableAutoConfiguration
  @ComponentScan(basePackageClasses = { SomeController.class })
  public class AppRUN {
  
      public static void main(String[] args) {
          SpringApplication.run(AppRUN.class, args);
      }
  
  } 
  </code></pre>