title: Testing starter with Springboot+JUnit
body: <p>I have a custom library (a starter) created with SpringBoot. So, it doesn't have main method or <code>@SpringBootApplication</code> annotated class.</p>
  
  <p>I want to test this starter functionality with JUnit. I have created a class in <code>src/test</code> (<code>TestApplication</code>) to be a launcher.</p>
  
  <pre class="lang-java prettyprint-override"><code>@SpringBootTest
  @ContextConfiguration(classes = TestApplication.class)
  @RunWith(SpringRunner.class)
  public class SettingsTest {
      @Autowired
      private MyService myService;
      @Test
      public void testSettingsLoad(){
        //do smth
      }
  }
  
  @SpringBootApplication
  public class TestApplication  {
      public static void main(String[] args) {
          SpringApplication.run(TestApplication.class, args);
      }
  }
  </code></pre>
  
  <p>However, <code>TestApplication</code> <code>main</code> is not invoked and application context is not raised correctly.
  I've tryied without <code>@RunWith</code> annotation (no Spring context at all) and with adding class directly to <code>@SpringBootTest</code> annotation (also ignored).</p>
  
  <p>I've read <a href="https://stackoverflow.com/questions/43078136/how-to-integration-test-auto-configuration-for-a-custom-spring-boot-style-starte">this post</a>,
  but it wasn't really helpful.</p>
  
  <p>Any ideas appreciated.</p>