Application { public static void main(final String... args) throws Exception { try (ConfigurableApplicationContext context = SpringApplication.run(Application.class, args)) { log.info("Arguments: {}", Arrays.asList(args)); try { context.getBean(Application.class).run(context); } catch (Exception e) { log.error("Exception in command execution", e); } } }  static void main(final String... args);  }
@Test public void contextStartupTest() throws Exception { String systemOut = tapSystemOut( () -> Application.main("--line.bot.channel-secret=xxx", "--line.bot.channel-token=token")); assertThat(systemOut) .contains("No command resolved."); }