title: SpingBoot OutputCaptureRule is throwing IllegalStateException
body: <p>I am following instructions in <a href="https://www.docs4dev.com/javadoc/en/org/springframework/boot/spring-boot-test/2.2.2.RELEASE/org/springframework/boot/test/system/OutputCaptureRule.html" rel="nofollow noreferrer">https://www.docs4dev.com/javadoc/en/org/springframework/boot/spring-boot-test/2.2.2.RELEASE/org/springframework/boot/test/system/OutputCaptureRule.html</a></p>
  <p>I am using Maven with spring-boot-starter-parent version 2.2.2.</p>
  <p>My test is very simple:</p>
  <pre><code>@SpringBootTest(classes = MyApplication.class) // this loads Springboot context
  @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
  @ContextConfiguration(classes = {MyTestConfig.class, AnotherTestConfig.class})
  public class MyTest {
  
  
      @Rule
      public OutputCaptureRule output = new OutputCaptureRule();
  
      @Test
      public void theTest() {
          assertThat(output).contains(&quot;something&quot;);
      }
  
  }
  </code></pre>
  <p>However, when I put a breakpoint in the assert line and try to evaluate output.getOut(), the result is:
  Method threw 'java.lang.IllegalStateException' exception. The details message is:
  No system captures found. Please check your output capture registration.</p>
  <p>It seems like the feature is not working out of the box. Any idea what I am missing?</p>