@Test public void stopExceptionThrownWhenContextIsNull() { Exception exception = assertThrows(RuntimeException.class, () -> BeekeeperSchedulerApiary.stop()); assertThat(exception.getMessage()).isEqualTo("Application context has not been started."); }
@VisibleForTesting public static void stop() { if (context == null) { throw new RuntimeException("Application context has not been started."); } if (runner == null) { throw new RuntimeException("Application runner has not been started."); } runner.destroy(); context.close(); }
BeekeeperSchedulerApiary implements ApplicationContextAware { @VisibleForTesting public static void stop() { if (context == null) { throw new RuntimeException("Application context has not been started."); } if (runner == null) { throw new RuntimeException("Application runner has not been started."); } runner.destroy(); context.close(); } }
BeekeeperSchedulerApiary implements ApplicationContextAware { @VisibleForTesting public static void stop() { if (context == null) { throw new RuntimeException("Application context has not been started."); } if (runner == null) { throw new RuntimeException("Application runner has not been started."); } runner.destroy(); context.close(); }  }
BeekeeperSchedulerApiary implements ApplicationContextAware { @VisibleForTesting public static void stop() { if (context == null) { throw new RuntimeException("Application context has not been started."); } if (runner == null) { throw new RuntimeException("Application runner has not been started."); } runner.destroy(); context.close(); }  static void main(String[] args); @VisibleForTesting static boolean isRunning(); @VisibleForTesting static void stop(); @VisibleForTesting static MeterRegistry meterRegistry(); @VisibleForTesting static void resetStaticContext(); @Override void setApplicationContext(ApplicationContext applicationContext); }
BeekeeperSchedulerApiary implements ApplicationContextAware { @VisibleForTesting public static void stop() { if (context == null) { throw new RuntimeException("Application context has not been started."); } if (runner == null) { throw new RuntimeException("Application runner has not been started."); } runner.destroy(); context.close(); }  static void main(String[] args); @VisibleForTesting static boolean isRunning(); @VisibleForTesting static void stop(); @VisibleForTesting static MeterRegistry meterRegistry(); @VisibleForTesting static void resetStaticContext(); @Override void setApplicationContext(ApplicationContext applicationContext);  }